mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
helpers: add appliedTags to editHelper options (#2590)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user