Closed AstreaTSS closed 6 months ago
This PR fixes SelectDefaultValues.from_object by making sure a client object is passed into the proper init.
SelectDefaultValues.from_object
See diff - it's not a big change.
Resolves #1653
import interactions bot = interactions.Client(intents=Intents.DEFAULT) @interactions.slash_command( name="test", description="test" ) async def test_cmd(ctx: interactions.SlashContext): component = interactions.UserSelectMenu(max_values=3, default_values=[interactions.models.discord.components.SelectDefaultValues.from_object(ctx.author)]) # Or the following code is the same as above # component = interactions.UserSelectMenu(max_values=3, default_values=[ctx.author]) await ctx.send("Test", components=[component]) bot.start("TOKEN")
3.10.x
3.11.x
pre-commit
Pull Request Type
Description
This PR fixes
SelectDefaultValues.from_object
by making sure a client object is passed into the proper init.Changes
See diff - it's not a big change.
Related Issues
Resolves #1653
Test Scenarios
Python Compatibility
3.10.x
3.11.x
- or, well, someone else tested the fix. My PC isn't allowing for bots to run for some reason 😅.Checklist
pre-commit
code linter over all edited files