mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
15 lines
508 B
TypeScript
15 lines
508 B
TypeScript
import { Bot } from "../../../bot.ts";
|
|
import { DiscordAutoModerationRule } from "../../../types/discord.ts";
|
|
import { Collection } from "../../../util/collection.ts";
|
|
|
|
/** Get a rule currently configured for guild. */
|
|
export async function getAutomodRule(bot: Bot, guildId: bigint, ruleId: bigint) {
|
|
const rule = await bot.rest.runMethod<DiscordAutoModerationRule>(
|
|
bot.rest,
|
|
"GET",
|
|
bot.constants.routes.AUTOMOD_RULE(guildId, ruleId),
|
|
);
|
|
|
|
return bot.transformers.automodRule(bot, rule);
|
|
}
|