-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement new selects #1702
Implement new selects #1702
Conversation
for more information, see https://pre-commit.ci
Tested with the following code, works very well: import discord
class View(discord.ui.View):
def __init__(self):
super().__init__(timeout=180)
@discord.ui.select(
custom_id="string-select",
options=[
discord.SelectOption(label='a', value='a'),
discord.SelectOption(label='b', value='b')
]
)
async def string_select(self, select, interaction):
await interaction.response.send_message(str(select.values))
@discord.ui.user_select(
custom_id="user-select",
placeholder="beans",
max_values=5,
)
async def user_select(self, select, interaction):
await interaction.response.send_message(str(select.values))
@discord.ui.role_select(
custom_id="role-select",
placeholder="beans",
max_values=5,
)
async def role_select(self, select, interaction):
await interaction.response.send_message(str(select.values))
@discord.ui.mentionable_select(
custom_id="mention-select",
placeholder="beans",
max_values=5,
)
async def mention_select(self, select, interaction):
await interaction.response.send_message(str(select.values))
@discord.ui.channel_select(
custom_id="channel-select",
placeholder="beans",
max_values=5,
channel_types=[discord.ChannelType.category]
)
async def channel_select(self, select, interaction):
await interaction.response.send_message(str(select.values))
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print('ready')
@client.event
async def on_message(message):
if message.content == '!test':
await message.reply("beans", view=View())
client.run("token") |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1702 +/- ##
==========================================
- Coverage 33.19% 33.14% -0.06%
==========================================
Files 96 96
Lines 18414 18513 +99
==========================================
+ Hits 6113 6136 +23
- Misses 12301 12377 +76
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Co-authored-by: Dorukyum <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM change of plans, see below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: NeloBlivion <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Summary
https://discord.com/developers/docs/change-log#new-select-menu-components
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.