2.0.0.dev118
2.0.0.dev118 (2023-04-02)
Breaking Changes
-
Refactors to the component builder interfaces which make them flatter:
- Removed
add_to_container
fromButtonBuilder
,LinkButtonBuilder
,InteractiveButtonBuilder
,SelectMenuBuilder
,ChannelSelectMenuBuilder
, andTextInputBuilder
; these classes are no-longer generic and no-longer takecontainer
in their inits. - Replaced
TextSelectMenuBuilder.add_to_container
with theTextSelectMenuBuilder.parent
property.
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 thecontainer
parameter inTextSelectMenuBuilder.__init__
with an optionalparent
parameter. - Removed
SelectOptionBuilder.add_to_menu
; this class isn't generic anymore. TextSelectMenuBuilder.add_option
now takes all the option's configuration as parameters and returnsSelf
.- Split
MessageActionRowBuilder.add_button
into.add_interactive_button
and.add_link_button
.
These both now take all the button's configuration as parameters and returnSelf
. MessageActionRowBuilder.add_select_menu
now takes all the menu's configuration as parameters and returnsSelf
.
The new.add_channel_menu
and.add_text_menu
methods should be used for adding text and channel menus. Where.add_channel_menu
returnsSelf
and.add_text_menu
returns a text menu builder with aparent
property for getting back to the action row builder.ModalActionRowBuilder.add_text_input
now takes all the text input's configuration as parameters and returnsSelf
.min_length
andmax_length
can no-longer behikari.undefined.UNDEFINED
for the text input builder, and default to0
and4000
respectively. This change effects both the types accepted byModalActionRowBuilder.__init__
and the return types of the relevant properties.- Removed the
emoji_id
andemoji_name
parameters fromLinkButtonBuilder.__init__
, andInteractiveButtonBuilder.__init__
. - Removed the
style
andcustom_id
parameters fromLinkButtonBuilder.__init__
. - Removed the
url
parameter 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
type
argument explicitly toMessageActionRowBuilder.add_select_menu
(#1535)
-
Renamed
StickerPack.banner_hash
toStickerPack.banner_asset_id
. (#1572)
Deprecation
- Renamed
TextInputBuilder.required
property toTextInputBuilder.is_required
. (#1533) - Passing
CommandChoice
s instead ofAutocompleteChoiceBuilder
s when making autocomplete responses. (#1539) hikari.impl.bot
moved tohikari.impl.gateway_bot
. (#1576)
Features
-
Role.mention
now returns"@everyone"
for the@everyone
role. (#1528) -
Refactors to the component builder interfaces which make them flatter:
hikari.undefined.UNDEFINED
can now be passed toTextInputBuilder.set_placeholder
andTextInputBuilder.set_value
.- The standard implementation of a select option builder is now exposed at
hikari.impl.special_endpoints.SelectOptionBuilder
. (#1533)
-
CommandChoice.name_localizations
field and separateAutocompleteChoiceBuilder
for use when making autocomplete responses. (#1539) -
Implement guild role subscriptions. (#1550)
-
Add
Role.is_guild_linked_role
. (#1551) -
hikari.iterators.LazyIterator.flatten
method 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_name
SlashCommandBuilder.set_description
InteractiveButtonBuilder.set_custom_id
SelectOptionBuilder.set_label
SelectOptionBuilder.set_value
SelectMenuBuilder.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.txt
s withutf-8
encoding explicitly. (#1545) -
Pyright will now let you pass
role_mentions
anduser_mentions
toInteractionMessageBuilder.__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_id
is now correctly typed asOptional[Snowflake]
.StickerPack.banner_url
andStickerPack.make_banner_url
both now correctly returnNone
whenStickerPack.banner_asset_id
isNone
. (#1572)
- Fixed deserialization raising when