Update
This commit is contained in:
1 parent
94db6cff7b
commit
dcc00d8d1f
4 files changed
+89
-23
No files matched your search
+17
-5
@@ -13,10 +13,11 @@ module.exports = {
|
|||||||
execute(message, args) {
|
execute(message, args) {
|
||||||
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.AddUser}!`);
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.AddUser}!`);
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
let SupportStaff = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.Staff);
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
.setTitle("Invalid Permissions!")
|
.setTitle("Invalid Permissions!")
|
||||||
.setDescription(":warning: **Err!** You do not have the correct permissions to use this command.")
|
.setDescription(`:warning: **Err!** You do not have the correct permissions to use this command.\n\nRole Required: \`${supportbot.SupportStaff}\``)
|
||||||
.setColor(supportbot.WarningColour)
|
.setColor(supportbot.WarningColour)
|
||||||
message.channel.send({ embed: NoPerms });
|
message.channel.send({ embed: NoPerms });
|
||||||
|
|
||||||
@@ -37,8 +38,19 @@ module.exports = {
|
|||||||
.setColor(supportbot.ErrorColor)
|
.setColor(supportbot.ErrorColor)
|
||||||
|
|
||||||
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
||||||
|
|
||||||
|
message.channel.updateOverwrite(rUser, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
CREATE_INVITE: false,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
READ_MESSAGES: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Added!")
|
||||||
|
.setDescription(`👍 ${rUser} has been added to this ticket`)
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: Complete });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -16,19 +16,19 @@ module.exports = {
|
|||||||
let locateChannel = message.guild.channels.cache.find(AnnouncementChannel => AnnouncementChannel.name === supportbot.AnnouncementChannel);
|
let locateChannel = message.guild.channels.cache.find(AnnouncementChannel => AnnouncementChannel.name === supportbot.AnnouncementChannel);
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
const errornochannel = new Discord.MessageEmbed()
|
||||||
.setTitle("SupportBot Error!")
|
.setTitle("Invalid Channel")
|
||||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.AnnouncementChannel}\`\n\nError Code: \`SB-03\``)
|
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.AnnouncementChannel}`)
|
||||||
.setColor(supportbot.ErrorColour);
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
||||||
|
|
||||||
let serverAdmins = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin);
|
let serverAdmins = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin);
|
||||||
|
|
||||||
const rolerequired = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
.setTitle("SupportBot Error!")
|
.setTitle("Invalid Permissions!")
|
||||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.Admin}\`\n\nError Code: \`SB-02\``)
|
.setDescription(`:warning: **Err!** You do not have the correct permissions to use this command.\n\nRole Required: \`${supportbot.serverAdmins}\``)
|
||||||
.setColor(supportbot.ErrorColour);
|
.setColor(supportbot.WarningColour)
|
||||||
if (!message.member.roles.cache.has(serverAdmins.id)) return message.reply({embed: rolerequired});
|
message.channel.send({ embed: NoPerms });
|
||||||
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Remove User
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: supportbot.RemoveUser,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.RemoveUser}!`);
|
||||||
|
|
||||||
|
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.Staff);
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(":warning: **Err!** You do not have the correct permissions to use this command.")
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
message.channel.send({ embed: NoPerms });
|
||||||
|
|
||||||
|
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Incorrect Channel")
|
||||||
|
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
message.channel.send({ embed: Exists });
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(`:x: **Error!** This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>\``)
|
||||||
|
.setColor(supportbot.ErrorColor)
|
||||||
|
|
||||||
|
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
||||||
|
|
||||||
|
message.channel.updateOverwrite(rUser, {
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
CREATE_INVITE: false,
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
READ_MESSAGES: false
|
||||||
|
});
|
||||||
|
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Removed!")
|
||||||
|
.setDescription(`👍 ${rUser} has been removed from this ticket`)
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: Complete });
|
||||||
|
}
|
||||||
|
};
|
||||||
+10
-11
@@ -35,6 +35,7 @@ WarningColour: "#fca117"
|
|||||||
AutoRole: "true"
|
AutoRole: "true"
|
||||||
# By setting "AutoRole to 'true' the bot will automatically apply the role below when members joins. Set to 'false' to disable this feature.
|
# By setting "AutoRole to 'true' the bot will automatically apply the role below when members joins. Set to 'false' to disable this feature.
|
||||||
AutoRole_Role: "Member"
|
AutoRole_Role: "Member"
|
||||||
|
LockdownRole: "@everyone"
|
||||||
|
|
||||||
Staff: "Support"
|
Staff: "Support"
|
||||||
Admin: "Admin"
|
Admin: "Admin"
|
||||||
@@ -144,20 +145,18 @@ LinksCommand: "links"
|
|||||||
PingCommand: "ping"
|
PingCommand: "ping"
|
||||||
SuggestCommand: "suggest"
|
SuggestCommand: "suggest"
|
||||||
|
|
||||||
# Staff Command Configuration
|
|
||||||
|
|
||||||
SayCommand: "say"
|
|
||||||
ChatLockCommand: "lock"
|
|
||||||
ChatUnlockCommand: "unlock"
|
|
||||||
|
|
||||||
# Management Command Configuration
|
|
||||||
|
|
||||||
AnnounceCommand: "announce"
|
|
||||||
|
|
||||||
# Support Command Configuration
|
# Support Command Configuration
|
||||||
|
|
||||||
NewTicket: "ticket"
|
NewTicket: "ticket"
|
||||||
CloseTicket: "close"
|
CloseTicket: "close"
|
||||||
AddUser: "add"
|
AddUser: "add"
|
||||||
RemoveUser: "remove"
|
RemoveUser: "remove"
|
||||||
RenameTicket: "rename"
|
RenameTicket: "rename"
|
||||||
|
|
||||||
|
# Staff Command Configuration
|
||||||
|
|
||||||
|
SayCommand: "say"
|
||||||
|
|
||||||
|
# Admin Command Configuration
|
||||||
|
|
||||||
|
AnnounceCommand: "announce"
|
||||||
Reference in new issue
Block a user