discord-bot/cogs/moderationCog.py
2021-05-18 18:48:42 -04:00

18 lines
No EOL
574 B
Python

import discord
from discord.ext import commands
class ModerationCog(commands.Cog):
def __init__(self, client):
self.client = client
# Commands
@commands.command()
@commands.has_permissions(kick_members = True)
async def kick(self, ctx, member : discord.Member, *, reason="No reason provided."):
await ctx.send(member.mention + " has been kicked.")
await member.send("You have been kicked from the server because: " + reason)
await member.kick(reason=reason)
def setup(client):
client.add_cog(ModerationCog(client))