+subfolders
This commit is contained in:
parent
cf47df21ec
commit
e0e38402eb
3 changed files with 23 additions and 2 deletions
30
cogs/moderation/kick.py
Normal file
30
cogs/moderation/kick.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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."):
|
||||
try:
|
||||
await member.kick(reason=reason)
|
||||
await ctx.send(member.mention + " has been kicked.")
|
||||
except:
|
||||
await ctx.send(f"Unable to kick {member.mention}.\nIs {member.mention} at the same role level or higher than {self.client.user.name}?")
|
||||
|
||||
|
||||
@commands.command()
|
||||
@commands.has_permissions(ban_members = True)
|
||||
async def ban(self, ctx, member : discord.Member, *, reason="No reason provided."):
|
||||
try:
|
||||
await member.ban(reason=reason)
|
||||
await ctx.send(member.mention + " has been banned.")
|
||||
except:
|
||||
await ctx.send(f"Unable to ban {member.mention}.\nIs {member.mention} at the same role level or higher than {self.client.user.name}?")
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(ModerationCog(client))
|
||||
Loading…
Add table
Add a link
Reference in a new issue