- Possibilities:
- Send word of a day.
- Set daily timer for sending word of a day in chat.
- Translate words from english to russian and vice versa.
- Wod_parser: module with parsing functions using 'requests' lib.
- There are presented different parsing functions to work with wod_bot.py
- Each function parses text.data from prepared url links of 'word of a day' and 'english-russian translator' websites.
- Then drops useless data from html and prepare text information for exporting in word_bot for Telegram bot uses.
- Wod_bot: module with bot logic.
- First, a few handler functions are defined.
- Then, those functions are passed to the Dispatcher and registered at their respective places.
- After that the bot is started and runs until we press Ctrl-C on the command line.
- Make sure to replace TOKEN in 'main()' function row: 'updater = Updater(TOKEN)' with 'token' provided by BotFather
To learn how to add Bot via BotFather in Telegram (visit https://core.telegram.org/bots to learn how to create bot with Telegram's BotFather
-
Make sure that Docker process is running and use command:
docker pull skrubber/wod_bot_image:latest
-
After downloading of image use following template of run command:
Note:
Text in square brackets such as "[bracket text]" could be replaced with your values or ignored.
Text in round brackets such as "{TOKEN or PORT} must be presented and replased by your values!"
docker run -d [--name wod_bot] -p {8080}:80 -e TO_BOTFATHER={"some_token:123133515"} skrubber/wod_bot_image:latest
Note:
If container stops immediatly addtail -f /dev/null
in the end of docker run command.
- Add Bot via BotFather in Telegram (visit https://core.telegram.org/bots to learn how to create bot with Telegram's BotFather