diff --git a/README.md b/README.md index a4441b4..731bec7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,27 @@ -# IT Discord Bot - +# Tux Bot +This is just a little fun bot. It can give you an excuse, if you're stuck while programming. ## Getting started +Create a file calles `secret.json` in the directory, where the `docker-compose.yml` file is. Put there your discord bot token in: +```json +{ + "BOT_TOKEN": "YOUR_TOKEN" +} +``` +And start the discord bot with: + +```shell +docker-compose up --build +``` +For getting the right invite link with the right permissions, run: + +```shell +python3 create_invite_link.py YOUR_BOTS_ID +``` +You can get the ID from the developer portal or from the terminal log while starting the discord bot + +## Privacy + +The discord bot will only log, whenever a command was called and whenever the bot was added or removed from a discord server. It won't log any user/server specific information. \ No newline at end of file diff --git a/src/bot.py b/src/bot.py index 1d12877..3a7347f 100644 --- a/src/bot.py +++ b/src/bot.py @@ -3,6 +3,7 @@ import asyncio import os import discord +from discord import Guild from discord import app_commands from discord import Interaction @@ -31,6 +32,16 @@ async def load_cogs(): await bot.load_extension(f"cogs.{filename[:-3]}") +@bot.event +async def on_guild_join(guild: Guild): + logger.info("Joined guild") + + +@bot.event +async def on_guild_remove(guild: Guild): + logger.info("Left guild") + + @bot.event async def on_ready(): logger.info(f"Logged in as: {bot.user.name} with ID {bot.user.id}")