#i ve got the check if it s whitelisted
1 messages · Page 1 of 1 (latest)
,
Okay lets talk here
cus this may take some more time lol
And i fucking hate slowmode
yea
client.on('interactionCreate', async interaction => {
const foundKey=await keySchema.find({ claimedGuild: interaction.guild.id })
if(foundKey[0]===undefined) return interaction.reply({ embeds: [errorEmbed('Uh oh! This server does not have a valid whitelist to use this bot.')] })
});
then you need to do the check, if it comes back as not whitelisted scream at the person
thats what i have so far
disregarding the command running after it
as it's not really needed for the example
If it is whitelisted then proceed to reply with the functionality you want
yeah
but i still want a single command to be allowed to be used even without a whitelist
put an if before the const foundkey
if interaction.name is x run this code
else just check if the guild is in your db
what would interaction.name be
the one set with .setname
or the one set on the filename
logging interaction as a whole is easiest
i cant think of what the property is rn
cant reach my code
also do check its a slash command
nice thats the one
is that just the usual isCommand
think so
i switchcase on interaction.type
i prefer to use the enums rather than the functions xd
!(interaction.isCommand()&&interaction.commandName==='verifykey')```
would that mean not all of it