LinkBot is a general-purpose Discord bot. He is written in Python, using discord.py-rewrite API wrapper (documentation).
- Per-server ๐ Admins to restrict sensitive commands.
- Per-server ๐ Birthday tracking. LinkBot will remind a channel of your birthday when it comes around.
- Per-server ๐ฌ Quote tracking to store all of your friends' embarassing, disappointing, out-of-context quotes.
- Per-server ๐๏ธโ๐จ๏ธ Topic system that enables users to subscribe to topics they like. You can ping topics with a command when you want to post relevant information.
- A ๐ reminder system that will DM you when the time comes.
- Youtube ๐ฅ video and Google ๐ผ๏ธ image first-result search embedding.
- Automatic ๐ช role-setting for new users in your server.
- And more!
- pip requirements
Download the dependencies using pip:pip install -r requirements.txt
- Discord API Application and Bot Account
You can get both of these at the Discord Developer portal here. - Neo4j Database
You will need the community server version of Neo4j for the database. You can find it here - Configuration file
If you run the program once, a config file will automatically be generated for you. From here, you can read through the file and fill in the required information. It has lots of comments ๐
Optionally, you will also need:
- a Google API key (for image and YouTube searches)
- a Google Custom Search (also required for image search)
- a Riot Games API key (for League of Legends game lookup)
If these are not included, the functionality will be automatically disabled.
LinkBot works like most other discord bots: by reacting to user commands. The prefix for commands is stored in the config file, and when LinkBot receives a command in a server that has the prefix attached, or through a direct message with/without the prefix, the associated command function for that command will be run.
- Create a script for your command at
./linkbot/commands/<yourcommand>.py
. - Import the helper file:
from linkbot.utils.cmd_utils import *
. - Create a function for your command:
async def <yourcommand>():
. - Decorate your function with
@command()
and fill out the required parameters. - Write your script, using any of the helper functions and decorators that are included from the helper file.
- Possibly add functionality to the main bot files
./linkbot/*
that is required for your command. - That's it!
- From here, your command should be callable by addressing the bot using the prefix specified in your config.
- Your command should also be available via the
help
command.