2014-06-30 12:34:41 +02:00
|
|
|
telegram-bot
|
|
|
|
============
|
|
|
|
|
2014-10-11 12:34:51 +02:00
|
|
|
A telegram bot using https://github.com/vysheng/tg.
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
2014-11-17 22:04:24 +01:00
|
|
|
```bash
|
|
|
|
$ wget http://luarocks.org/releases/luarocks-2.2.0.tar.gz
|
|
|
|
$ tar -xzvf luarocks-2.2.0.tar.gz
|
|
|
|
$ cd luarocks-2.2.0/
|
|
|
|
$ ./configure
|
|
|
|
$ make && sudo make install
|
2014-11-17 22:15:03 +01:00
|
|
|
$ sudo luarocks install oauth # You need unzip
|
2014-11-17 22:04:24 +01:00
|
|
|
```
|
|
|
|
|
2014-08-05 11:44:15 +02:00
|
|
|
```bash
|
2014-10-11 12:38:13 +02:00
|
|
|
# Tested on Ubuntu 14.04, for other OSs check out https://github.com/vysheng/tg#installation
|
2014-11-19 20:14:30 +01:00
|
|
|
$ sudo apt-get install lua-socket libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev
|
|
|
|
$ git clone git@github.com:yagop/telegram-bot.git --recursive
|
2014-10-11 16:27:05 +02:00
|
|
|
$ cd telegram-bot/tg
|
2014-10-11 12:34:51 +02:00
|
|
|
$ ./configure && make
|
2014-10-11 16:27:05 +02:00
|
|
|
$ cd .. && ./launch.sh # Will ask you for a phone number & confirmation code.
|
2014-08-05 11:44:15 +02:00
|
|
|
```
|
2014-06-30 13:00:30 +02:00
|
|
|
|
2014-08-06 01:19:31 +02:00
|
|
|
Command list
|
2014-10-11 16:27:05 +02:00
|
|
|
------------
|
2014-08-06 01:19:31 +02:00
|
|
|
```
|
2014-10-10 15:25:01 +02:00
|
|
|
!help : print command list
|
|
|
|
!ping : bot sends pong
|
2014-08-06 01:19:31 +02:00
|
|
|
!sh (text) : send commands to bash (only privileged users)
|
2014-10-10 15:25:01 +02:00
|
|
|
!echo (text) : echo the msg
|
2014-08-06 01:19:31 +02:00
|
|
|
!version : version info
|
|
|
|
!cpu : status (uname + top)
|
|
|
|
!fwd : forward msg
|
|
|
|
!forni : send text to group Fornicio
|
|
|
|
!fortune : print a random adage
|
2014-11-03 23:44:21 +01:00
|
|
|
!weather (city) : weather in that city (Madrid is default)
|
|
|
|
!9gag : send random url image from 9gag
|
|
|
|
!rae (word) : Spanish dictionary
|
|
|
|
!eur (USD) : EURUSD market value
|
2014-09-25 23:39:35 +02:00
|
|
|
!img (text) : search image with Google API and sends it
|
2014-08-06 01:19:31 +02:00
|
|
|
!uc3m : fortunes from Universidad Carlos III
|
2014-11-03 23:44:21 +01:00
|
|
|
!set [variable_name] [value] : store for !get
|
|
|
|
!get (variable_name) : retrieves variables saved with !set
|
2014-08-06 01:19:31 +02:00
|
|
|
```
|