mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
* Plugins/Permissions: FIX PARITY ISSUES What is parity issues? Parity issues are files that exist but structured one way in the base/vanilla discordeno library, and structured another way in the permisison plugin. * deno fmt * plugins/permissions: nuke validations * plugins/permissions VALIDATIONS -> plugins/validations * plugins/validations: slash commands max 4000 chars * fix module not found
19 lines
586 B
TypeScript
19 lines
586 B
TypeScript
import { BotWithCache } from "../../deps.ts";
|
|
import { requireBotChannelPermissions } from "../permissions.ts";
|
|
|
|
export function editMessage(bot: BotWithCache) {
|
|
const editMessage = bot.helpers.editMessage;
|
|
|
|
bot.helpers.editMessage = function (channelId, messageId, content) {
|
|
const message = bot.messages.get(messageId);
|
|
if (message) {
|
|
if (message.authorId !== bot.id) {
|
|
content = { flags: content.flags };
|
|
requireBotChannelPermissions(bot, channelId, ["MANAGE_MESSAGES"]);
|
|
}
|
|
}
|
|
|
|
return editMessage(channelId, messageId, content);
|
|
};
|
|
}
|