diff --git a/src/helpers/messages/add_reaction.ts b/src/helpers/messages/add_reaction.ts index 7ed7d6536..8dd203c74 100644 --- a/src/helpers/messages/add_reaction.ts +++ b/src/helpers/messages/add_reaction.ts @@ -2,7 +2,7 @@ import { Bot } from "../../bot.ts"; /** Create a reaction for the message. Reaction takes the form of **name:id** for custom guild emoji, or Unicode characters. Requires READ_MESSAGE_HISTORY and ADD_REACTIONS */ export async function addReaction(bot: Bot, channelId: bigint, messageId: bigint, reaction: string) { - await bot.utils.requireBotChannelPermissions(channelId, ["ADD_REACTIONS", "READ_MESSAGE_HISTORY"]); + await bot.utils.requireBotChannelPermissions(bot, channelId, ["ADD_REACTIONS", "READ_MESSAGE_HISTORY"]); if (reaction.startsWith("<:")) { reaction = reaction.substring(2, reaction.length - 1); diff --git a/src/helpers/messages/delete_message.ts b/src/helpers/messages/delete_message.ts index 2d704dbd5..c8c92f7d0 100644 --- a/src/helpers/messages/delete_message.ts +++ b/src/helpers/messages/delete_message.ts @@ -7,7 +7,7 @@ export async function deleteMessage(bot: Bot, channelId: bigint, messageId: bigi const message = await cacheHandlers.get("messages", messageId); if (message && message.authorId !== bot.id) { - await bot.utils.requireBotChannelPermissions(message.channelId, ["MANAGE_MESSAGES"]); + await bot.utils.requireBotChannelPermissions(bot, message.channelId, ["MANAGE_MESSAGES"]); } if (delayMilliseconds) await delay(delayMilliseconds); diff --git a/src/helpers/messages/delete_messages.ts b/src/helpers/messages/delete_messages.ts index 049b7f2d9..dfed14f47 100644 --- a/src/helpers/messages/delete_messages.ts +++ b/src/helpers/messages/delete_messages.ts @@ -2,7 +2,7 @@ import { Bot } from "../../bot.ts"; /** Delete messages from the channel. 2-100. Requires the MANAGE_MESSAGES permission */ export async function deleteMessages(bot: Bot, channelId: bigint, ids: bigint[], reason?: string) { - await bot.utils.requireBotChannelPermissions(channelId, ["MANAGE_MESSAGES"]); + await bot.utils.requireBotChannelPermissions(bot, channelId, ["MANAGE_MESSAGES"]); if (ids.length < 2) { throw new Error(bot.constants.Errors.DELETE_MESSAGES_MIN); diff --git a/src/helpers/messages/edit_message.ts b/src/helpers/messages/edit_message.ts index 18818e72d..88b8e4b34 100644 --- a/src/helpers/messages/edit_message.ts +++ b/src/helpers/messages/edit_message.ts @@ -16,7 +16,7 @@ export async function editMessage(bot: Bot, channelId: bigint, messageId: bigint } const requiredPerms: PermissionStrings[] = ["SEND_MESSAGES"]; - await bot.utils.requireBotChannelPermissions(message.channelId, requiredPerms); + await bot.utils.requireBotChannelPermissions(bot, message.channelId, requiredPerms); } if (typeof content === "string") content = { content }; diff --git a/src/helpers/messages/get_message.ts b/src/helpers/messages/get_message.ts index beefd4e0f..aebc74bd4 100644 --- a/src/helpers/messages/get_message.ts +++ b/src/helpers/messages/get_message.ts @@ -6,7 +6,7 @@ import {SnakeCasedPropertiesDeep} from "../../types/util.ts"; /** Fetch a single message from the server. Requires VIEW_CHANNEL and READ_MESSAGE_HISTORY */ export async function getMessage(bot: Bot, channelId: bigint, id: bigint) { if (await cacheHandlers.has("channels", channelId)) { - await bot.utils.requireBotChannelPermissions(channelId, ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY"]); + await bot.utils.requireBotChannelPermissions(bot, channelId, ["VIEW_CHANNEL", "READ_MESSAGE_HISTORY"]); } const result = await bot.rest.runMethod>(bot.rest,"get", bot.constants.endpoints.CHANNEL_MESSAGE(channelId, id));