def xban(self, ctx, user_id: int):
"""
Allows the banning of a user not int he guild via ID
"""
try:
await ctx.bot.http.ban(user_id, ctx.message.guild.id, 0)
except discord.Forbidden:
await ctx.channel.send(":x: 403 FORBIDDEN")
except discord.NotFound:
await ctx.channel.send(":x: User not found.")
else:
await ctx.channel.send(f":negative_squared_cross_mark: Banned user {user_id} - <@{user_id}>.")
评论列表
文章目录