Skip to content

A bot that uses Markov chains to generate messages based on those sent to the conversation

Notifications You must be signed in to change notification settings

droptrigger/telegram-markov-chain-message-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Russian

Text generation based on sent messages

! WITHOUT OUTSIDE LIBRARIES !

A bot that uses Markov chains to generate messages based on those sent during the conversation.
My TG channel - Click

📖 Description

After adding to the conversation, the bot creates a text document with all the words that you write in the conversation.

Next, using an algorithm, a message is generated from these words using the Markov chain method. You can generate messages yourself, or you can configure the chance of a response to a message in config.

  • citatgen - Random message generation.
  • citatgen <number> - Generating a random message from a certain number of words.

🤖 Launching the bot

1. First, you will need to clone the repository to your computer via Git Bash.

git clone https://github.com/droptrigger/telegram-markov-chain-message-generator.git

2. We will install all the necessary libraries:

pip install aiogram
pip install numpy

3. Go to https://t.me/BotFather and we create a bot. We allow you to invite him to the channels (It should be enabled).

4. In the same BotFather, we copy the API token.

5. In config enter this token instead of a pass. Setting up variables.

6. Adding a bot to the conversation.

! Please note!

The bot will not be able to generate quotes for the first 3-10 messages, as there are not enough words for it :)

✅ Well done! Общайтесь! Теперь все должно работать.

About

A bot that uses Markov chains to generate messages based on those sent to the conversation

Topics

Resources

Stars

Watchers

Forks

Languages