helpers: add appliedTags to editHelper options (#2590)

This commit is contained in:
LTS20050703
2022-11-15 14:37:03 -06:00
committed by GitHub
parent 5a1887462d
commit f615e8520c
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -97,6 +97,7 @@ export async function editChannel(bot: Bot, channelId: BigString, options: Modif
emoji_name: availableTag.emojiName,
}))
: undefined,
applied_tags: options.appliedTags?.map((appliedTag) => appliedTag.toString()),
default_reaction_emoji: options.defaultReactionEmoji
? {
emoji_id: options.defaultReactionEmoji.emojiId,
@@ -215,6 +216,8 @@ export interface ModifyChannel extends WithReason {
/** The unicode character of the emoji */
emojiName: string;
}[];
/** The IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel; limited to 5 */
appliedTags?: BigString[];
/** the emoji to show in the add reaction button on a thread in a GUILD_FORUM channel */
defaultReactionEmoji?: {
/** The id of a guild's custom emoji */
@@ -40,6 +40,8 @@ export function editChannel(bot: BotWithCache) {
} else {
perms.push("MANAGE_THREADS");
}
if (options.appliedTags && options.appliedTags.length > 5) throw new Error("thread applied tags is limit to 5");
} else {
perms.push("MANAGE_CHANNELS");
@@ -69,6 +71,10 @@ export function editChannel(bot: BotWithCache) {
throw new Error("The parent id must be for a category channel type.");
}
}
if (options.availableTags && options.availableTags.length > 20) {
throw new Error("channel available tags is limited to 20");
}
}
requireBotChannelPermissions(bot, channel, perms);