fix id type and add messageflags prefix to IS_COMPONENTS_V2 flag

This commit is contained in:
Fedor Lapshin 2025-03-07 22:19:45 +03:00
parent 4d660d08b9
commit 49980810d5
No known key found for this signature in database
GPG key ID: 492D745FB49D2DAB
2 changed files with 6 additions and 6 deletions

View file

@ -80,7 +80,7 @@ type ActionsRow struct {
// NOTE: maximum of 5.
Components []MessageComponent `json:"components"`
// Unique identifier for the component; auto populated through increment if not provided.
ID string `json:"id,omitempty"`
ID int `json:"id,omitempty"`
}
// MarshalJSON is a method for marshaling ActionsRow to a JSON object.
@ -157,7 +157,7 @@ type Button struct {
// Identifier for a purchasable SKU. Only available when using premium-style buttons.
SKUID string `json:"sku_id,omitempty"`
// Unique identifier for the component; auto populated through increment if not provided.
ID string `json:"id,omitempty"`
ID int `json:"id,omitempty"`
}
// MarshalJSON is a method for marshaling Button to a JSON object.
@ -246,7 +246,7 @@ type SelectMenu struct {
ChannelTypes []ChannelType `json:"channel_types,omitempty"`
// Unique identifier for the component; auto populated through increment if not provided.
ID string `json:"id,omitempty"`
ID int `json:"id,omitempty"`
}
// Type is a method to get the type of a component.
@ -282,7 +282,7 @@ type TextInput struct {
MaxLength int `json:"max_length,omitempty"`
// Unique identifier for the component; auto populated through increment if not provided.
ID string `json:"id,omitempty"`
ID int `json:"id,omitempty"`
}
// Type is a method to get the type of a component.

View file

@ -230,8 +230,8 @@ const (
MessageFlagsSuppressNotifications MessageFlags = 1 << 12
// MessageFlagsIsVoiceMessage this message is a voice message.
MessageFlagsIsVoiceMessage MessageFlags = 1 << 13
// MessageComponentsV2 this message uses the new components system. Disables the ability of sending `content` & `embeds`
MessageComponentsV2 MessageFlags = 1 << 15
// MessageFlagsComponentsV2 this message uses the new components system. Disables the ability of sending `content` & `embeds`
MessageFlagsComponentsV2 MessageFlags = 1 << 15
)
// File stores info about files you e.g. send in messages.