Discord-ext-slash

Latest version: v0.9.2

Safety actively analyzes 623490 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

1.0.0b3

Changes
* `BaseContext.respond` now has slightly different semantics:
* Passing a value of `None` as an argument leads to that parameter not being sent to the API. This has always been the case for all parameters except `content`, which used to cast the `None` to a string.
* Passing a falsy value that is not `None` (e.g. `embeds=[]`) now sends the empty value to the API. You are responsible for making sure that at least one value is not *empty* (client-side validation only ensures one is *passed*).

Fixes
* Calls of the form `BaseContext.respond(embed=...)` (i.e. only `embed` is passed) work again now.
* Multiple responses to the same interaction now actually edits the response again.

1.0.0b2

Fixes
* Commands in DMs were still potentially failing. This should fix it.

1.0.0b1

New Stuff
* [Message components](https://discord.com/developers/docs/interactions/message-components)! See the demo bot for an example, because it's 8:25 AM, I haven't slept, and I'm not listing all of the classes that got added.

Breaking Changes
* `InteractionCallbackType` enum names are now `CONSTANT_CASE` only; the `CamelCase` aliases have been removed.

Potentially Breaking Changes
* `InteractionResponseType` is renamed to `InteractionCallbackType` following API docs renaming. The old name remains as an alias, but it will not be imported in a `from discord.ext.slash import *` context so code that uses both that import and the old name will fail with a `NameError`.
* `Context.author` can now be a `discord.User` instead of a `discord.Member` if the command is run in DMs.

0.9.2

Fixes
* Fixed `slash.Context` callback annotations not being properly evaluated from string annotations under `from __future__ import annotations`.
* Fixed guild-specific commands trying to register their default permissions in all guilds. They only register them in their own guild now.

0.9.1

New Stuff
* `on_(before|after)_slash_command_invoke` events. See [the docs](https://discord-ext-slash.readthedocs.io/en/latest/discord-ext-slash.html#events)

0.9.0

New Stuff
* Support [`channel_types`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.Option.channel_types) (note that the constructor arguments differ from the attribute), to specify type of channel for a [`CHANNEL`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.ApplicationCommandOptionType.CHANNEL)-type option.
* Support [`min_value`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.Option.min_value) and [`max_value`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.Option.max_value), to constrain numeric option values.
* Use [`ChoiceEnum`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.ChoiceEnum) as a shortcut for [`Option`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.Option)s with [`Choice`](https://discord-ext-slash.readthedocs.io/en/0.9.0/discord-ext-slash.html#discord.ext.slash.Choice)s. Best demonstrated [by example](https://github.com/Kenny2github/discord-ext-slash/blob/0.9.0/demo_bot.py#L118-L146).

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.