diff --git a/bot/discord/commands/staff/pollping.js b/bot/discord/commands/staff/pollping.js new file mode 100644 index 00000000..cda5845e --- /dev/null +++ b/bot/discord/commands/staff/pollping.js @@ -0,0 +1,16 @@ +exports.run = (client, message, args) => { + // Check if user has the dev role + if (!message.member.roles.cache.find((r) => r.id === "898041747597295667")) return; + // Check the message is in the #dev-questions channel + if(message.channel.id !== "1083142107977486389") return message.reply("This command can only be used in <#1083142107977486389>!"); + // Command can only be used every 30 minutes + if(pollPingLastUsed + 1800000 > Date.now()) { + message.reply( + `This command can only be used every 30 minutes! Cooldown expires ` + ) + return; + } + + message.reply("<@&898041781927682090>"); + global.pollPingLastUsed = Date.now(); +}; diff --git a/index.js b/index.js index f5a1d3ee..2e164006 100644 --- a/index.js +++ b/index.js @@ -57,6 +57,8 @@ global.client = new Discord.Client({ }); global.bot = client; +global.pollPingLastUsed = 0; + require("./bot/discord/commands/mute").init(client); //Event handler