update/verify user has role

This commit is contained in:
SowinskiBraeden committed 2022-03-17 15:30:49 -07:00
1 parent e1c599d3c6
commit 8d5584d097
10 files changed
+74 -849

No files matched your search

+6
View File
@@ -18,6 +18,9 @@ module.exports = {
* @param {*} param3
*/
run: async (client, message, args) => {
let useCommand = await client.verifyUseCommand(GuildDB.serverID, message.member.roles.cache, false);
if (!useCommand) return message.channel.send("You don't have permission to use this command");
let validStatus=['10-8','10-7','10-6','10-11','10-23','10-97','10-15','10-70','10-80', '10-41', '10-42'];
let user = await client.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user);
if (!user) return message.channel.send(`You are not logged in ${message.author}`);
@@ -79,6 +82,9 @@ module.exports = {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
if (!useCommand) return interaction.send("You don't have permission to use this command");
let user = await client.dbo.collection("users").findOne({"user.discord.id":interaction.member.user.id}).then(user => user);
if (!user) return interaction.send(`You are not logged in ${message.author}`);
if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command.`);