Skip to content

Releases: Kenny2github/discord-ext-slash

0.6.1

26 Apr 13:04
Compare
Choose a tag to compare

New Stuff

  • Client.register_commands is now public. Upon awaiting, it calls the API to sync the locally registered commands. If guild_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, call register_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

24 Apr 15:25
Compare
Choose a tag to compare

New Stuff

  • Context.bot is an alias for Context.client
  • file can now be passed in Context.respond in the same way as Messageable.send
  • ephemeral in Context.respond shortcuts flags=MessageFlags.EPHEMERAL
  • deferred in Context.respond shortcuts rtype=InteractionResponseType.DeferredChannelMessageWithSource

Fixes

  • guild_id in Command kwargs was actually guild. 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

05 Apr 06:58
Compare
Choose a tag to compare

Updates

  • Updated to discord.py<1.8

0.5.0

26 Mar 04:17
Compare
Choose a tag to compare

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

21 Feb 17:27
Compare
Choose a tag to compare
0.5.0 Prerelease 1 Pre-release
Pre-release

Changes

  • InteractionResponseType.Acknowledge and .ChannelMessage are pending deprecation
  • InteractionResponseType.AcknowledgeWithSource is renamed to DeferredChannelMessageWithSource
  • flags can now be passed on its own without content or embeds

0.4.0

21 Feb 16:25
Compare
Choose a tag to compare

New Stuff

  • Support new API "resolved" object
    • USER, CHANNEL, and ROLE options are now passed as types Union[discord.<type>, discord.ext.slash.Partial<type>, discord.Object] (exception: USER arguments can also be of type discord.User)
    • Context.author is now Union[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 kwarg resolve_not_fetch=True (the default), no fetching or getting is attempted if the object can be resolved
    • If SlashBot kwarg fetch_if_not_get=True (default False), 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 a discord.Member (it is now Optional[discord.Member]) because slash commands can be run in DMs now which have no member context
  • Context.guild is now Union[discord.Guild, discord.Object, None] instead of a guaranteed Object for the same reason
  • Context.me is now Union[discord.Member, discord.Object] instead of Optional[discord.Member] to be consistent
  • Parameters to command coroutines that are required by the coro now automatically have their Option.required set to True 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 or Option instance) now cause a TypeError on declaration of the command

0.3.0

19 Feb 02:37
Compare
Choose a tag to compare

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 the choices argument to Option() 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, the Group.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 a ValueError if no description is provided or can be inferred.
  • Explicitly passing debug_guild=None no longer errors.

0.3.0 Prerelease 5

11 Feb 16:28
65719ba
Compare
Choose a tag to compare
0.3.0 Prerelease 5 Pre-release
Pre-release

Forthport changes from 0.2.3

0.3.0 Prerelease 4

11 Feb 11:08
Compare
Choose a tag to compare
0.3.0 Prerelease 4 Pre-release
Pre-release

Fixes

  • Context.send now returns the message like it should
  • SlashBot now properly handles explicitly passing None for debug_guild
  • The Command constructor now raises ValueError if no description can be found or inferred

0.2.3

11 Feb 16:21
Compare
Choose a tag to compare

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.