mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-22 08:45:55 +00:00
ensure the /verify and /code only work in the specified channel, and add admin log channel to the .env.example
This commit is contained in:
parent
d11ccfab4e
commit
a44310b00f
4 changed files with 21 additions and 1 deletions
|
@ -7,12 +7,13 @@ EMAIL_USER=example@example.com
|
|||
EMAIL_PASS=YOUR_EMAIL_PASS
|
||||
|
||||
# Allowed domains for email verification
|
||||
EMAIL_DOMAINS=example@example.com // or it can be a list, example: "example.com,example2.com"
|
||||
EMAIL_DOMAINS=example@example.com // or it can be a list, example: example.com,example2.com
|
||||
|
||||
# Discord
|
||||
GUILD_ID=YOUR_GUILD_ID
|
||||
VERIFICATION_CHANNEL_NAME=YOUR_VERIFICATION_CHANNEL_NAME
|
||||
VERIFIED_ROLE_NAME=YOUR_VERIFIED_ROLE_NAME
|
||||
ADMIN_LOG_CHANNEL_ID=YOUR_ADMIN_LOG_CHANNEL_ID
|
||||
|
||||
# Database
|
||||
MONGODB_URI=YOUR_MONGODB_URI
|
|
@ -54,6 +54,7 @@ EMAIL_DOMAINS=example@example.com // or it can be a list, example: "example.com,
|
|||
GUILD_ID=YOUR_GUILD_ID
|
||||
VERIFICATION_CHANNEL_NAME=YOUR_VERIFICATION_CHANNEL_NAME
|
||||
VERIFIED_ROLE_NAME=YOUR_VERIFIED_ROLE_NAME
|
||||
ADMIN_LOG_CHANNEL_ID=YOUR_ADMIN_LOG_CHANNEL_ID
|
||||
|
||||
# Database
|
||||
MONGODB_URI=YOUR_MONGODB_URI
|
||||
|
|
|
@ -13,6 +13,15 @@ module.exports = {
|
|||
),
|
||||
|
||||
async execute(interaction, client) {
|
||||
// Ensure command is only used in the specified verification channel
|
||||
const verificationChannelName = process.env.VERIFICATION_CHANNEL_NAME;
|
||||
if (interaction.channel.name !== verificationChannelName) {
|
||||
return interaction.reply({
|
||||
content: `This command can only be used in the #${verificationChannelName} channel.`,
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
const code = interaction.options.getString("code");
|
||||
|
||||
if (!code) {
|
||||
|
|
|
@ -22,6 +22,15 @@ module.exports = {
|
|||
),
|
||||
|
||||
async execute(interaction, client) {
|
||||
// Ensure command is only used in the specified verification channel
|
||||
const verificationChannelName = process.env.VERIFICATION_CHANNEL_NAME;
|
||||
if (interaction.channel.name !== verificationChannelName) {
|
||||
return interaction.reply({
|
||||
content: `This command can only be used in the #${verificationChannelName} channel.`,
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
const email = interaction.options.getString("email");
|
||||
const emailDomain = email.split("@")[1];
|
||||
const EMAIL_DOMAINS = process.env.EMAIL_DOMAINS.split(",");
|
||||
|
|
Loading…
Reference in a new issue