2.0.0.dev118 (2023-04-02)
Breaking Changes
-
Refactors to the component builder interfaces which make them flatter:
- Removed
add_to_containerfromButtonBuilder,LinkButtonBuilder,InteractiveButtonBuilder,SelectMenuBuilder,ChannelSelectMenuBuilder, andTextInputBuilder; these classes are no-longer generic and no-longer takecontainerin their inits. - Replaced
TextSelectMenuBuilder.add_to_containerwith theTextSelectMenuBuilder.parentproperty.
This new property doesn't "finalise" the addition but rather just returns the parent object, or raises if the select menu is an orphan. This change also involves replacing thecontainerparameter inTextSelectMenuBuilder.__init__with an optionalparentparameter. - Removed
SelectOptionBuilder.add_to_menu; this class isn't generic anymore. TextSelectMenuBuilder.add_optionnow takes all the option's configuration as parameters and returnsSelf.- Split
MessageActionRowBuilder.add_buttoninto.add_interactive_buttonand.add_link_button.
These both now take all the button's configuration as parameters and returnSelf. MessageActionRowBuilder.add_select_menunow takes all the menu's configuration as parameters and returnsSelf.
The new.add_channel_menuand.add_text_menumethods should be used for adding text and channel menus. Where.add_channel_menureturnsSelfand.add_text_menureturns a text menu builder with aparentproperty for getting back to the action row builder.ModalActionRowBuilder.add_text_inputnow takes all the text input's configuration as parameters and returnsSelf.min_lengthandmax_lengthcan no-longer behikari.undefined.UNDEFINEDfor the text input builder, and default to0and4000respectively. This change effects both the types accepted byModalActionRowBuilder.__init__and the return types of the relevant properties.- Removed the
emoji_idandemoji_nameparameters fromLinkButtonBuilder.__init__, andInteractiveButtonBuilder.__init__. - Removed the
styleandcustom_idparameters fromLinkButtonBuilder.__init__. - Removed the
urlparameter fromInteractiveButtonBuilder.__init__. (#1533)
- Removed
-
Remove previously deprecated functionality:
Intents.GUILD_BANS(deprecated alias forIntents.GUILD_MODERATION)ComponentType.SELECT_MENU(deprecated alias forIntents.TEXT_SELECT_MENU)- Not passing type through
typeargument explicitly toMessageActionRowBuilder.add_select_menu(#1535)
-
Renamed
StickerPack.banner_hashtoStickerPack.banner_asset_id. (#1572)
Deprecation
- Renamed
TextInputBuilder.requiredproperty toTextInputBuilder.is_required. (#1533) - Passing
CommandChoices instead ofAutocompleteChoiceBuilders when making autocomplete responses. (#1539) hikari.impl.botmoved tohikari.impl.gateway_bot. (#1576)
Features
-
Role.mentionnow returns"@everyone"for the@everyonerole. (#1528) -
Refactors to the component builder interfaces which make them flatter:
hikari.undefined.UNDEFINEDcan now be passed toTextInputBuilder.set_placeholderandTextInputBuilder.set_value.- The standard implementation of a select option builder is now exposed at
hikari.impl.special_endpoints.SelectOptionBuilder. (#1533)
-
CommandChoice.name_localizationsfield and separateAutocompleteChoiceBuilderfor use when making autocomplete responses. (#1539) -
Implement guild role subscriptions. (#1550)
-
Add
Role.is_guild_linked_role. (#1551) -
hikari.iterators.LazyIterator.flattenmethod for flattening a lazy iterator of synchronous iterables. (#1562) -
Support sending stickers when creating a message. (#1571)
-
Added several set methods for required values to the builders:
CommandBuilder.set_nameSlashCommandBuilder.set_descriptionInteractiveButtonBuilder.set_custom_idSelectOptionBuilder.set_labelSelectOptionBuilder.set_valueSelectMenuBuilder.set_custom_id(#1574)
Bugfixes
-
emoji=can now be passed toLinkButtonBuilder.__init__andInteractiveButtonBuilder.__init__alone without causing serialization issues (and Pyright will now let you pass it). (#1533) -
Open
banner.txts withutf-8encoding explicitly. (#1545) -
Pyright will now let you pass
role_mentionsanduser_mentionstoInteractionMessageBuilder.__init__. (#1560) -
Fixed forum channel applied tags not being a sequence of snowflakes. (#1564)
-
Switch to using https://github.com/discord/twemoji for emoji images. (#1568)
-
Fixed sticker pack handling and typing:
- Fixed deserialization raising when
"banner_asset_id"or"cover_sticker_id"weren't included in the payload. StickerPack.banner_asset_idis now correctly typed asOptional[Snowflake].StickerPack.banner_urlandStickerPack.make_banner_urlboth now correctly returnNonewhenStickerPack.banner_asset_idisNone. (#1572)
- Fixed deserialization raising when