Generate pseudo random sentences using the markov chain model. You will need Python3+ to use this project.
$ git clone https://github.com/joaorafaelm/markov-bot
$ cd markov-bot
$ pipenv install --dev
In order to run the bot, you need to define the env vars TELEGRAM_TOKEN
and ADMIN_USERNAMES
*:
$ cp local.env .env
$ vim .env
Optionally you can set another trigger command to generate sentences. (default: /sentence
)
After defining the variables, run:
$ pipenv run python markov.py
Add the bot to a group chat, disable the bot privacy settings (it means that the bot will receive all messages, not just the ones starting with "/") and run the command /enable
to start collecting text.
Run /sentence
(or the command you defined using the env var SENTENCE_COMMAND
) to generate random sentences.
You might need a reasonable amount of text before getting some sentences. If you wish to delete the model, run /remove
.
Have fun :)