File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,20 @@ class DropdownView(discord.ui.View):
9
9
@discord .ui .channel_select (
10
10
placeholder = "Select channels..." , min_values = 1 , max_values = 3
11
11
) # Users can select a maximum of 3 channels in the dropdown
12
- async def channel_select_dropdown (self , select , interaction ):
12
+ async def channel_select_dropdown (
13
+ self , select : discord .ui .Select , interaction : discord .Interaction
14
+ ) -> None :
13
15
await interaction .response .send_message (
14
16
f"You selected the following channels:"
15
17
+ f", " .join (f"{ channel .mention } " for channel in select .values )
16
18
)
17
19
18
20
19
- bot = discord .Bot (debug_guilds = [...])
21
+ bot : discord . Bot = discord .Bot (debug_guilds = [...])
20
22
21
23
22
24
@bot .slash_command ()
23
- async def channel_select (ctx : discord .ApplicationContext ):
25
+ async def channel_select (ctx : discord .ApplicationContext ) -> None :
24
26
"""Sends a message with our dropdown that contains a channel select."""
25
27
26
28
# Create the view containing our dropdown
@@ -31,7 +33,7 @@ async def channel_select(ctx: discord.ApplicationContext):
31
33
32
34
33
35
@bot .event
34
- async def on_ready ():
36
+ async def on_ready () -> None :
35
37
print (f"Logged in as { bot .user } (ID: { bot .user .id } )" )
36
38
print ("------" )
37
39
Original file line number Diff line number Diff line change @@ -9,18 +9,20 @@ class DropdownView(discord.ui.View):
9
9
@discord .ui .role_select (
10
10
placeholder = "Select roles..." , min_values = 1 , max_values = 3
11
11
) # Users can select a maximum of 3 roles in the dropdown
12
- async def role_select_dropdown (self , select , interaction ):
12
+ async def role_select_dropdown (
13
+ self , select : discord .ui .Select , interaction : discord .Interaction
14
+ ) -> None :
13
15
await interaction .response .send_message (
14
16
f"You selected the following roles:"
15
17
+ f", " .join (f"{ role .mention } " for role in select .values )
16
18
)
17
19
18
20
19
- bot = discord .Bot (debug_guilds = [...])
21
+ bot : discord . Bot = discord .Bot (debug_guilds = [...])
20
22
21
23
22
24
@bot .slash_command ()
23
- async def role_select (ctx : discord .ApplicationContext ):
25
+ async def role_select (ctx : discord .ApplicationContext ) -> None :
24
26
"""Sends a message with our dropdown that contains a role select."""
25
27
26
28
# Create the view containing our dropdown
@@ -31,7 +33,7 @@ async def role_select(ctx: discord.ApplicationContext):
31
33
32
34
33
35
@bot .event
34
- async def on_ready ():
36
+ async def on_ready () -> None :
35
37
print (f"Logged in as { bot .user } (ID: { bot .user .id } )" )
36
38
print ("------" )
37
39
You can’t perform that action at this time.
0 commit comments