We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b92948f commit 7914ce0Copy full SHA for 7914ce0
1 file changed
DiscordBot/main.py
@@ -10,5 +10,26 @@
10
bot = commands.Bot(command_prefix="!")
11
12
13
+@bot.event
14
+async def on_ready():
15
+ print("bot started")
16
+
17
18
+@commands.has_permissions(ban_members=True)
19
+@bot.command()
20
+async def ban(ctx, user: discord.Member):
21
+ """Ban the given user"""
22
+ await ctx.guild.ban(user, delete_message_days=0)
23
+ await ctx.send(f"banned user {user}")
24
25
26
27
28
+async def unban(ctx, user: discord.User):
29
+ "Unban the given user"
30
+ await ctx.guild.unban(user)
31
+ await ctx.send(f"unbanned user {user}")
32
33
34
if __name__ == "__main__":
35
bot.run(TOKEN)
0 commit comments