Releases: Kenny2github/discord-ext-slash
Releases · Kenny2github/discord-ext-slash
0.6.1
New Stuff
Client.register_commands
is now public. Upon awaiting, it calls the API to sync the locally registered commands. Ifguild_id
is specified, only commands specific to that guild will be processed. (Useful if you dynamically register guild-specific commands - once your hijinks are done, callregister_commands
with the guild ID.)
Fixes
@Command.check
now 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.bot
is an alias forContext.client
file
can now be passed inContext.respond
in the same way asMessageable.send
ephemeral
inContext.respond
shortcutsflags=MessageFlags.EPHEMERAL
deferred
inContext.respond
shortcutsrtype=InteractionResponseType.DeferredChannelMessageWithSource
Fixes
guild_id
inCommand
kwargs 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
self
argument was required and not annotated. This behavior has been fixed.
0.5.0 Prerelease 1
Changes
InteractionResponseType.Acknowledge
and.ChannelMessage
are pending deprecationInteractionResponseType.AcknowledgeWithSource
is renamed toDeferredChannelMessageWithSource
flags
can now be passed on its own without content or embeds
0.4.0
New Stuff
- Support new API "resolved" object
USER
,CHANNEL
, andROLE
options are now passed as typesUnion[discord.<type>, discord.ext.slash.Partial<type>, discord.Object]
(exception:USER
arguments can also be of typediscord.User
)Context.author
is 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
SlashBot
kwargresolve_not_fetch=True
(the default), no fetching or getting is attempted if the object can be resolved - If
SlashBot
kwargfetch_if_not_get=True
(defaultFalse
), no API fetching is attempted if getting from bot cache fails
Command.created_at
is now available
Changes
Context.author
is 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.guild
is nowUnion[discord.Guild, discord.Object, None]
instead of a guaranteed Object for the same reasonContext.me
is 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.required
set toTrue
regardless 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
Context
subclass orOption
instance) now cause aTypeError
on declaration of the command
0.3.0
Changelogs are since 0.2.3
New Stuff
@Group.default
on top of@Group.slash_cmd
marks a subcommand as the one called when the base group is invoked.Choice.from_data
, which is called on each item of thechoices
argument toOption()
as well. See the docs.
Changes
default
behavior 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.default
is fully removed now. - Since calling a base group translates into calling the
default
subcommand, theGroup.coro
is 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_addition
argument no longer has any meaning and has been removed.
Fixes
- Actual Python annotations for classes, instead of just doc descriptions.
in_addition
is removed, so remove it from the demo.slash.__all__
is now defined.- Support forward reference annotations.
Context.send
now returns the message object like it should.Command()
now raises aValueError
if no description is provided or can be inferred.- Explicitly passing
debug_guild=None
no longer errors.
0.3.0 Prerelease 5
Forthport changes from 0.2.3
0.3.0 Prerelease 4
Fixes
Context.send
now returns the message like it shouldSlashBot
now properly handles explicitly passingNone
fordebug_guild
- The
Command
constructor now raisesValueError
if 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
SlashWarning
both 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
name
in PATCH. Pop it.