This bot will read messages from any channel it is in, search the message for a RegEx pattern defined in the first column of 'replies.csv', and replies with the second column of 'replies.csv' if a match is found. It was not designed as a public bot, but pull requests to support this feature and store responses per server are welcomed.
- Create your Discord bot user and invite it to your server by following this guide: https://discordpy.readthedocs.io/en/stable/discord.html
- Download and install latest version of Python.
git clone
this repository or download zip (under the green Code button or from Releases page) and extract it.- Open
cmd
and go into the repository folder by typingcd <REPOSITORY_FOLDER_PATH>
- Create virtual environment:
python -m venv bot-env
- Activate virtual environment:
bot-env\Scripts\activate
on Windows,bot-env/bin/activate
on Linux. - Install dependencies:
pip install -r requirements.txt
- Run the bot:
python bot.py
which will generate the config.ini file. It will then exit, telling you to get your bot's token from https://discord.com/developers/applications. - Edit config.ini so that
token = <YOUR_BOT_TOKEN>
- Repeat step #8.
Help! I get gcc build errors when installing the multilib or yarl dependencies!
Try
MULTILIB_NO_EXTENSIONS=1 YARL_NO_EXTENSIONS=1 pip install -r -requirements.txt
. This issue occurs when multilib and yarl wheel binaries are not available for your operating system, so these extra flags will disable the compiled speedups and use the slower Python scripts instead.
RegEx Pattern | Message to Send | Requires Mention? | React with Emoji |
---|---|---|---|
\bfries\b | "there is the thin skinless ones, thick skinless, thic with skin, truffle oil, sour scream fries, fries dip on MCD ice cream cone" | 0 | 🍟 |
Type these commands in any text channel the bot is in to execute them. Only works with users having the Administrator role in that channel.
-
!list
-
!list <index>
-
!add <row>
Adds a comma-delimited string as a new row into the .csv file.
The 'row' parameter is entered exactly as how you would type it in the .csv file. In this example, the parameter can be broken into 4 parts:
\bsomething\b
,i'm alive!
,0
and<custom emoji>
. It corresponds to the 4 fields shown in the previous 'replies.csv Example' section. -
!reload
-
!delete <index>