Raphael Jacobs 6be6817780 | ||
---|---|---|
src | ||
tgbarebot@977491a3f6 | ||
.gitignore | ||
.gitmodules | ||
LICENSE | ||
README.md | ||
main.py |
README.md
markovbot
A python telegram bot to generate hilarious messages using markov chains.
Installation:
Create a telegram bot using @botfather. Change its privacy accordingly, in case you want to use this bot on a group.
git clone --recurse-submodules http://git.dekedin.me/raphy/markovbot.git
cd markovbot
touch conf.ini
Edit conf.ini
as specified below, and then run main.py
.
Configuration
Here's a sample configuration file:
[Telegram]
token = <YOUR BOT TOKEN>
[AccessControl]
groups = -4444,-020202,-1111
The token entry is necessary. Insert your bot token there.
AccessControl is entirely optional. If the whole AccessControl block is removed, the bot will work in "single database", where every message from every chat and group will be stored in the same "pool".
This is not a great idea to prevent spammers and protect privacy, so you can specify a list of comma-separated groups that are allowed to use the bot using the groups=
voice.
They don't have to be groups, just the chat_id matters. Moreover, every group will have an isolated pool of words.
Usage
/gen
- will generate a message. Use /gen <number>
to generate more. Currently there's a hard limit of 19 messages.
/status
- will print some statistics regarding the bot.
/debug
- prints chat information. Useful to discover chat_id
.
/start
- just says hi.
future goals
More config options and more commands, I guess.