11import random
2-
32import discord
43from discord .ext import commands
54
6- # your token here, inside the ""
5+ # Your token here, inside the ""
76TOKEN = ""
8- # channel to send welcome messages to
7+ # Channel to send welcome messages to
98WELCOME_CHANNEL = "welcome"
10- # all the nicknames for the random_nickname command
9+ # All the nicknames for the random_nickname command
1110NICKS = ["example1" , "example2" , "example3" ]
1211
13- # you can change the prefix here
12+ # You can change the prefix here
1413bot = commands .Bot (command_prefix = "!" )
1514
1615
1716@bot .event
1817async def on_ready ():
19- print ("bot started" )
18+ print ("Bot started" )
2019
2120
2221@bot .event
2322async def on_member_join (member ):
24- welcome_channel = discord .utils .get (member .guild .channels ,
25- name = WELCOME_CHANNEL )
26- # feel free to change this message!
27- await welcome_channel .send (
28- f"welcome { member .mention } , please read our rules and have a great time!"
29- )
23+ welcome_channel = discord .utils .get (member .guild .channels , name = WELCOME_CHANNEL )
24+ # Feel free to change this message!
25+ await welcome_channel .send (f"Welcome { member .mention } ! Please read our rules and have a great time!" )
3026
3127
3228@commands .has_permissions (ban_members = True )
3329@bot .command ()
3430async def ban (ctx , user : discord .Member ):
3531 """Ban the given user"""
3632 await ctx .guild .ban (user , delete_message_days = 0 )
37- await ctx .send (f"banned { user } " )
33+ await ctx .send (f"Banned { user } " )
3834
3935
4036@commands .has_permissions (ban_members = True )
4137@bot .command ()
4238async def unban (ctx , user : discord .User ):
43- "Unban the given user"
39+ """ Unban the given user"" "
4440 await ctx .guild .unban (user )
45- await ctx .send (f"unbanned { user } " )
41+ await ctx .send (f"Unbanned { user } " )
4642
4743
4844@commands .has_permissions (kick_members = True )
4945@bot .command ()
5046async def kick (ctx , user : discord .User ):
51- "Kick the given user"
47+ """ Kick the given user"" "
5248 await ctx .guild .kick (user )
53- await ctx .send (f"kicked { user } " )
49+ await ctx .send (f"Kicked { user } " )
5450
5551
5652@bot .command (aliases = ["rnick" ])
@@ -64,9 +60,9 @@ async def random_nick(ctx):
6460@commands .has_permissions (manage_nicknames = True )
6561@bot .command (aliases = ["change_name" ])
6662async def change_nick (ctx , user : discord .Member , * , new_nick ):
67- """Change somebody elses nickname. """
63+ """Change somebody else's nickname"""
6864 await user .edit (nick = new_nick )
69- await ctx .send (f"Changed the nick of { user .mention } to `{ new_nick } `" )
65+ await ctx .send (f"Changed the nickname of { user .mention } to `{ new_nick } `" )
7066
7167
7268if __name__ == "__main__" :
0 commit comments