A Discord Bot is a Discord bot that uses Linear Regression Machine Learning model to help properly react to when a member of a discord server properly informs the other members of the server that it is time to play Overwatch.
If the message has an easily regexable or searchable text fragment it's checked first using regex, str.__contains__
, or equality before falling back to the ML Model to help boost accuracy.
Any message the ML Model is the sole source of flagging will be reacted to with the 🤖 emoji.
The motivation of this bot was to have a bot that automatically responds with reactions on a message and posts a gif in response to a message containing multiple a
's at the end of a message or a message that is only 'a'
. These are both used in a Discord Server I am in to signal to the others that it is time to play Overwatch.
Also I kinda wanted to make a basic Discord Bot for fun.
Help get me off Heroku free dynos
pip3 install -r requirements.txt
DISCORD_TOKEN: The Bot's Discord Token
GIPHY_TOKEN: The Giphy API Token
DATABASE_URL: [Optional] The URL to the database to store posting history to prevent spam.
Defaults to sqlite in memory if blank
-
A Discord App setup as a Bot
- You'll need the following scopes for OAuth2
bot
Send Messages
Add Reactions
- You can install the bot into a Discord Server via the OAuth2 generated URL
- e.g.
https://discord.com/api/oauth2/authorize?client_id=<1234>&permissions=2112&scope=bot
- e.g.
- You'll need the following scopes for OAuth2
-
- A basic API key is fine, it's only used to call the Search Endpoint
-
Set the Environment Variables
export DISCORD_TOKEN=xxxx
export GIPHY_TOKEN=xxxx
python3 bot.py
This is how we signal to each other that it's time to feed on Overwatch
The bot is currently deployed on Heroku using free dynos.
The deployment is automated using the Deploy to Heroku Action from AkhileshNS.