From 06f60e29e51f3a0e3c4172170209b7bbc4293973 Mon Sep 17 00:00:00 2001 From: nin0 Date: Sun, 4 May 2025 19:18:08 -0400 Subject: [PATCH] ban command --- .gitignore | 3 ++- cogs/mod.py | 11 +++++++++++ main.py | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 cogs/mod.py diff --git a/.gitignore b/.gitignore index 2eea525..dc12cb7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.env \ No newline at end of file +.env +__pycache__ \ No newline at end of file diff --git a/cogs/mod.py b/cogs/mod.py new file mode 100644 index 0000000..7426302 --- /dev/null +++ b/cogs/mod.py @@ -0,0 +1,11 @@ +from discord.ext import commands +import discord +from main import Vaius + +class Mod(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @commands.command() + async def ban(self, ctx: commands.Context, user: discord.User): + await ctx.channel.remove_recipients(user) \ No newline at end of file diff --git a/main.py b/main.py index 36c19e5..2834392 100644 --- a/main.py +++ b/main.py @@ -3,14 +3,17 @@ from discord.ext import commands from dotenv import load_dotenv import os +from cogs.mod import Mod + load_dotenv() class Vaius(commands.Bot): async def on_ready(self): print(f"Logged in as {self.user.name}") + await self.add_cog(Mod(self)) async def on_message(self, message: discord.Message): - if (message.guild and message.guild.id != 1362175947612098892) and message.channel.id != 1363685774800978074: + if message.channel.id != 1363685774800978074: return ctx = await self.get_context(message) if ctx.valid: