Add get guild stickers support (#1095)
* Add get guild stickers support * fix: change the type of Stickers of StickerPack to array pointer
This commit is contained in:
parent
992358e106
commit
b7ce746717
2 changed files with 48 additions and 45 deletions
45
message.go
45
message.go
|
@ -217,51 +217,6 @@ type File struct {
|
||||||
Reader io.Reader
|
Reader io.Reader
|
||||||
}
|
}
|
||||||
|
|
||||||
// StickerFormat is the file format of the Sticker.
|
|
||||||
type StickerFormat int
|
|
||||||
|
|
||||||
// Defines all known Sticker types.
|
|
||||||
const (
|
|
||||||
StickerFormatTypePNG StickerFormat = 1
|
|
||||||
StickerFormatTypeAPNG StickerFormat = 2
|
|
||||||
StickerFormatTypeLottie StickerFormat = 3
|
|
||||||
)
|
|
||||||
|
|
||||||
// StickerType is the type of sticker.
|
|
||||||
type StickerType int
|
|
||||||
|
|
||||||
// Defines Sticker types.
|
|
||||||
const (
|
|
||||||
StickerTypeStandard StickerType = 1
|
|
||||||
StickerTypeGuild StickerType = 2
|
|
||||||
)
|
|
||||||
|
|
||||||
// Sticker represents a sticker object that can be sent in a Message.
|
|
||||||
type Sticker struct {
|
|
||||||
ID string `json:"id"`
|
|
||||||
PackID string `json:"pack_id"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Description string `json:"description"`
|
|
||||||
Tags string `json:"tags"`
|
|
||||||
Type StickerType `json:"type"`
|
|
||||||
FormatType StickerFormat `json:"format_type"`
|
|
||||||
Available bool `json:"available"`
|
|
||||||
GuildID string `json:"guild_id"`
|
|
||||||
User *User `json:"user"`
|
|
||||||
SortValue int `json:"sort_value"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StickerPack represents a pack of standard stickers.
|
|
||||||
type StickerPack struct {
|
|
||||||
ID string `json:"id"`
|
|
||||||
Stickers []Sticker `json:"stickers"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
SKUID string `json:"sku_id"`
|
|
||||||
CoverStickerID string `json:"cover_sticker_id"`
|
|
||||||
Description string `json:"description"`
|
|
||||||
BannerAssetID string `json:"banner_asset_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// MessageSend stores all parameters you can send with ChannelMessageSendComplex.
|
// MessageSend stores all parameters you can send with ChannelMessageSendComplex.
|
||||||
type MessageSend struct {
|
type MessageSend struct {
|
||||||
Content string `json:"content,omitempty"`
|
Content string `json:"content,omitempty"`
|
||||||
|
|
48
structs.go
48
structs.go
|
@ -461,6 +461,51 @@ func (e *Emoji) APIName() string {
|
||||||
return e.ID
|
return e.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StickerFormat is the file format of the Sticker.
|
||||||
|
type StickerFormat int
|
||||||
|
|
||||||
|
// Defines all known Sticker types.
|
||||||
|
const (
|
||||||
|
StickerFormatTypePNG StickerFormat = 1
|
||||||
|
StickerFormatTypeAPNG StickerFormat = 2
|
||||||
|
StickerFormatTypeLottie StickerFormat = 3
|
||||||
|
)
|
||||||
|
|
||||||
|
// StickerType is the type of sticker.
|
||||||
|
type StickerType int
|
||||||
|
|
||||||
|
// Defines Sticker types.
|
||||||
|
const (
|
||||||
|
StickerTypeStandard StickerType = 1
|
||||||
|
StickerTypeGuild StickerType = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
// Sticker represents a sticker object that can be sent in a Message.
|
||||||
|
type Sticker struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
PackID string `json:"pack_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Tags string `json:"tags"`
|
||||||
|
Type StickerType `json:"type"`
|
||||||
|
FormatType StickerFormat `json:"format_type"`
|
||||||
|
Available bool `json:"available"`
|
||||||
|
GuildID string `json:"guild_id"`
|
||||||
|
User *User `json:"user"`
|
||||||
|
SortValue int `json:"sort_value"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// StickerPack represents a pack of standard stickers.
|
||||||
|
type StickerPack struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Stickers []*Sticker `json:"stickers"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
SKUID string `json:"sku_id"`
|
||||||
|
CoverStickerID string `json:"cover_sticker_id"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
BannerAssetID string `json:"banner_asset_id"`
|
||||||
|
}
|
||||||
|
|
||||||
// VerificationLevel type definition
|
// VerificationLevel type definition
|
||||||
type VerificationLevel int
|
type VerificationLevel int
|
||||||
|
|
||||||
|
@ -564,6 +609,9 @@ type Guild struct {
|
||||||
// A list of the custom emojis present in the guild.
|
// A list of the custom emojis present in the guild.
|
||||||
Emojis []*Emoji `json:"emojis"`
|
Emojis []*Emoji `json:"emojis"`
|
||||||
|
|
||||||
|
// A list of the custom stickers present in the guild.
|
||||||
|
Stickers []*Sticker `json:"stickers"`
|
||||||
|
|
||||||
// A list of the members in the guild.
|
// A list of the members in the guild.
|
||||||
// This field is only present in GUILD_CREATE events and websocket
|
// This field is only present in GUILD_CREATE events and websocket
|
||||||
// update events, and thus is only present in state-cached guilds.
|
// update events, and thus is only present in state-cached guilds.
|
||||||
|
|
Loading…
Reference in a new issue