diff --git a/commands/Server/sendVerify.js b/commands/Server/sendVerify.js new file mode 100644 index 0000000..dc71d39 --- /dev/null +++ b/commands/Server/sendVerify.js @@ -0,0 +1,19 @@ +const { SlashCommandBuilder } = require("@discordjs/builders"); +const { MessageActionRow, MessageButton } = require("discord.js"); + +module.exports = { + data: new SlashCommandBuilder() + .setName("verifysend") + .setDescription("Verifies the user"), + async execute(interaction) { + const buttonData = new MessageActionRow() + .addComponents( + new MessageButton() + .setCustomId('verifybutt') + .setLabel('Click to Verify') + .setStyle('SUCCESS'), + ); + interaction.channel.send({ content: `<@&1059563959037984929> Please __click__ the button __below__ to gain access to the server. Run \`/ticket\` for support!`, components: [buttonData] }) + } +} + diff --git a/events/messageCreate.js b/events/messageCreate.js new file mode 100644 index 0000000..b66613f --- /dev/null +++ b/events/messageCreate.js @@ -0,0 +1,33 @@ +const ROLE_ID = '1219871155952025671'; +const TIMEOUT_DURATION = 7500 + +module.exports = { + name: "messageCreate", + async execute(interaction) { + + if (!interaction.author.bot) { + if (interaction.mentions.users.size > 0) { + for (const user of interaction.mentions.users.values()) { + const member = interaction.guild.members.cache.get(user.id); + if (member && member.roles.cache.has(ROLE_ID)) { + + const deleteReply = await interaction.reply({ + content: `Please refrain from mentioning any users with the \`Upper Class\` role! Our goal is to create a healthy environment; we must remain respectful to their time and notifications!`, + ephemeral: true + }); + + interaction.guild.channels.cache.find(channel => channel.id === '1219872238699020388').send(`⚠️Upper Class Pinged⚠️\n###Who:<@${interaction.user.id}>\n###User Pinged:${user.username}\n###Where: ${interaction.channel.name}\n###Contents: ${interaction.content}`) + + setTimeout(async () => { + try { + await deleteReply.delete(); + } catch (error) { + console.error('Failed to delete reply:', error); + } + }, TIMEOUT_DURATION); + } + } + } + } + } +} \ No newline at end of file