RolePerms Update

This commit is contained in:
ItzEmerald committed 2020-07-15 02:16:15 +01:00
1 parent 28699f0ff0
commit 5c98376a8c
8 files changed
+62 -24

No files matched your search

+8 -3
View File
@@ -19,11 +19,10 @@ module.exports = {
const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!")
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\``)
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``)
.setColor(supportbot.WarningColour)
if (!message.member.roles.cache.has(SupportStaff.id ))
return message.channel.send({ embed: NoPerms });
if (!message.member.roles.cache.has(SupportStaff.id || Admins.id)) {
const BotSpeaks = agrs.join(" ");
@@ -32,6 +31,12 @@ module.exports = {
.setColor(supportbot.EmbedColour)
message.channel.send({ embed: Speaking })
} else {
return message.channel.send({ embed: NoPerms });
}
}
};
+8 -4
View File
@@ -19,12 +19,10 @@ module.exports = {
const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!")
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\``)
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``)
.setColor(supportbot.WarningColour)
if (!message.member.roles.cache.has(SupportStaff.id))
return message.channel.send({ embed: NoPerms });
if (!message.member.roles.cache.has(SupportStaff.id || Admins.id)) {
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
const Exists = new Discord.MessageEmbed()
.setTitle("No Ticket Found!")
@@ -56,5 +54,11 @@ module.exports = {
.setTimestamp()
.setColor(supportbot.EmbedColour)
message.channel.send({ embed: Complete });
} else {
return message.channel.send({ embed: NoPerms });
}
}
};
+3 -3
View File
@@ -23,14 +23,14 @@ module.exports = {
if(!locateChannel) return message.channel.send({ embed: errornochannel });
let serverAdmins = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin);
let Admins = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin);
const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!")
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${serverAdmins.name}\``)
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${Admins.name}\``)
.setColor(supportbot.WarningColour)
if (!message.member.roles.cache.has(serverAdmins.id))
if (!message.member.roles.cache.has(Admins.id))
return message.channel.send({ embed: NoPerms });
+1 -7
View File
@@ -40,13 +40,7 @@ module.exports = {
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL());
if (message.member.roles.cache.some(role => role.name === supportbot.Staff, supportbot.Admin)) {
HelpCommandEmbed.addFields(
{ name: '🔑 Staff Commands', value: `${staffCommands}\n`, inline: false },
)
}
if (message.member.roles.cache.some(role => role.name === supportbot.Staff)) {
if (message.member.roles.cache.some(role => role.name === supportbot.Staff || supportbot.Admin)) {
HelpCommandEmbed.addFields(
{ name: '🔑 Staff Commands', value: `${staffCommands}\n`, inline: false },
)
+33
View File
@@ -0,0 +1,33 @@
// SupportBot 6.0, Created by Emerald Services
// Links Command
const Discord = require("discord.js");
const fs = require("fs");
const yaml = require('js-yaml');
const { execute } = require("./help");
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
module.exports = {
name: supportbot.LinksCommand,
description: supportbot.LinksDesc,
execute(message, args) {
const LinksEmbed = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour)
let botLinks = supportbot.HELP;
let links = '';
for ( let name in botLinks ) {
links += `[${name}](${botLinks[ name ]})\n`;
};
LinksEmbed.addField(supportbot.HelpTitle, links)
message.channel.send({ embed: LinksEmbed });
}
};
+7 -5
View File
@@ -19,12 +19,10 @@ module.exports = {
const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!")
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\``)
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``)
.setColor(supportbot.WarningColour)
if (!message.member.roles.cache.has(SupportStaff.id))
return message.channel.send({ embed: NoPerms });
if (!message.member.roles.cache.has(SupportStaff.id || Admins.id)) {
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
const Exists = new Discord.MessageEmbed()
.setTitle("No Ticket Found!")
@@ -39,7 +37,7 @@ module.exports = {
const UserNotExist = new Discord.MessageEmbed()
.setTitle("User Not Found!")
.setDescription(`${supportbot.UserNotFound}\n\nTry Again:\`${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>\``)
.setColor(supportbot.ErrorColor)
.setColor(supportbot.ErrorColour)
if (!rUser) return message.channel.send({ embed: UserNotExist });
@@ -56,5 +54,9 @@ module.exports = {
.setTimestamp()
.setColor(supportbot.EmbedColour)
message.channel.send({ embed: Complete });
} else {
return message.channel.send({ embed: NoPerms });
}
}
};
+1 -1
View File
@@ -1,4 +1,4 @@
{
"ticket": "ticket-0061",
"ticket": "ticket-0062",
"id":419821884431925260
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"716992597377286145": {
"id": 62
"id": 63
}
}