Updated 5.2

This commit is contained in:
ItzEmerald committed 2020-04-16 16:43:16 +01:00
1 parent 8173c31a60
commit f2de39de33
18 files changed
+260 -225

No files matched your search

+15 -25
View File
@@ -14,42 +14,32 @@ exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Add_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Add_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole); let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour); .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply({embed: rolemissing}); .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour);
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.MessageEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`) .setTitle("Incorrect Channel")
.setColor(supportbot.EmbedColour); .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket}); if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])); let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
const cantfinduser = new Discord.MessageEmbed() const cantfinduser = new Discord.MessageEmbed()
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`) .setTitle("Invalid User!")
.setColor(supportbot.EmbedColour); .setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Add_Command} <user#0000>\``)
.setColor(supportbot.WarningColour);
if(!rUser) return message.channel.send({embed: cantfinduser}); if(!rUser) return message.channel.send({embed: cantfinduser});
const channel = message.guild.channels.find(channel => channel.name === message.channel.name); message.channel.updateOverwrite(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
const cantfindchannel = new Discord.MessageEmbed()
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
.setColor(supportbot.EmbedColour);
if(!channel) return message.channel.send({embed: cantfindchannel});
// message.delete().catch(O_o=>{});
message.channel.overwritePermissions(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
const useradded = new Discord.MessageEmbed() const useradded = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour) .setColor(supportbot.SuccessColour)
.setTitle("User Added") .setTitle("User Added")
.setDescription(`👍 ${rUser} has been added to this ticket`) .setDescription(`👍 ${rUser} has been added to this ticket`)
.setTimestamp(); .setTimestamp();
+17 -16
View File
@@ -11,21 +11,16 @@ const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8')); const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => { exports.run = (bot, message, args) => {
message.delete();
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Announcement_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Announcement_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Announcement_Title}`) .setTitle(`${supportbot.Announcement_Title}`)
@@ -34,16 +29,22 @@ exports.run = (bot, message, args) => {
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL) .setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${supportbot.Announcement_Channel}`) let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Announcement_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Announcement_Channel}**`)
ac.send("@everyone").then((msg) => { const errornochannel = new Discord.MessageEmbed()
ac.send(embed); .setTitle("SupportBot Error!")
.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.Announcement_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(supportbot.everyone).then((msg) => {
locateChannel.send(embed);
}); });
const AccSuccessEmbed = new Discord.MessageEmbed() const AccSuccessEmbed = new Discord.MessageEmbed()
.setTitle("Announcement Created") .setTitle("Announcement Created")
.setDescription(`👍 Successfully sent your announcement to <#${ac.id}>`) .setDescription(`👍 Successfully sent your announcement to <#${locateChannel.id}>`)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
message.channel.send({embed: AccSuccessEmbed}); message.channel.send({embed: AccSuccessEmbed});
+7 -7
View File
@@ -20,9 +20,9 @@ exports.run = (bot, message, args) => {
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) { if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`) .setTitle("Incorrect Channel")
.setColor(supportbot.EmbedColour); .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
message.channel.send(embed); message.channel.send(embed);
return; return;
} }
@@ -41,7 +41,7 @@ exports.run = (bot, message, args) => {
errors: [ 'time' ], errors: [ 'time' ],
} ).then( collected => { } ).then( collected => {
let logChannel = message.guild.channels.find(channel => channel.name === supportbot.Transcript_Log); let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.Transcript_Log);
let user = message.author; let user = message.author;
@@ -60,7 +60,7 @@ exports.run = (bot, message, args) => {
.addField("Closed By", message.author.tag) .addField("Closed By", message.author.tag)
.addField("Reason", reason); .addField("Reason", reason);
message.channel.fetchMessages({ limit: 100 }) message.channel.messages.fetch({ limit: 100 })
.then( msgs => { .then( msgs => {
let txt = ''; let txt = '';
@@ -84,11 +84,11 @@ exports.run = (bot, message, args) => {
logChannel.send(logEmbed).catch(err => { logChannel.send(logEmbed).catch(err => {
message.reply(err) message.reply(err)
}) })
logChannel.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) ); logChannel.send( new Discord.MessageAttachment( Buffer.from( txt ), `${name}.txt` ) );
message.channel.delete(); message.channel.delete();
// message.channel.fetchMessages( { limit: 100, before: msgs.last().id } ) // message.channel.messages.fetch( { limit: 100, before: msgs.last().id } )
// .then( msg => { // .then( msg => {
// const merged = msgs.concat( msg ); // const merged = msgs.concat( msg );
+12 -15
View File
@@ -14,24 +14,21 @@ exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Forceclose_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Forceclose_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply({embed: rolemissing}); .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.MessageEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`) .setTitle("Incorrect Channel")
.setColor(supportbot.EmbedColour) .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket}); if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
const log = message.guild.channels.find(channel => channel.name === supportbot.Transcript_Log) const log = message.guild.channels.cache.find(channel => channel.name === supportbot.Transcript_Log)
const uID = message.author const uID = message.author
const reason = args.join(" ") || "No Reason Provided."; const reason = args.join(" ") || "No Reason Provided.";
const name = message.channel.name; const name = message.channel.name;
@@ -48,10 +45,10 @@ exports.run = async (bot, message, args) => {
.addField("Ticket Author", uID) .addField("Ticket Author", uID)
.addField("Closed By", message.author.tag) .addField("Closed By", message.author.tag)
.addField("Reason", reason) .addField("Reason", reason)
message.channel.fetchMessages({ limit: 100 }) message.channel.messages.fetch({ limit: 100 })
.then(msgs => { .then(msgs => {
message.channel.fetchMessages({ limit: 100, before: msgs.last().id }) message.channel.messages.fetch({ limit: 100, before: msgs.last().id })
.then(msg => { .then(msg => {
const merged = msgs.concat(msg); const merged = msgs.concat(msg);
+4 -3
View File
@@ -37,11 +37,12 @@ exports.run = (bot, message, args) => {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(supportbot.Bot_Name) .setTitle(supportbot.Bot_Name)
.addField("👨 User Commands", userCommands) .addField("🟨 User Commands", userCommands)
.addField(":pushpin: Support Commands", supportCommands) .addField("🎫 Support Commands", supportCommands)
.addField("🔑 Staff Commands", staffCommands) .addField("🔐 Staff Commands", staffCommands)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL); .setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL);
message.channel.send(embed); message.channel.send(embed);
} }
+7 -11
View File
@@ -14,18 +14,14 @@ exports.run = async(bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Lockchat_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Lockchat_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`) let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false }); message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true }); message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
+14 -13
View File
@@ -14,17 +14,13 @@ exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Poll_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Poll_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Poll_Title}`) .setTitle(`${supportbot.Poll_Title}`)
@@ -33,10 +29,15 @@ exports.run = (bot, message, args) => {
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL) .setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${supportbot.Poll_Channel}`) let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Poll_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Poll_Channel}**`)
ac.send(embed) const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.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.Poll_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(embed)
.then(async function(msg) { .then(async function(msg) {
msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2)); msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2));
+14 -24
View File
@@ -14,39 +14,29 @@ exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Remove_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Remove_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply({embed: rolemissing}); .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.MessageEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`) .setTitle("Incorrect Channel")
.setColor(supportbot.EmbedColour) .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket}); if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])); let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
const cantfinduser = new Discord.MessageEmbed() const cantfinduser = new Discord.MessageEmbed()
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`) .setTitle("Invalid User!")
.setColor(supportbot.EmbedColour) .setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Remove_Command} <user#0000>\``)
.setColor(supportbot.WarningColour);
if(!rUser) return message.channel.send({embed: cantfinduser}); if(!rUser) return message.channel.send({embed: cantfinduser});
const channel = message.guild.channels.find(channel => channel.name === message.channel.name); message.channel.updateOverwrite(rUser, { READ_MESSAGES: false, SEND_MESSAGES: false });
const cantfindchannel = new Discord.MessageEmbed()
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
.setColor(supportbot.EmbedColour)
if(!channel) return message.channel.send({embed: cantfindchannel});
// message.delete().catch(O_o=>{});
message.channel.overwritePermissions(rUser, { READ_MESSAGES: false, SEND_MESSAGES: false });
const useradded = new Discord.MessageEmbed() const useradded = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
+14 -13
View File
@@ -14,17 +14,13 @@ exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Rename_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Rename_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.colour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply({embed: rolemissing}); .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.MessageEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`) .setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
@@ -40,10 +36,15 @@ exports.run = async (bot, message, args) => {
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter) .setFooter(supportbot.EmbedFooter)
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Logs}`); let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
logChannel.send({embed: logEmbed}); const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.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.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(logEmbed)
}; };
+17 -13
View File
@@ -14,21 +14,20 @@ exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Report_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Report_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`); let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`);
const rolemissing = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour);
if(!staffGroup) { if(!staffGroup) {
message.reply(rolemissing).catch(err => { message.reply(rolemissing).catch(err => {
console.error(err); console.error(err);
}); });
} else { } else {
const donothaverole = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if(!message.member.roles.has(staffGroup.id)) { .setColor(supportbot.ErrorColour)
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
if(!message.member.roles.cache.has(staffGroup.id)) {
message.reply(donothaverole); message.reply(donothaverole);
} else { } else {
if(!args[0]) { if(!args[0]) {
@@ -47,11 +46,16 @@ exports.run = (bot, message, args) => {
.setTimestamp(new Date()) .setTimestamp(new Date())
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL); .setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${supportbot.Report_Channel}`) let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Report_Channel}`)
if(!rc) { if(!locateChannel) {
message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Report_Channel}**`); const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.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.Report_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
} else { } else {
rc.send(embed); locateChannel.send(embed);
} }
} }
+6 -10
View File
@@ -14,17 +14,13 @@ exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Say_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Say_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Announcement_Title}`) .setTitle(`${supportbot.Announcement_Title}`)
+10 -4
View File
@@ -1,3 +1,4 @@
// SupportBot // SupportBot
// Created by © 2020 Emerald Services // Created by © 2020 Emerald Services
// Command: Say // Command: Say
@@ -21,17 +22,22 @@ exports.run = async(bot, message, args) => {
.setTimestamp(new Date()) .setTimestamp(new Date())
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${supportbot.Suggestion_Channel}`); let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Suggestion_Channel}`)
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${supportbot.Suggestion_Channel}**`);
sc.send(SuggestionEmbed) const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.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.Suggestion_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(SuggestionEmbed)
.then(async function(msg) { .then(async function(msg) {
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno)); msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
}); });
const SuggestionSuccessEmbed = new Discord.MessageEmbed() const SuggestionSuccessEmbed = new Discord.MessageEmbed()
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${sc.id}>`) .setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${locateChannel.id}>`)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
message.channel.send(SuggestionSuccessEmbed); message.channel.send(SuggestionSuccessEmbed);
+46 -32
View File
@@ -1,6 +1,6 @@
// SupportBot // SupportBot
// Created by © 2020 Emerald Services // Created by © 2020 Emerald Services
// Command: Say // Command: Ticket
const Discord = require("discord.js"); const Discord = require("discord.js");
const bot = new Discord.Client(); const bot = new Discord.Client();
@@ -27,34 +27,34 @@ exports.run = async (bot, message, args) => {
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
// Ticket Creation // Ticket Creation
if (message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen); if (message.guild.channels.cache.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
message.guild.createChannel(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, { message.guild.channels.create(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
type: 'text', type: 'text',
}).then(TicketChannel => { }).then(TicketChannel => {
// Roles // Roles
let staff = message.guild.roles.find(supportRole => supportRole.name === `${supportbot.StaffRole}`) let staff = message.guild.roles.cache.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone") let everyone = message.guild.roles.cache.find(everyoneRole => everyoneRole.name === "@everyone")
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`) let department = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`) let department2 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`) let department3 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`)
// Permissions // Permissions
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(department, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(department2, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(department3, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: false, READ_MESSAGES: true }) TicketChannel.updateOverwrite(message.author, { SEND_MESSAGES: false, READ_MESSAGES: true })
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
// Category // Category
let category = message.guild.channels.find(c => c.name === supportbot.category); let category = message.guild.channels.cache.find(c => c.name === supportbot.category);
if (category) { if (category) {
TicketChannel.setParent(category.id); TicketChannel.setParent(category.id);
} else { } else {
if (message.guild.channels.get(supportbot.category)) { if (message.guild.channels.cache.get(supportbot.category)) {
TicketChannel.setParent(message.guild.channels.get(supportbot.category).id); TicketChannel.setParent(message.guild.channels.cache.get(supportbot.category).id);
} }
} }
@@ -62,7 +62,7 @@ exports.run = async (bot, message, args) => {
.setTitle(":white_check_mark: Support Ticket Created") .setTitle(":white_check_mark: Support Ticket Created")
.setDescription(`<@${message.author.id}> your support ticket created successfully`) .setDescription(`<@${message.author.id}> your support ticket created successfully`)
.addField("Your Ticket:", `<#${TicketChannel.id}>`) .addField("Your Ticket:", `<#${TicketChannel.id}>`)
.setColor(supportbot.Ticket_Colour) .setColor(supportbot.SuccessColour)
message.channel.send({embed: ticketopened}); message.channel.send({embed: ticketopened});
// Ticket Message - ( Able to edit this message via the settings.json file ) // Ticket Message - ( Able to edit this message via the settings.json file )
const ticketMessage = `Hi! <@${message.author.id}>\n${supportbot.Ticket_Message}`; const ticketMessage = `Hi! <@${message.author.id}>\n${supportbot.Ticket_Message}`;
@@ -99,24 +99,33 @@ exports.run = async (bot, message, args) => {
const reaction = collected.first(); const reaction = collected.first();
if (reaction.emoji.name === `${Emoji_1}`) { if (reaction.emoji.name === `${Emoji_1}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department, { SEND_MESSAGES: true, READ_MESSAGES: true })
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for someone to reach out to you.") const dept1 = new Discord.MessageEmbed()
.setDescription(`You have requested to contact ${department}. Please wait patiently for someone to reach out to you.`)
.setColor(supportbot.SuccessColour)
TicketChannel.send(dept1)
} }
if (reaction.emoji.name === `${Emoji_2}`) { if (reaction.emoji.name === `${Emoji_2}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department2, { SEND_MESSAGES: true, READ_MESSAGES: true })
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for someone to reach out to you.") const dept2 = new Discord.MessageEmbed()
.setDescription(`You have requested to contact ${department2}. Please wait patiently for someone to reach out to you.`)
.setColor(supportbot.SuccessColour)
TicketChannel.send(dept2)
} }
if (reaction.emoji.name === `${Emoji_3}`) { if (reaction.emoji.name === `${Emoji_3}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department3, { SEND_MESSAGES: true, READ_MESSAGES: true })
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for someone to reach out to you.") const dept3 = new Discord.MessageEmbed()
.setDescription(`You have requested to contact ${department3}. Please wait patiently for someone to reach out to you.`)
.setColor(supportbot.SuccessColour)
TicketChannel.send(dept3)
} }
}); });
@@ -125,7 +134,7 @@ exports.run = async (bot, message, args) => {
// Ticket Logging // Ticket Logging
const logEmbed = new Discord.MessageEmbed() const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Logistics of your Ticket") .setTitle(":ticket: Ticket Log")
.addField("Ticket ID", ticketNumberID, true) .addField("Ticket ID", ticketNumberID, true)
.addField("User", `<@${message.author.id}>`, true) .addField("User", `<@${message.author.id}>`, true)
.addField("Channel", `ticket#${ticketNumberID}`, true) .addField("Channel", `ticket#${ticketNumberID}`, true)
@@ -136,10 +145,15 @@ exports.run = async (bot, message, args) => {
logEmbed.addField('Subject', subject, true); logEmbed.addField('Subject', subject, true);
} }
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Logs}`); let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
logChannel.send({embed: logEmbed}) const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.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.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(logEmbed)
}).catch(err=>{console.error(err)}); }).catch(err=>{console.error(err)});
+7 -11
View File
@@ -14,18 +14,14 @@ exports.run = async(bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.UnLockchat_Command}`); console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.UnLockchat_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`) let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
const rolemissing = new Discord.MessageEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("SupportBot Error!")
.setColor(supportbot.EmbedColour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true }); message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true }); message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
+41 -4
View File
@@ -6,7 +6,7 @@
// |_| |_| // |_| |_|
// © 2020 Created by Emerald Services // © 2020 Created by Emerald Services
// Licnese: MIT // Licnese: MIT
// SupportBot v5.1.2 // SupportBot v5.2
const Discord = require("discord.js"); const Discord = require("discord.js");
const fs = require("fs"); const fs = require("fs");
@@ -37,7 +37,7 @@ fs.readdir("./sb-addons/", (err, files) => {
if(err) console.log(err); if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js") let jsfile = files.filter(f => f.split(".").pop() === "js")
if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No addons detected nor default! Either download addons from https://itzemerald.tk/`); if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No addons detected nor default! Either download addons from https://emeraldservices.xyz/`);
jsfile.forEach((f, i) =>{ jsfile.forEach((f, i) =>{
let props = require(`./sb-addons/${f}`); let props = require(`./sb-addons/${f}`);
@@ -50,9 +50,10 @@ fs.readdir("./sb-addons/", (err, files) => {
bot.on("ready", async () => { bot.on("ready", async () => {
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType}); bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`) console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
console.log(`\u001b[37m`, `Emerald Services has successfully connected to discord`) console.log(`\u001b[37m`, `${supportbot.Bot_Name} has successfully connected to discord`)
console.log(`\u001b[37m`, `You can download additional features from our marketplace https://emeraldservices.xyz/`)
console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=${bot.user.id}&permissions=8&scope=bot`) console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=${bot.user.id}&permissions=8&scope=bot`)
console.log(`\u001b[37m`, `© ️SupportBot created by Emerald Services`) console.log(`\u001b[37m`, `© SupportBot created by Emerald Services`)
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`) console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
}); });
@@ -66,6 +67,42 @@ bot.on("message", async message => {
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g); const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase(); const command = args.shift().toLowerCase();
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let autoGroup = message.guild.roles.cache.find(autoRole => autoRole.name === `${supportbot.AutoRole}`)
let deptGroup1 = message.guild.roles.cache.find(deptRole1 => deptRole1.name === `${supportbot.Department_Role_1}`)
let deptGroup2 = message.guild.roles.cache.find(deptRole2 => deptRole2.name === `${supportbot.Department_Role_2}`)
let deptGroup3 = message.guild.roles.cache.find(deptRole3 => deptRole3.name === `${supportbot.Department_Role_3}`)
const rolemissing = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Staff role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const rolemissing1 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Auto Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.AutoRole}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!autoGroup) return message.reply(rolemissing1).catch(err=>{console.error(err)})
const rolemissing2 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_1}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!deptGroup1) return message.reply(rolemissing2).catch(err=>{console.error(err)})
const rolemissing3 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_2}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!deptGroup2) return message.reply(rolemissing3).catch(err=>{console.error(err)})
const rolemissing4 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_3}\`\n\nError Code: \`SB-01\` `)
.setColor(supportbot.ErrorColour)
if (!deptGroup3) return message.reply(rolemissing4).catch(err=>{console.error(err)})
const cmd = bot.commands.get(command); const cmd = bot.commands.get(command);
if(!cmd) return; if(!cmd) return;
cmd.run(bot, message, args); cmd.run(bot, message, args);
+1 -1
View File
@@ -9,7 +9,7 @@
"author": "Emerald SRV", "author": "Emerald SRV",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"discord.js": "^11.5.1", "discord.js": "^12.1.1",
"js-yaml": "^3.13.1" "js-yaml": "^3.13.1"
} }
} }
+1 -1
View File
@@ -10,7 +10,7 @@ someaddon.settings = require("./settings/someaddon.json");
exports.run = async(bot, message, args) => { exports.run = async(bot, message, args) => {
message.delete(); message.delete();
message.channel.send(":white_check_mark: **SupportBot Addon**\nThis addon is here by default.\nWe are currently working on some super amazing addons for SupportBot\nHowever, If you would like to start creating your own support bot addon\ncontact us at EmeraldServices.\n") message.channel.send(":white_check_mark: **SupportBot Addon**\nYou can download addons from our marketplace. https://emeraldservices.xyz/")
} }
+27 -22
View File
@@ -5,21 +5,26 @@
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__| # /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
# \/ |__| |__| \/ # \/ |__| |__| \/
# #
# SupportBot v5.1.2 # SupportBot v5.2
# Created by © 2020 Emerald Services # Created by © 2020 Emerald Services
# License: MIT # License: MIT
#Bot Indentification #Bot Indentification
Token: "Bot_Token_Here" Token: "BOT_TOKEN_HERE"
Prefix: "!" Prefix: "!"
Bot_Name: "SupportBot" Bot_Name: "SupportBot"
BotActivity: "SupportBot v5.1" BotActivity: "SupportBot v5.2"
ActivityType: "PLAYING" ActivityType: "PLAYING"
EmbedColour: "#4bbf5c" EmbedColour: "#4bbf5c"
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot" EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
# Colour Settings
ErrorColour: "#ff3030"
SuccessColour: "#4bbf5c"
WarningColour: "#fca117"
# Role Settings # Role Settings
AutoRole: "Member" AutoRole: "Member"
StaffRole: "Support" StaffRole: "Support"
@@ -28,19 +33,21 @@ locked_role: "@everyone"
everyone: "@everyone" everyone: "@everyone"
Department_Role_1: "Support" Department_Role_1: "Support"
Department_Role_2: "Security" Department_Role_2: "Sales"
Department_Role_3: "Sales" Department_Role_3: "Support"
# Welcome & Leave # Ticket Department Settings
WelcomeChannel: "welcome" Ticket_Department_1: "Support"
WelcomeMessage: "Welcome to the server!" Ticket_Department_2: "Sales"
Ticket_Department_3: "Other"
LeaveChannel: "welcome" Ticket_Department_Emoji_1: "🟢"
LeaveMessage: "Thank you for visiting us!" Ticket_Department_Emoji_2: "🔵"
Ticket_Department_Emoji_3: "🔴"
# Ticket Settings # Ticket Settings
category: "Tickets" category: "Tickets"
Ticket_Colour: "#000e42" Ticket_Colour: "#4bbf5c"
Ticket_Channel_Name: "ticket" Ticket_Channel_Name: "ticket"
Ticket_Logs: "ticket-logs" Ticket_Logs: "ticket-logs"
@@ -54,14 +61,12 @@ Closure_Confirm_Word: "confirm"
Ticket_Message: "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you." Ticket_Message: "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you."
Default_Ticket_Reason: "No Subject" Default_Ticket_Reason: "No Subject"
# Ticket Department Settings # Welcome & Leave
Ticket_Department_1: "Support" WelcomeChannel: "welcome"
Ticket_Department_2: "Security" WelcomeMessage: "Welcome to the server!"
Ticket_Department_3: "Sales"
Ticket_Department_Emoji_1: "🎧" LeaveChannel: "welcome"
Ticket_Department_Emoji_2: "🔐" LeaveMessage: "Thank you for visiting us!"
Ticket_Department_Emoji_3: "💵"
# Announcement Settings # Announcement Settings
Announcement_Title: "SupportBot Announcement" Announcement_Title: "SupportBot Announcement"
@@ -69,11 +74,11 @@ Announcement_Channel: "announcements"
Announcement_Tag_Role: "@everyone" Announcement_Tag_Role: "@everyone"
# Poll Settings # Poll Settings
Poll_Channel": "polls" Poll_Channel: "polls"
Poll_Title": "📊 Polls" Poll_Title: "📊 Polls"
Reaction_Poll_1": "✅" Reaction_Poll_1: "✅"
Reaction_Poll_2": "❎" Reaction_Poll_2: "❎"
# Suggestion Settings # Suggestion Settings
Suggestion_Title: "SupportBot Suggestions" Suggestion_Title: "SupportBot Suggestions"