Skip to content

Commit

Permalink
Add get sticker pack endpoint (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Aug 9, 2024
1 parent 8e9d18d commit dc43cbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions rest/rest_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ var (
// Stickers
var (
GetNitroStickerPacks = NewEndpoint(http.MethodGet, "/sticker-packs")
GetNitroStickerPack = NewEndpoint(http.MethodGet, "/sticker-packs/{pack.id}")
GetSticker = NewEndpoint(http.MethodGet, "/stickers/{sticker.id}")
GetGuildStickers = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/stickers")
CreateGuildSticker = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/stickers")
Expand Down
6 changes: 6 additions & 0 deletions rest/stickers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func NewStickers(client Client) Stickers {

type Stickers interface {
GetNitroStickerPacks(opts ...RequestOpt) ([]discord.StickerPack, error)
GetNitroStickerPack(packID snowflake.ID, opts ...RequestOpt) (*discord.StickerPack, error)
GetSticker(stickerID snowflake.ID, opts ...RequestOpt) (*discord.Sticker, error)
GetStickers(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Sticker, error)
CreateSticker(guildID snowflake.ID, createSticker discord.StickerCreate, opts ...RequestOpt) (*discord.Sticker, error)
Expand All @@ -34,6 +35,11 @@ func (s *stickerImpl) GetNitroStickerPacks(opts ...RequestOpt) (stickerPacks []d
return
}

func (s *stickerImpl) GetNitroStickerPack(packID snowflake.ID, opts ...RequestOpt) (pack *discord.StickerPack, err error) {
err = s.client.Do(GetNitroStickerPack.Compile(nil, packID), nil, &pack, opts...)
return
}

func (s *stickerImpl) GetSticker(stickerID snowflake.ID, opts ...RequestOpt) (sticker *discord.Sticker, err error) {
err = s.client.Do(GetSticker.Compile(nil, stickerID), nil, &sticker, opts...)
return
Expand Down

0 comments on commit dc43cbe

Please sign in to comment.