In this repository you will find Telegram Bot scripted using python-telegram-bot
library.
Each Bot code is stored in a different subfolder.
In each subfolder must be created also a config.yml
with API
key where bot API key must be stored.
In this yaml file can be stored other useful informations.
The only objects in common with each bot will be classes Bot
and BotRunner
stored Bot.py
This is the mother class that will be used to create other Bot classes as children. Nothing important expect for 3 abstractmethod that must be included in each Bot class:
_set_handlers
: A method where dictionaryself._handlers
must be initialized. SeeBot
class for details._start
: The command that is launched when bot is started_help
: An help function to help the user
This class takes care of run Bot class.
### Exaple
from TelegramBot.Bot import BotRunner
# initialize bot
bot = WhateverBot()
# run it
bot_runner = BotRunner(bot)
bot_runner.run()