A discord bot that generates and sends messages based on Markov Chain Model.
- Implemented Markov Chain Model to generate text messages.
- Utilized queue data-structure to create Markov Chain.
- Utilized SQL async io operations using aiosqlite.
-
Clone the repository
git clone https://github.com/m-nobinur/d-markov-chatbot.git
-
Setup an app on discord, instructions.
-
Get the bot token<YOUR_BOT_TOKEN>.
-
Invite your bot using following link: https://discord.com/oauth2/authorize?&client_id=APPLICATION_ID&scope=bot+applications.commands&permissions=PERMISSIONS_INT
Replace
APPLICATION_ID
with the application ID and replacePERMISSIONS_INT
with the required permissions integer -
Either set BOT_USER_TOKEN=YOUR_BOT_TOKEN in quote-bot.py or use the token as argument when run the script.
Open terminal and go to d-markov-chatbot
folder.
cd d-markov-chatbot
Install all the requirements
pip install -r requirements.txt
or
pip3 install -r requirements.txt
Set BOT_TOKEN
variable to <YOUR_BOT_TOKEN> & set a BOT_PREFIX
then run the script as following (On Mac/Linux)
python3 chat-bot.py
(On Windows)
python chat-bot.py
ℹ️ Use virtual environment for best practices.
Variable | What it is |
---|---|
>info | Show bot & channels info. |
>help | Show available commands and their usages. |
>chat <channel_mention> | Add the mentioned channel to Chatting channel list. |
>train <channel_mention> | Add the mentioned channel to Training channel list. |
>reset | Reset the whole database. |
Bot will start messaging in chat channel when user will send a message. Make sure there at least 30 messages sent in the traning channels.