2
2
Contains commands relating to administrator tasks.
3
3
"""
4
4
5
- import black
6
- import discord . ext . commands as commands
7
- import discord . ui as UI
5
+ import nextcord . ext . commands as commands
6
+ import nextcord . ui as UI
7
+ import nextcord
8
8
import helpers
9
9
import asyncio
10
10
import discord
@@ -31,13 +31,13 @@ async def clear(ctx: commands.Context, amount: int | None):
31
31
The number of messages to clear.
32
32
"""
33
33
if amount is not None : # If the user selected an amount, clear that amount of messages
34
- await ctx .send (embed = discord .Embed (title = f'🛠️ Deleting **{ amount } ** messages.' ))
34
+ await ctx .send (embed = nextcord .Embed (title = f'🛠️ Deleting **{ amount } ** messages.' ))
35
35
return await ctx .channel .purge (limit = amount )
36
36
37
37
# Else, create two buttons
38
38
# Then ask the user if they would like to clear all messages in the channel
39
- yes_button = UI .Button (label = 'Yes' , style = discord .ButtonStyle .green )
40
- no_button = UI .Button (label = 'No' , style = discord .ButtonStyle .red )
39
+ yes_button = UI .Button (label = 'Yes' , style = nextcord .ButtonStyle .green )
40
+ no_button = UI .Button (label = 'No' , style = nextcord .ButtonStyle .red )
41
41
42
42
yes_button .callback = lambda interaction : \
43
43
(await interaction .channel .purge (limit = None ) for _ in '_' ).__anext__ ()
@@ -58,7 +58,7 @@ async def clear(ctx: commands.Context, amount: int | None):
58
58
@commands .command ()
59
59
@commands .has_permissions (kick_members = True )
60
60
@commands .cooldown (1 , 30 , commands .BucketType .user )
61
- async def kick (ctx : commands .Context , member : discord .Member , * , reason = None ):
61
+ async def kick (ctx : commands .Context , member : nextcord .Member , * , reason = None ):
62
62
"""
63
63
Kicks a specified member from a server.
64
64
@@ -80,7 +80,7 @@ async def kick(ctx: commands.Context, member: discord.Member, *, reason=None):
80
80
@commands .command ()
81
81
@commands .has_permissions (ban_members = True )
82
82
@commands .cooldown (1 , 30 , commands .BucketType .user )
83
- async def ban (ctx : commands .Context , member : discord .Member , * , reason = None ):
83
+ async def ban (ctx : commands .Context , member : nextcord .Member , * , reason = None ):
84
84
"""
85
85
Bans a specified member from a server.
86
86
@@ -102,7 +102,7 @@ async def ban(ctx: commands.Context, member: discord.Member, *, reason=None):
102
102
@commands .command ()
103
103
@commands .has_permissions (ban_members = True )
104
104
@commands .cooldown (1 , 30 , commands .BucketType .user )
105
- async def softban (ctx : commands .Context , member : discord .Member , days = 1 , reason = None ):
105
+ async def softban (ctx : commands .Context , member : nextcord .Member , days = 1 , reason = None ):
106
106
"""
107
107
Temporarily bans a specified member from a server.
108
108
@@ -128,7 +128,7 @@ async def softban(ctx: commands.Context, member: discord.Member, days=1, reason=
128
128
@commands .command ()
129
129
@commands .has_permissions (ban_members = True )
130
130
@commands .cooldown (1 , 2 , commands .BucketType .user )
131
- async def unban (ctx : commands .Context , user : discord .User ):
131
+ async def unban (ctx : commands .Context , user : nextcord .User ):
132
132
"""
133
133
Unbans a specified user from a server.
134
134
@@ -205,10 +205,10 @@ async def clearblacklist(ctx: commands.Context):
205
205
if id not in blacklist .keys ():
206
206
return await ctx .send (f':x: { mention } : This server does not have any words blacklisted.' )
207
207
208
- yes_button = UI .Button (label = 'Yes' , style = discord .ButtonStyle .green , emoji = '👍🏻' )
209
- no_button = UI .Button (label = 'No' , style = discord .ButtonStyle .red , emoji = '👎🏻' )
208
+ yes_button = UI .Button (label = 'Yes' , style = nextcord .ButtonStyle .green , emoji = '👍🏻' )
209
+ no_button = UI .Button (label = 'No' , style = nextcord .ButtonStyle .red , emoji = '👎🏻' )
210
210
211
- async def yes (interaction : discord .Interaction ):
211
+ async def yes (interaction : nextcord .Interaction ):
212
212
for server_id in blacklist .keys ():
213
213
if server_id == id :
214
214
del blacklist [server_id ]
@@ -221,7 +221,7 @@ async def yes(interaction: discord.Interaction):
221
221
222
222
yes_button .callback = yes
223
223
224
- async def no (interaction : discord .Interaction ):
224
+ async def no (interaction : nextcord .Interaction ):
225
225
return await interaction .message .channel .send (f':thumbsup: { mention } : Ok!' )
226
226
227
227
no_button .callback = no
0 commit comments