This is a Discord bot that aims to deliver tools for all Discord users, with moderation and fun commands, including tools for automate tasks on servers. It is also easy to mantain, thanks to its modular design. Built on top of the discord.py library.
Yes, of course you can self-host this bot. To do this, you can follow the following instructions:
- You need Python 3.5 or Python 3.6 with
pip
installed. Thevirtualenv
tool is optional but recommended. - Clone this repo and change to the project directory (e.g.,
cd alexis-bot
). - Make a virtualenv with
virtualenv .venv
(if you have it) and activate it. - Install dependencies:
pip install -r requirements.txt
- Copy the
config.yml.example
toconfig.yml
- Open the
config.yml
file and add your bot token to the right of thetoken:
line. - Add yourself as the bot owner by adding your user ID to the
bot_owners
line (change the current ID) - Edit other values to your liking on the configuration file, then save and close it.
- Run the bot with
python run.py
You can add the bot with this link. The bot will provide you with tools to administrate your server, like invite filters, auto-roles, mute commands, etc. Check out this guide for more information.
This bot has a lot of """funny""" and useful commands, for example, providing random cats, displaying the current weather, fetch a term definition on Urban Dictionary, and more. Check out this page for more details about all the available commands.
As mentioned before, this bot tries to be as modular as possible, by making it easy to create and maintain command
modules. For example, if you want to add a !ping
command, create a file inside the modules
folder and add this
content:
from bot import Command
class Ping(Command):
def __init__(self, bot):
super().__init__(bot)
self.name = 'ping'
self.help = 'Answers to the *ping* command'
async def handle(self, cmd):
await cmd.answer('Pong!')
The following picture shows the complete form of the ping.py
script:
In another example, you can make the bot greet new users, by using event handlers:
from bot import Command
class Welcome(Command):
def __init__(self, bot):
super().__init__(bot)
async def on_member_join(self, member):
chan = self.bot.get_channel('<channel_id>')
await self.bot.send_message(chan, 'Welcome to our server, {}!'.format(member.display_name))
You can see a more elaborated example in the greeting.py
script.
More options and more documentation about the modules API can be found here.
I want to thank all the people that has collaborated with this project, specially the code contributors: jvicu2001, AnEpicName and HenryDelMal. My most special thanks goes to santisteban (a.k.a. ibk) for creating this project. Sadly, the code has been so heavily modified and none of his code can be found in the current status.
When you use the bot it may log some information related to your use of Discord.
The bot does not store information about your account but it does log actions when you edit or delete your messages from a server to log those actions to the servers staff members if they enabled moderation log, and they may choose to log that information to a hidden channel.
You can opt-out from this information being logged by using the following command: !optout
(with the command prefix being !
).
This project is licensed under the MIT license.