mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
* perf(plugins/helpers,rest,site,template)!: uppercase rest methods There is no need for us to pass the methods in lower case and then use the `toUpperCase()` method everywhere. Therefore this PR changes every lowercase method to be uppercase (eg. `"get"` => `"GET"`). * template is old version
24 lines
661 B
TypeScript
24 lines
661 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
import { DiscordMessage } from "../../types/discord.ts";
|
|
|
|
export interface GetWebhookMessageOptions {
|
|
threadId: bigint;
|
|
}
|
|
|
|
/** Returns a previously-sent webhook message from the same token. Returns a message object on success. */
|
|
export async function getWebhookMessage(
|
|
bot: Bot,
|
|
webhookId: bigint,
|
|
webhookToken: string,
|
|
messageId: bigint,
|
|
options?: GetWebhookMessageOptions,
|
|
) {
|
|
const result = await bot.rest.runMethod<DiscordMessage>(
|
|
bot.rest,
|
|
"GET",
|
|
bot.constants.routes.WEBHOOK_MESSAGE(webhookId, webhookToken, messageId, options),
|
|
);
|
|
|
|
return bot.transformers.message(bot, result);
|
|
}
|