1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10:58 -05:00

I hate the board that clips papers

This commit is contained in:
toast-ts 2024-02-20 18:58:59 +11:00
parent 3c8443723f
commit 4def4e877a

View File

@ -149,7 +149,9 @@ export default class MP {
if (client.config.dcServer.id === interaction.guildId) {
if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmod');
}
const msg = await (interaction.guild.channels.cache.get(channels.announcements) as Discord.TextChannel).messages.fetch(interaction.options.getString('message_id', true));
const msg_id = interaction.options.getString('message_id', true);
const stripUrl = msg_id.replace(/https:\/\/discord.com\/channels\/\d+\/\d+\/(\d+)/, '$1');
const msg = await (interaction.guild.channels.cache.get(channels.announcements) as Discord.TextChannel).messages.fetch(stripUrl).catch(()=>null);
if (!msg) return interaction.reply('Message not found, please make sure you have the correct message ID.');
if (msg.embeds[0].title !== 'Vote for next map!') return interaction.reply('This message is not a poll!');