mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-16 20:00:59 -05:00
I hate the board that clips papers
This commit is contained in:
parent
3c8443723f
commit
4def4e877a
@ -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!');
|
||||
|
Loading…
Reference in New Issue
Block a user