Compare commits

..
47 Commits
Author SHA1 Message Date
ItzEmerald 50258dc359 Update index.js 2020-04-21 20:20:42 +01:00
ItzEmerald d9c6b7698f Update index.js 2020-04-21 19:37:28 +01:00
ItzEmerald f042f34ae2 Update index.js 2020-04-21 19:24:15 +01:00
ItzEmerald c087edc14f Update suggest.js 2020-04-18 22:49:03 +01:00
ItzEmerald d96ccc3265 Update add.js 2020-04-17 02:59:25 +01:00
ItzEmerald 018ef19efd Update remove.js 2020-04-17 02:56:10 +01:00
ItzEmerald 159317a15a Update remove.js 2020-04-17 02:55:25 +01:00
ItzEmerald 34583c96bf Update add.js 2020-04-17 02:54:20 +01:00
ItzEmerald 887d3d3ab4 Update ticket.js 2020-04-17 02:48:38 +01:00
ItzEmerald f2de39de33 Updated 5.2 2020-04-16 16:43:16 +01:00
ItzEmerald 8173c31a60 Update supportbot-config.yml 2020-04-15 16:18:31 +01:00
ItzEmerald 80a2871741 Update ping.js 2020-04-15 15:08:13 +01:00
ItzEmerald 3b37e9c420 Updated say.js
Updated RichEmbed to MessageEmbed
2020-04-15 15:07:20 +01:00
ItzEmerald 730ba561bc Update index.js 2020-04-15 15:05:56 +01:00
ItzEmerald 4d7ddc9d6f Update ping.js 2020-04-14 22:45:51 +01:00
ItzEmerald 680f71a602 Merge pull request #15 from real2two/patch-14
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:53:50 +01:00
ItzEmerald 170a7b50b9 Merge pull request #16 from real2two/patch-13
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:53:14 +01:00
ItzEmerald 805c48c1bb Merge pull request #17 from real2two/patch-15
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:53:03 +01:00
ItzEmerald 7d92ed51bb Merge pull request #18 from real2two/patch-16
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:49 +01:00
ItzEmerald f849897f29 Merge pull request #19 from real2two/patch-10
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:32 +01:00
ItzEmerald 75e0f1ad1e Merge pull request #20 from real2two/patch-11
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:15 +01:00
ItzEmerald 2f015aff2b Merge pull request #21 from real2two/patch-12
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:03 +01:00
ItzEmerald bb322adb2f Merge pull request #22 from real2two/patch-7
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:51:14 +01:00
ItzEmerald 6ee0981885 Merge pull request #23 from real2two/patch-8
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:51:02 +01:00
ItzEmerald 877fb0f201 Merge pull request #24 from real2two/patch-9
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:50:39 +01:00
ItzEmerald ded4b9094a Merge pull request #25 from real2two/patch-4
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:50:07 +01:00
ItzEmerald 36ab931998 Merge pull request #26 from real2two/patch-5
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:49:54 +01:00
ItzEmerald 20baddfcca Merge pull request #27 from real2two/patch-6
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:49:36 +01:00
ItzEmerald d180c147db Merge pull request #28 from real2two/patch-1
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:49:20 +01:00
ItzEmerald 86fa91cc52 Merge pull request #29 from real2two/patch-2
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:48:53 +01:00
ItzEmerald b8c12a0307 Merge pull request #30 from real2two/patch-3
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:48:24 +01:00
Two eff2f9c195 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:27 -04:00
Two 8a8597afef Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:23 -04:00
Two 067e619488 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:17 -04:00
Two f7f8bc8c55 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:07 -04:00
Two 0c71fd7e59 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:06 -04:00
Two 5b2bd21c06 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:57 -04:00
Two 9ac68f68e2 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:42 -04:00
Two aa32f00b0d Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:35 -04:00
Two bd5f5dffad Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:28 -04:00
Two 645ad63f4f Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:23 -04:00
Two c83c6afecc Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:18 -04:00
Two 689a191d4c Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:10 -04:00
Two 5767ba0de5 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:13:57 -04:00
Two cdf78f2598 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:13:51 -04:00
Two d23f46ad9e Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:11:48 -04:00
Two 8453fa5007 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:10:32 -04:00
21 changed files with 316 additions and 278 deletions

No files matched your search

+18 -28
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.RichEmbed() 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.RichEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`) .setTitle("Incorrect Channel")
.setColor(supportbot.EmbedColour); .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole}); .setColor(supportbot.WarningColour);
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(supportbot.EmbedColour);
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.RichEmbed() 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, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
const cantfindchannel = new Discord.RichEmbed() const useradded = new Discord.MessageEmbed()
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`) .setColor(supportbot.SuccessColour)
.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.RichEmbed()
.setColor(supportbot.EmbedColour)
.setTitle("User Added") .setTitle("User Added")
.setDescription(`👍 ${rUser} has been added to this ticket`) .setDescription(`👍 ${rUser} has been added to this ticket`)
.setTimestamp(); .setTimestamp();
+20 -19
View File
@@ -11,39 +11,40 @@ 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.RichEmbed() 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.RichEmbed()
.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.RichEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Announcement_Title}`) .setTitle(`${supportbot.Announcement_Title}`)
.setDescription(args.join(" ")) .setDescription(args.join(" "))
.setTimestamp() .setTimestamp()
.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}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Announcement_Channel}**`)
ac.send("@everyone").then((msg) => { let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Announcement_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.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.RichEmbed()
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});
+10 -10
View File
@@ -19,15 +19,15 @@ 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.Close_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.Close_Command}`);
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) { if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
const embed = new Discord.RichEmbed() 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;
} }
const closeRequestEmbed = new Discord.RichEmbed() const closeRequestEmbed = new Discord.MessageEmbed()
.setDescription(`**${supportbot.Ticket_Closure}**`) .setDescription(`**${supportbot.Ticket_Closure}**`)
.addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`) .addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
.setFooter("Your request will be avoided in 20 seconds") .setFooter("Your request will be avoided in 20 seconds")
@@ -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;
@@ -52,7 +52,7 @@ exports.run = (bot, message, args) => {
message.channel.send(`**${supportbot.Ticket_Closing}**`) message.channel.send(`**${supportbot.Ticket_Closing}**`)
.then(() => { .then(() => {
const logEmbed = new Discord.RichEmbed() const logEmbed = new Discord.MessageEmbed()
.setTitle(supportbot.Transcript_Title) .setTitle(supportbot.Transcript_Title)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter) .setFooter(supportbot.EmbedFooter)
@@ -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 );
+14 -17
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.RichEmbed() 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.RichEmbed()
.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.RichEmbed() 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;
@@ -41,17 +38,17 @@ exports.run = async (bot, message, args) => {
.then(() => { .then(() => {
const embed1 = new Discord.RichEmbed() const embed1 = new Discord.MessageEmbed()
.setTitle(supportbot.Transcript_Title) .setTitle(supportbot.Transcript_Title)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter) .setFooter(supportbot.EmbedFooter)
.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);
+5 -4
View File
@@ -35,13 +35,14 @@ exports.run = (bot, message, args) => {
staffCommands += `**${supportbot.Prefix}${supportbot.UnLockchat_Command}**: UnLock the chat channel\n`; staffCommands += `**${supportbot.Prefix}${supportbot.UnLockchat_Command}**: UnLock the chat channel\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`; staffCommands += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`;
const embed = new Discord.RichEmbed() 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);
} }
+2 -2
View File
@@ -22,7 +22,7 @@ exports.run = ( bot, message, args ) => {
links += `[${name}](${botLinks[ name ]})\n`; links += `[${name}](${botLinks[ name ]})\n`;
}; };
let embed = new Discord.RichEmbed() let embed = new Discord.MessageEmbed()
.setTitle(supportbot.LINKS_TITLE) .setTitle(supportbot.LINKS_TITLE)
.setDescription(links) .setDescription(links)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
@@ -33,4 +33,4 @@ exports.run = ( bot, message, args ) => {
exports.help = { exports.help = {
name: supportbot.Link_Command, name: supportbot.Link_Command,
}; };
+9 -13
View File
@@ -14,23 +14,19 @@ 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.RichEmbed() 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.RichEmbed()
.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 });
const lockmsg = new Discord.RichEmbed() const lockmsg = new Discord.MessageEmbed()
.setDescription(":white_check_mark: **Chat Locked**") .setDescription(":white_check_mark: **Chat Locked**")
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
message.channel.send(lockmsg); message.channel.send(lockmsg);
@@ -39,4 +35,4 @@ exports.run = async(bot, message, args) => {
exports.help = { exports.help = {
name: supportbot.Lockchat_Command, name: supportbot.Lockchat_Command,
}; };
+2 -2
View File
@@ -14,7 +14,7 @@ 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.Ping_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.Ping_Command}`);
const embed = new Discord.RichEmbed() const embed = new Discord.MessageEmbed()
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `) .setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
message.channel.send(embed).catch(console.error); message.channel.send(embed).catch(console.error);
@@ -23,4 +23,4 @@ exports.run = (bot, message, args) => {
exports.help = { exports.help = {
name: supportbot.Ping_Command, name: supportbot.Ping_Command,
} }
+16 -15
View File
@@ -14,29 +14,30 @@ 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.RichEmbed() 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.RichEmbed()
.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.RichEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Poll_Title}`) .setTitle(`${supportbot.Poll_Title}`)
.setDescription(args.join(" ")) .setDescription(args.join(" "))
.setTimestamp() .setTimestamp()
.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}**`)
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);
ac.send(embed) 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));
@@ -46,4 +47,4 @@ exports.run = (bot, message, args) => {
exports.help = { exports.help = {
name: supportbot.Poll_Command, name: supportbot.Poll_Command,
}; };
+19 -29
View File
@@ -13,42 +13,32 @@ const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'))
exports.run = async (bot, message, args) => { 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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole) const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.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\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const rolemissing = new Discord.RichEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`) .setTitle("Incorrect Channel")
.setColor(supportbot.EmbedColour) .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
if (!staffGroup) return message.reply({embed: rolemissing}); .setColor(supportbot.WarningColour);
const donothaverole = new Discord.RichEmbed()
.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.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(supportbot.EmbedColour)
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.RichEmbed() 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});
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: false, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: false });
const channel = message.guild.channels.find(channel => channel.name === message.channel.name); const useradded = new Discord.MessageEmbed()
const cantfindchannel = new Discord.RichEmbed()
.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.RichEmbed()
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setTitle("User Removed") .setTitle("User Removed")
.setDescription(`👍 ${rUser} has been removed from this ticket`) .setDescription(`👍 ${rUser} has been removed from this ticket`)
+18 -17
View File
@@ -14,19 +14,15 @@ 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.RichEmbed() 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.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`) const outsideticket = new Discord.MessageEmbed()
.setColor(supportbot.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.RichEmbed()
.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.`)
.setColor(supportbot.colour) .setColor(supportbot.colour)
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});
@@ -34,16 +30,21 @@ exports.run = async (bot, message, args) => {
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`) message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
// Renamed Ticket Logistic // Renamed Ticket Logistic
const logEmbed = new Discord.RichEmbed() const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Ticket Renamed") .setTitle(":ticket: Ticket Renamed")
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`) .setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
.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}**`);
const errornochannel = new Discord.MessageEmbed()
logChannel.send({embed: logEmbed}); .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)
}; };
+18 -14
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.RichEmbed()
.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.RichEmbed() 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]) {
@@ -38,7 +37,7 @@ exports.run = (bot, message, args) => {
message.reply(":x: Sorry! Specify the reason of your report."); message.reply(":x: Sorry! Specify the reason of your report.");
} else { } else {
let reportDesc = args.slice(1).join(" "); let reportDesc = args.slice(1).join(" ");
const embed = new Discord.RichEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Report_Title}`) .setTitle(`${supportbot.Report_Title}`)
.setThumbnail(message.author.avatarURL) .setThumbnail(message.author.avatarURL)
.addField("Report by:", `<@${message.author.id}>`, false) .addField("Report by:", `<@${message.author.id}>`, false)
@@ -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);
} }
} }
+8 -12
View File
@@ -14,19 +14,15 @@ 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.RichEmbed() 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.RichEmbed()
.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.RichEmbed() const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Announcement_Title}`) .setTitle(`${supportbot.Announcement_Title}`)
.setDescription(args.join(" ")) .setDescription(args.join(" "))
.setTimestamp() .setTimestamp()
@@ -39,4 +35,4 @@ exports.run = (bot, message, args) => {
exports.help = { exports.help = {
name: supportbot.Say_Command, name: supportbot.Say_Command,
} }
+16 -9
View File
@@ -1,3 +1,4 @@
// SupportBot // SupportBot
// Created by © 2020 Emerald Services // Created by © 2020 Emerald Services
// Command: Say // Command: Say
@@ -14,24 +15,30 @@ 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.Suggest_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.Suggest_Command}`);
const SuggestionEmbed = new Discord.RichEmbed() const SuggestionEmbed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Suggestion_Title}`) .setTitle(`${supportbot.Suggestion_Title}`)
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`) .setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
.setFooter(`${supportbot.EmbedFooter}`, message.author.avatarURL) .setThumbnail(message.author.avatarURL)
.setFooter(`${supportbot.EmbedFooter}`)
.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}**`);
const errornochannel = new Discord.MessageEmbed()
sc.send(SuggestionEmbed) .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.RichEmbed() 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);
+55 -39
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();
@@ -22,47 +22,46 @@ exports.run = async (bot, message, args) => {
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`; const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
// Ticket Limitiations // Ticket Limitiations
const alreadyopen = new Discord.RichEmbed() const alreadyopen = new Discord.MessageEmbed()
.setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`) .setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
.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 === supportbot.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, { VIEW_CHANNEL: false });
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(department, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department2, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: false, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(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);
} }
} }
const ticketopened = new Discord.RichEmbed() const ticketopened = new Discord.MessageEmbed()
.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}`;
@@ -75,7 +74,7 @@ exports.run = async (bot, message, args) => {
const Emoji_2 = supportbot.Ticket_Department_Emoji_2; const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
const Emoji_3 = supportbot.Ticket_Department_Emoji_3; const Emoji_3 = supportbot.Ticket_Department_Emoji_3;
const TicketMessage = new Discord.RichEmbed() const TicketMessage = new Discord.MessageEmbed()
.setDescription(ticketMessage, true) .setDescription(ticketMessage, true)
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`) .addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
.setColor(supportbot.Ticket_Colour) .setColor(supportbot.Ticket_Colour)
@@ -99,24 +98,36 @@ 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(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department2, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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)
} }
}); });
@@ -124,8 +135,8 @@ exports.run = async (bot, message, args) => {
}); });
// Ticket Logging // Ticket Logging
const logEmbed = new Discord.RichEmbed() 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 +147,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}**`);
const errornochannel = new Discord.MessageEmbed()
logChannel.send({embed: logEmbed}) .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)});
+9 -13
View File
@@ -14,23 +14,19 @@ 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.RichEmbed() 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.RichEmbed()
.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 });
const lockmsg = new Discord.RichEmbed() const lockmsg = new Discord.MessageEmbed()
.setDescription(":white_check_mark: **Chat Un-Locked**") .setDescription(":white_check_mark: **Chat Un-Locked**")
.setColor(supportbot.EmbedColour); .setColor(supportbot.EmbedColour);
message.channel.send(lockmsg); message.channel.send(lockmsg);
@@ -39,4 +35,4 @@ exports.run = async(bot, message, args) => {
exports.help = { exports.help = {
name: supportbot.UnLockchat_Command, name: supportbot.UnLockchat_Command,
} }
+47 -10
View File
@@ -6,7 +6,7 @@
// |_| |_| // |_| |_|
// © 2020 Created by Emerald Services // © 2020 Created by Emerald Services
// Licnese: MIT // Licnese: MIT
// SupportBot v5.1.1 // 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);
@@ -90,25 +127,25 @@ bot.on("message", async message => {
// [SupportBot] Welcome Message && Auto Join Role // [SupportBot] Welcome Message && Auto Join Role
bot.on("guildMemberAdd", (member) => { bot.on("guildMemberAdd", (member) => {
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.WelcomeChannel}`) let channel = member.guild.channels.cache.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
let autorole = member.guild.roles.find(autorole => autorole.name === `${supportbot.AutoRole}`) let autorole = member.guild.roles.cache.find(autorole => autorole.name === `${supportbot.AutoRole}`)
const WelcomeMsg= new Discord.RichEmbed() const WelcomeMsg = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setThumbnail(member.user.avatarURL) .setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`) .setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`)
channel.send(WelcomeMsg); channel.send(WelcomeMsg);
member.addRole(autorole).catch(console.error); member.roles.add(autorole).catch(console.error);
}); });
// [SupportBot] Leave Message // [SupportBot] Leave Message
bot.on("guildMemberRemove", (member) => { bot.on("guildMemberRemove", (member) => {
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.LeaveChannel}`) let channel = member.guild.channels.cache.find(channel => channel.name === `${supportbot.LeaveChannel}`)
const LeaveMsg= new Discord.RichEmbed() const LeaveMsg = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour) .setColor(supportbot.EmbedColour)
.setThumbnail(member.user.avatarURL) .setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`) .setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`)
+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/")
} }
+1 -1
View File
@@ -1 +1 @@
{} {}
+27 -22
View File
@@ -5,21 +5,26 @@
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__| # /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
# \/ |__| |__| \/ # \/ |__| |__| \/
# #
# SupportBot v5.1.1 # 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"