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

+7 -1
View File
@@ -16,7 +16,10 @@ module.exports = {
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args) => {
run: async (client, message, args, { GuildDB }) => {
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 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.`);
if (user.user.activeCommunity == null) return message.channel.send(`You must join a community to use this command.`);
@@ -56,6 +59,9 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
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.`);
+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 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.`);
if (args.length==0) return message.channel.send(`You are missing a \`Serial Number\`.`);
@@ -80,6 +83,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.`);
let data = {
+7
View File
@@ -18,6 +18,9 @@ module.exports = {
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
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");
if (GuildDB.customRoleStatus) {
let userRoles = []; // TODO: get user roles
let hasRole = await client.hasRole(userRoles, GuildDB.serverID);
@@ -144,6 +147,10 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
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.`);
let data;
+6
View File
@@ -17,6 +17,9 @@ module.exports = {
* @param {*} param3
*/
run: async (client, message) => {
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 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.`);
if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command.`);
@@ -72,6 +75,9 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
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.`);
+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 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.`);
if (args.length==0) return message.channel.send(`You are missing a \`Plate #\`.`);
@@ -88,6 +91,9 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
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.`);
+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 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.`);
if (args.length==0) return message.channel.send(`You must provide a \`First Name\`, \`Last Name\`, \`DOB\`(yyyy-mm-dd).`);
@@ -149,6 +152,9 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
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.`);
+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.`);