A python telegram bot to generate hilarious messages using markov chains.
Go to file
Raphael Jacobs 6be6817780 last one for real 2022-02-23 04:54:27 +01:00
src last one for real 2022-02-23 04:54:27 +01:00
tgbarebot@977491a3f6 initial commit with sqlite support! hooray 2022-02-03 07:24:43 +01:00
.gitignore Initial commit 2022-02-01 09:46:00 +01:00
.gitmodules initial commit with sqlite support! hooray 2022-02-03 07:24:43 +01:00
LICENSE Initial commit 2022-02-01 09:46:00 +01:00
README.md vastly improved documentation 2022-02-10 06:27:49 +01:00
main.py fix second typo 2022-02-23 04:53:13 +01:00

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.