You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 8, 2022. It is now read-only.
This is a [discord.py](https://github.com/Rapptz/discord.py) ui extension made by [404kuso](https://github.com/404kuso) and [RedstoneZockt](https://github.com/RedstoneZockt)
24
-
for using discord's newest ui features like buttons, slash commands and context commands (we got dpy2 supported if you want to keep using our libary)
25
+
for using discord's newest ui features like buttons, slash commands and context commands.
- Component custom ids are now optional, if no custom id is passed, a 100 characters long random string will be used and because of that the order of Component init params changed
214
+
- The order of SelectMenus init params changed, `custom_id` comes now after `options`
215
+
```py
216
+
SelectMenu("my_custom_id", [options...here])
217
+
# is now
218
+
SelectMenu([options...here], "my_custom_id")
219
+
```
220
+
- Same for Buttons
221
+
```py
222
+
Button("my_custom_id", "label")
223
+
# is now
224
+
Button("label", "my_custom_id")
225
+
```
226
+
- ButtonStyles is now ButtonStyle
227
+
- renamed cog decorators, the old ones still work but they will show a deprecation warning: `slash_command`->`slash_command`, `subslash_command`->`subslash_command`, `context_cog`->`context_command`, `listening_component`->`listening_component`
228
+
- Removed `Slash.edit_command`and`Slash.edit_subcommand`, "moved" to `Command.edit`
229
+
-`SlashedCommand`is now `SlashInteraction`, `SlashedSubCommand`is now `SubSlashInteraction`and`SlashedContext`is now `ContextInteraction`
230
+
- The command attributes of CommandInteractions (SlashedCommand, ...) are now moved to `Interaction.command.` (the `.command` attribute is a reference to the real command, if you change properties of the command they will be updated)
231
+
- The component attributes of an interaction are now moved to `.component`
232
+
- ContextCommands `.param` attribute is now `.target`
233
+
234
+
## **Changed**
235
+
-`argument_type`in SlashOption is now `type`
236
+
-`ButtonStyle` value names changed: color names are now capitalized and`Danger`is now `Destructive`
237
+
-`Listener.target_user`is now `Listener.target_users`and can take users, members and ids as the value
238
+
-`BaseCommand.options`and`SlashOption.options`is now of type`SlashOptionCollection`, which allows you to acces options by index and name
239
+
```py
240
+
my_command.options["option name"]
241
+
# or
242
+
my_command.options[0]
243
+
```
244
+
You can also use some methods like `.get`, `.set` (which will return itself after it set something, so `SlashOption.set(key, value).set(key, value)` would work) and``SlashOption.options + SlashOption.option`` will add both SlashOptions together
245
+
- If an invalid guild id was passed to a slashcommand, no exception will be raised anymore, it will just be printed into the console and ignored `logging.error()`
246
+
- Moved the `discord_ui.ext.py` module into a folder
247
+
-`on_button_press`and`on_menu_select`is now `on_button`and`on_select`. The old event names will still work but will be removed in the next release
200
248
201
249
## **Fixed**
202
-
- removed print statements
250
+
- disable_action_row
251
+
-`ActionRow.disable`
252
+
- no interaction events being dispatched because subclasses of dpy2 `commands.Bot` instances wouldn't get overriden which lead to not enabling needed debug events
253
+
- when no matching component listener in`Listener` could be found, the events for components events wouldn't be dispatched
254
+
-`delete_after` keyword in message send override not working
255
+
- mentionable typein slashoptions not being parsed to objects
256
+
-`@discord.ext.commands.Cooldown`not working on cog slashcommands
257
+
258
+
## **Added**
259
+
-`**fields` to all functions that edit the message components (like `.disable_components`, `.disable_component`, ...). The `**fields` parameter can be used to edit other properties of the message without using `.edit` again and send a "useless" request
260
+
-`@Lister.on_error`and`@Listener.wrong_user` decorators for handling Exceptions in Listeners
261
+
- When no keyword was passed to `@Listener.button`or`@Listener.select`, the function will be called on every button/slect
262
+
-`channel_type` to SlashOption, list of `discord.ChannelType`. This will restrict the shown channels for channel slash options to this list.
263
+
- support for nextcord. Other libs **should** work too, but they are not tested.
264
+
-`Mentionable`typefor SlashOptions
265
+
- description for short slashoptions. If you set the options for a slash command via callback params, you can add a description (and a type) to them with your docstring. There are 3 different styles you can use:
> `SelectedMenu.selected_values` are not the raw values that were selected, `SelectMenu.selected_options` are the options of type `SlashOption` that were selected
494
+
-SelectInteraction
495
+
>`SelectInteraction.selected_values` are not the raw values that were selected, `SelectMenu.selected_options` are the options of type`SlashOption` that were selected
357
496
-MISSING =>None
358
497
> All instance values that were `MISSING` by default are now `None`
359
498
@@ -632,7 +771,7 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
632
771
> You can add and remove listening components now with the `Components.add_listening_component`, `Components.remove_listening_component`and`Components.remove_listening_components` functions
633
772
634
773
- Cogs
635
-
> You can now use cog decorators like `slash_cog`, `subslash_cog`and`listening_component_cog`
774
+
> You can now use cog decorators like `slash_command`, `subslash_command`and`listening_component`
636
775
637
776
## **Fixed**
638
777
@@ -863,7 +1002,7 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
863
1002
864
1003
## **Changed**
865
1004
866
-
-SelectedMenu
1005
+
-SelectInteraction
867
1006
>`.values`isnot`.selected_values`
868
1007
869
1008
## **Added**
@@ -1123,12 +1262,3 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
1123
1262
> Buttons have now a custom hashproperty, generated by the discord api
Copy file name to clipboardExpand all lines: discord_ui/__init__.py
+16-17Lines changed: 16 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
discord-ui extension
3
3
~~~~~~~~~~~~~~~~~~~~
4
4
5
-
A discord.py extension for discord's ui features like Buttons, SelectMenus, LinkButtons slash-commands and context-commands (message-commands and user-commands)
5
+
A discord.py extension for discord's ui features like Buttons, SelectMenus, LinkButtons,
6
+
slash-commands and context-commands (message-commands and user-commands).
6
7
7
-
This libary features sending components, creating application-commands and receiving them
0 commit comments