This repository was archived by the owner on Feb 3, 2025. It is now read-only.
Releases: Kenny2github/discord-ext-slash
Releases · Kenny2github/discord-ext-slash
0.6.1
New Stuff
Client.register_commandsis now public. Upon awaiting, it calls the API to sync the locally registered commands. Ifguild_idis specified, only commands specific to that guild will be processed. (Useful if you dynamically register guild-specific commands - once your hijinks are done, callregister_commandswith the guild ID.)
Fixes
@Command.checknow properly returns the coroutine, so you can apply the same check coroutine to multiple commands by stacking the decorators.
0.6.0
New Stuff
Context.botis an alias forContext.clientfilecan now be passed inContext.respondin the same way asMessageable.sendephemeralinContext.respondshortcutsflags=MessageFlags.EPHEMERALdeferredinContext.respondshortcutsrtype=InteractionResponseType.DeferredChannelMessageWithSource
Fixes
guild_idinCommandkwargs was actuallyguild. Now both are acceptable- Falling back to finding command by name and guild ID never worked because guild ID was being checked as a string
0.5.1
Updates
- Updated to
discord.py<1.8
0.5.0
Changes
- What was pending deprecation is now formally deprecated.
Fixes
- Defining commands in classes resulted in a check failure because the
selfargument was required and not annotated. This behavior has been fixed.
0.5.0 Prerelease 1
Changes
InteractionResponseType.Acknowledgeand.ChannelMessageare pending deprecationInteractionResponseType.AcknowledgeWithSourceis renamed toDeferredChannelMessageWithSourceflagscan now be passed on its own without content or embeds
0.4.0
New Stuff
- Support new API "resolved" object
USER,CHANNEL, andROLEoptions are now passed as typesUnion[discord.<type>, discord.ext.slash.Partial<type>, discord.Object](exception:USERarguments can also be of typediscord.User)Context.authoris nowUnion[discord.Member, discord.ext.slash.PartialMember, None]- second thanks to new changes, third because slash commands can be run in DMs with no member context- If
SlashBotkwargresolve_not_fetch=True(the default), no fetching or getting is attempted if the object can be resolved - If
SlashBotkwargfetch_if_not_get=True(defaultFalse), no API fetching is attempted if getting from bot cache fails
Command.created_atis now available
Changes
Context.authoris now no longer guaranteed to be adiscord.Member(it is nowOptional[discord.Member]) because slash commands can be run in DMs now which have no member contextContext.guildis nowUnion[discord.Guild, discord.Object, None]instead of a guaranteed Object for the same reasonContext.meis nowUnion[discord.Member, discord.Object]instead ofOptional[discord.Member]to be consistent- Parameters to command coroutines that are required by the coro now automatically have their
Option.requiredset toTrueregardless of the previous value - Parameters to command coros that are required by the coro but cannot have values passed to them by the library/API (i.e. not annotated with a
Contextsubclass orOptioninstance) now cause aTypeErroron declaration of the command
0.3.0
Changelogs are since 0.2.3
New Stuff
@Group.defaulton top of@Group.slash_cmdmarks a subcommand as the one called when the base group is invoked.Choice.from_data, which is called on each item of thechoicesargument toOption()as well. See the docs.
Changes
defaultbehavior is fully clarified now, but not currently enabled. I was hoping that the behavior would be pushed before I made a stable release, but further API changes have made that impossible.- This means that
Option.defaultis fully removed now. - Since calling a base group translates into calling the
defaultsubcommand, theGroup.corois now deprived of an original jurisdiction. Final behavior is that all parent coros will be called in order of increasing child levels before the command is invoked. - Likewise, the
in_additionargument no longer has any meaning and has been removed.
Fixes
- Actual Python annotations for classes, instead of just doc descriptions.
in_additionis removed, so remove it from the demo.slash.__all__is now defined.- Support forward reference annotations.
Context.sendnow returns the message object like it should.Command()now raises aValueErrorif no description is provided or can be inferred.- Explicitly passing
debug_guild=Noneno longer errors.
0.3.0 Prerelease 5
Forthport changes from 0.2.3
0.3.0 Prerelease 4
Fixes
Context.sendnow returns the message like it shouldSlashBotnow properly handles explicitly passingNonefordebug_guild- The
Commandconstructor now raisesValueErrorif no description can be found or inferred
0.2.3
New Stuff
- For some extra security, fall back to looking up command by name and guild ID if command ID fails to return results. Fall back from that to just name. Warn with
SlashWarningboth times. Error on still no command.
Fixes
- The API introduced a new "version" dict key, which broke dict equality. I gave up on that and just ensured all values in code match the API.
- The API no longer allows passing
namein PATCH. Pop it.