A Telegram Bot written in Python with plugins based in yagop telegram-bot using tg
Currently the bot is in development, feel free to contribute, it would be really appreciated!
Name | Description | Usage |
---|---|---|
calc.py | A calculator to evaluate expressions | !calc (expression) |
channels.py | Plugin to manage channels. Enable or disable channel. |
!channel enable: enable current channel !channel disable: disable current channel |
clever.py | Cleverbot plugin. | !clever (text): Say the text to cleverbot and receive the answer |
download_media.py | When bot receives a media msg, download the media to the file system. | This plugin is automatic when someone send a file. |
echo.py | Simplest plugin ever! | !echo (text) |
help.py | Help plugin. Get info from other plugins. |
!help: Show list of plugins. !help all: Show all commands for every plugin. !help [plugin name]: Commands for that plugin. |
imgtosticker.py | Convert a photo to sticker! | !imgtosticker start: Next photo you send, as image or document, it will try to convert to sticker and send you. !imgtosticker stop: Stop the service, won't convert the next image. If you are in "start" mode, send a photo as document or image, and get the sticker! |
media.py | When user sends media URL (ends with gif, mp4, pdf, etc.) download and send it to origin. | This plugin is automatic when you send an URL. |
money.py | Currency converter | !money (from currency) (amount) (to currency) |
plugins.py | Plugin to manage other plugins Enable, disable or reload. |
!plugins: list all plugins. !plugins enable [plugin]: enable plugin. !plugins disable [plugin]: disable plugin. !plugins disable [plugin] chat: disable plugin only this chat. !plugins reload: reloads all plugins. |
In order to install it, you need some system dependencies.
- tg dependencies:
# Tested on Ubuntu 14.04, for other OSs check out https://github.com/vysheng/tg#installation
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
- bot dependencies:
sudo apt-get install git python3 libpython3-dev python-pip python3-pip
sudo pip3 install virtualenv
- Optional dependencies: If you want to have all the plugins, you will have to install some more dependencies:
sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms1-dev libwebp-dev
./launch.sh optdeps
To install in other OS, see this are the libraries that need extra dependencies:
Plugins that you'll can't use if you don't install this optional dependencies:
imgtosticker
: Use PIL (pillow)
Once you have all dependencies, and the optional if you want, install the bot and run it:
- bot:
cd $HOME
git clone https://github.com/rockneurotiko/pybotgram/
cd pybotgram
./launch.sh install
./launch.sh # Will ask you for a phone number & confirmation code
# (The number is like +cc00000000 where cc is the country code)
Enable more plugins
See the plugins list with !plugins
command.
Enable a disabled plugin by !plugins enable [name]
.
Disable an enabled plugin by !plugins disable [name]
.
Those commands require a privileged user, privileged users are defined inside data/config.json
(generated by the bot), stop de bot and edit if necessary.
The privileged users are identified with his telegram ID, and you can write all you want in data/config.json
, in the list sudo_users
, like this:
"sudo_users": [00000000, 11111111, 22222222, 33333333]
You can contact me via Telegram but if you have an issue please open one.