mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-04 08:56:19 +00:00
Reformat entire project with ruff instead of black
This commit is contained in:
@ -92,6 +92,7 @@ async def joined(interaction: discord.Interaction, member: Optional[discord.Memb
|
||||
# accessing a menu within the client, usually via right clicking.
|
||||
# It always takes an interaction as its first parameter and a Member or Message as its second parameter.
|
||||
|
||||
|
||||
# This context menu command only works on members
|
||||
@client.tree.context_menu(name='Show Join Date')
|
||||
async def show_join_date(interaction: discord.Interaction, member: discord.Member):
|
||||
|
@ -60,6 +60,7 @@ async def add(
|
||||
# Examples of these include int, str, float, bool, User, Member, Role, and any channel type.
|
||||
# Since there are a lot of these, for brevity only a channel example will be included.
|
||||
|
||||
|
||||
# This command shows how to only show text and voice channels to a user using the Union type hint
|
||||
# combined with the VoiceChannel and TextChannel types.
|
||||
@client.tree.command(name='channel-info')
|
||||
@ -83,6 +84,7 @@ async def channel_info(interaction: discord.Interaction, channel: Union[discord.
|
||||
# In order to support choices, the library has a few ways of doing this.
|
||||
# The first one is using a typing.Literal for basic choices.
|
||||
|
||||
|
||||
# On Discord, this will show up as two choices, Buy and Sell.
|
||||
# In the code, you will receive either 'Buy' or 'Sell' as a string.
|
||||
@client.tree.command()
|
||||
|
Reference in New Issue
Block a user