REPO DISCONTINUED AND MOVED TO https://github.com/fopina/tgbotplug/tree/master/plugin_examples
Plugin Examples for tgbotplug
git clone https://github.com/fopina/tgbotplug-plugins/
pip install -r requirements.txt
And then either run bot.py (specifying your bot token) or you can run the library directly from command line passing these plugins (and your own) as parameters:
python -m tgbot -t YOUR_BOT_TOKEN -n plugins.simsimi.SimsimiPlugin \
plugins.echo.EchoPlugin plugins.random.RandomPlugin plugins.google.GooglePlugin \
plugins.guess.GuessPlugin plugins.admin.AdminPlugin
echo and random are the simplest plugins, use TelegramBot.send_message and TGBot.need_reply
google is an example on how to use TelegramBot.send_photo
guess shows off plugin data persistence using TGPluginBase.save_data and TGPluginBase.read_data
Check simsimi for a non-command plugin example.
You can also check multibot.py for an example on how to run multiple bots in the same process.
You can run try it with:
./multibot.py --token1 YOUR_BOT1_TOKEN --token2 YOUR_BOT2_TOKEN
BOT1
will answer to /echo
command and BOT2
to /random
.