ban command
This commit is contained in:
parent
3aa4595aa9
commit
06f60e29e5
3 changed files with 17 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
.env
|
||||
.env
|
||||
__pycache__
|
11
cogs/mod.py
Normal file
11
cogs/mod.py
Normal file
|
@ -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)
|
5
main.py
5
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue