mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
Add get sticker pack endpoint (#3844)
This commit is contained in:
@@ -406,6 +406,9 @@ export function createBotHelpers(bot: Bot): BotHelpers {
|
||||
getMessages: async (channelId, options) => {
|
||||
return (await bot.rest.getMessages(channelId, options)).map((res) => bot.transformers.message(bot, snakelize(res)))
|
||||
},
|
||||
getStickerPack: async (stickerPackId) => {
|
||||
return bot.transformers.stickerPack(bot, snakelize(await bot.rest.getStickerPack(stickerPackId)))
|
||||
},
|
||||
getStickerPacks: async () => {
|
||||
return (await bot.rest.getStickerPacks()).map((res) => bot.transformers.stickerPack(bot, snakelize(res)))
|
||||
},
|
||||
@@ -864,6 +867,7 @@ export interface BotHelpers {
|
||||
getInvites: (guildId: BigString) => Promise<Invite[]>
|
||||
getMessage: (channelId: BigString, messageId: BigString) => Promise<Message>
|
||||
getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<Message[]>
|
||||
getStickerPack: (stickerPackId: BigString) => Promise<StickerPack>
|
||||
getStickerPacks: () => Promise<StickerPack[]>
|
||||
getOriginalInteractionResponse: (token: string) => Promise<Message>
|
||||
getPinnedMessages: (channelId: BigString) => Promise<Message[]>
|
||||
|
||||
@@ -1257,6 +1257,10 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
|
||||
return await rest.get<DiscordMessage[]>(rest.routes.channels.messages(channelId, options))
|
||||
},
|
||||
|
||||
async getStickerPack(stickerPackId) {
|
||||
return await rest.get<DiscordStickerPack>(rest.routes.stickerPack(stickerPackId))
|
||||
},
|
||||
|
||||
async getStickerPacks() {
|
||||
return await rest.get<DiscordStickerPack[]>(rest.routes.stickerPacks())
|
||||
},
|
||||
|
||||
@@ -620,6 +620,10 @@ export function createRoutes(): RestRoutes {
|
||||
return '/gateway/bot'
|
||||
},
|
||||
|
||||
stickerPack(stickerPackId) {
|
||||
return `/sticker-packs/${stickerPackId}`
|
||||
},
|
||||
|
||||
stickerPacks() {
|
||||
return '/sticker-packs'
|
||||
},
|
||||
|
||||
@@ -2045,6 +2045,14 @@ export interface RestManager {
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
|
||||
*/
|
||||
getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<CamelizedDiscordMessage[]>
|
||||
/**
|
||||
* Returns a sticker pack for the given ID.
|
||||
*
|
||||
* @returns A {@link CamelizedDiscordStickerPack} object.
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker-pack}
|
||||
*/
|
||||
getStickerPack: (stickerPackId: BigString) => Promise<CamelizedDiscordStickerPack>
|
||||
/**
|
||||
* Returns the list of sticker packs available.
|
||||
*
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface RestRoutes {
|
||||
gatewayBot: () => string
|
||||
// Standard Sticker Packs
|
||||
stickerPacks: () => string
|
||||
stickerPack: (stickerPackId: BigString) => string
|
||||
/** Routes for webhook related routes. */
|
||||
webhooks: {
|
||||
/** Route for managing the original message sent by a webhook. */
|
||||
|
||||
Reference in New Issue
Block a user