Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82be317595 | ||
|
|
a43c76529f | ||
|
|
26065c2a5c | ||
|
|
6b1dfe01cf | ||
|
|
72443fb7c6 | ||
|
|
28cad23746 | ||
|
|
ebc0d4b137 | ||
|
|
4b198acda7 | ||
|
|
b84c3c75a5 | ||
|
|
de0ec97d9b |
No files matched your search
@@ -1,8 +1,8 @@
|
||||
<h1 align="center">SupportBot v4.0.0</h1>
|
||||
<h1 align="center">SupportBot v4.0.1</h1>
|
||||
<h4 align="center">A Self Hosted discord application</h4>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/hmWgxdF">
|
||||
<a href="https://discord.gg/hmWgxdF">
|
||||
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=shield" alt="Discord Server">
|
||||
</a>
|
||||
<img src="https://img.shields.io/badge/Made%20with-NodeJS-blue.svg" alt="Made with NodeJS">
|
||||
@@ -61,7 +61,7 @@ Once you have setup your discord application such as invited the bot and added y
|
||||
"category": "Tickets",
|
||||
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
|
||||
"Ticket_Logs": "ticket-logs",
|
||||
"bot.settings.Default_Ticket_Reason": "No Subject",
|
||||
"Default_Ticket_Reason": "No Subject",
|
||||
"Ticket_React_Message": ":mailbox: React to create your support ticket.",
|
||||
|
||||
"Commands_Log_Title": "SupportBot Logs",
|
||||
@@ -127,3 +127,9 @@ Once you have setup your discord application such as invited the bot and added y
|
||||
|
||||
# Donators List
|
||||
|
||||
# Community
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/hmWgxdF">
|
||||
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=banner1" alt="Discord Server">
|
||||
</a>
|
||||
</p>
|
||||
+3
-3
@@ -11,15 +11,15 @@ module.exports.run = async (bot, message, args) => {
|
||||
|
||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const bot = new Discord.Client()
|
||||
|
||||
bot.settings = require("../settings.json");
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
exports.run = async(bot, message, args) => {
|
||||
message.delete();
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
||||
@@ -31,8 +31,9 @@ exports.run = (bot, message, args) => {
|
||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Announcement_Channel}`)
|
||||
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Announcement_Channel}**`)
|
||||
|
||||
ac.send(embed)
|
||||
ac.send(`${bot.settings.Annuoncement_Tag_Role}`)
|
||||
ac.send("@everyone").then((msg) => {
|
||||
ac.send(embed);
|
||||
});
|
||||
|
||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
||||
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
|
||||
@@ -50,7 +51,7 @@ exports.run = (bot, message, args) => {
|
||||
.setColor(bot.settings.colour)
|
||||
.setFooter(bot.settings.footer)
|
||||
|
||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel === `${bot.settings.Command_Log_Channel}`);
|
||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
||||
|
||||
CommandLog.send(CMDLog);
|
||||
|
||||
@@ -9,15 +9,15 @@ bot.settings = require("../settings.json");
|
||||
exports.run = (bot, message, args) => {
|
||||
message.delete();
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.support}`)
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||
|
||||
|
||||
+4
-3
@@ -12,15 +12,16 @@ exports.run = (bot, message, args) => {
|
||||
let userCommands = "";
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Link_Command}**: Get some important links!\n`;
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ping_Command}**: Check the bots ping. Pong!\n`;
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ticket_Command} <reason>**: Create a support ticket\n`;
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ticket_Command} <reason>**: Create a support ticket\n`;
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Close_Command}**: Close your support ticket\n`;
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
|
||||
userCommands += `**${bot.settings.prefix}${bot.settings.Report_Command} <user> <reason>**: Create a server suggestion\n`;
|
||||
|
||||
let supportCommands = "";
|
||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Add_Command} <user>**: Adds a user to a ticket\n`;
|
||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Add_Command} <user>**: Adds a user to a ticket\n`;
|
||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Remove_Command} <user>**: Removes a user from a ticket\n`;
|
||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Forceclose_Command}**: Forceclose a support ticket\n`;
|
||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Rename_Command}**: Rename a support ticket\n`;
|
||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Rename_Command}**: Rename a support ticket\n`;
|
||||
|
||||
let staffCommands = "";
|
||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Announcement_Command} <message>**: Create a bot announcement\n`;
|
||||
|
||||
@@ -10,7 +10,7 @@ exports.run = async(bot, message, args) => {
|
||||
message.delete();
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
||||
let everyoneRole = message.guild.roles.find(everyone => everyone.name === `${bot.settings.everyone}`)
|
||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${bot.settings.locked_role}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
||||
@@ -22,7 +22,8 @@ exports.run = async(bot, message, args) => {
|
||||
.setColor(bot.settings.colour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||
|
||||
message.channel.overwritePermissions(everyoneRole, { 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 });
|
||||
|
||||
const lockmsg = new Discord.RichEmbed()
|
||||
.setDescription(":white_check_mark: **Chat Locked**")
|
||||
|
||||
+3
-3
@@ -11,15 +11,15 @@ module.exports.run = async (bot, message, args) => {
|
||||
|
||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||
|
||||
|
||||
+3
-3
@@ -9,15 +9,15 @@ bot.settings = require("../settings.json");
|
||||
exports.run = (bot, message, args) => {
|
||||
message.delete();
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
||||
.setColor(bot.settings.colour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client()
|
||||
bot.settings = require("../settings.json");
|
||||
|
||||
exports.run = async (bot, message, args) => {
|
||||
if (message.guild.owner === message.member) {
|
||||
message.delete(1000);
|
||||
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle("SupportBot Setup Mode")
|
||||
.setColor("#fff")
|
||||
.setDescription(`${bot.settings.botname} is about to enter **Setup Mode**.\nThis means that all the roles & channels that are\nrequired to allow supportbot to work will be created.`)
|
||||
.setFooter("Setup mode will expire in 60 seconds")
|
||||
message.channel.send(embed).then((msg) => {
|
||||
msg.react("✅");
|
||||
const filter = (reaction, user) => reaction.emoji.name === "✅" && user.id === message.author.id;
|
||||
msg.awaitReactions(filter, {
|
||||
max: 1,
|
||||
time: 60000,
|
||||
errors: ["time"]
|
||||
}).then(async (collected) => {
|
||||
msg.clearReactions();
|
||||
|
||||
const embed1 = new Discord.RichEmbed()
|
||||
.setTitle("SupportBot Setup Mode")
|
||||
.setColor("#fff")
|
||||
.setDescription(`${bot.settings.botname} has activated **Setup Mode**\nPlease allow a couple minutes for the process to be complete.`)
|
||||
msg.edit(embed1).then((m) => {
|
||||
m.delete(5000);
|
||||
m.edit(":white_check_mark: **Success!** You\'r server is ready, thanks for using SupportBot by Emerald Services.");
|
||||
});
|
||||
const reaction = collected.first();
|
||||
if (reaction.emoji.name === "✅") {
|
||||
// Roles
|
||||
let supportRole = bot.settings.support;
|
||||
let staffRole = bot.settings.staff;
|
||||
let autoRole = bot.settings.Auto_Role;
|
||||
let Department_Role_1 = bot.settings.Department_Role_1
|
||||
let Department_Role_2 = bot.settings.Department_Role_2
|
||||
let Department_Role_3 = bot.settings.Department_Role_3
|
||||
|
||||
|
||||
// Channels & Categories
|
||||
let generalCategory = bot.settings.General_Category;
|
||||
let informationCategory = bot.settings.InformationCategory;
|
||||
let ticketCategory = bot.settings.category;
|
||||
let staffCategory = bot.settings.StaffCategory;
|
||||
let accessChannel = bot.settings.Access_Channel;
|
||||
let announceChannel = bot.settings.Announcement_Channel;
|
||||
let suggestChannel = bot.settings.Suggestion_Channel;
|
||||
let reportsChannel = bot.settings.Report_Channel;
|
||||
let ticketsChannel = bot.settings.Tickets_Channel;
|
||||
let ticketsVoice1 = bot.settings.TicketsVoice1;
|
||||
let ticketsVoice2 = bot.settings.TicketsVoice2;
|
||||
let generalChannel = bot.settings.GeneralChannel;
|
||||
let pollsChannel = bot.settings.Poll_Channel;
|
||||
let botSpam = bot.settings.BotSpam_Channel;
|
||||
let staffGeneral = bot.settings.StaffChat;
|
||||
let staffCommands = bot.settings.StaffCmds;
|
||||
let staffVoice = bot.settings.StaffVoice;
|
||||
let ticketLogs = bot.settings.Ticket_Logs;
|
||||
let commandLogs = bot.settings.Command_Log_Channel;
|
||||
|
||||
// Information Category
|
||||
await message.guild.createChannel(`${informationCategory}`, {
|
||||
type: "category",
|
||||
position: 1
|
||||
}).then(async (cat) => {
|
||||
await message.guild.createChannel(`${accessChannel}`, {
|
||||
type: "text",
|
||||
position: 1,
|
||||
topic: `${bot.settings.Access_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${announceChannel}`, {
|
||||
type: "text",
|
||||
position: 2,
|
||||
topic: `${bot.settings.Announcement_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${pollsChannel}`, {
|
||||
type: "text",
|
||||
position: 3,
|
||||
topic: `${bot.settings.Poll_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${suggestChannel}`, {
|
||||
type: "text",
|
||||
position: 4,
|
||||
topic: `${bot.settings.Suggestion_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${reportsChannel}`, {
|
||||
type: "text",
|
||||
position: 5,
|
||||
topic: `${bot.settings.Report_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
});
|
||||
// General Category
|
||||
await message.guild.createChannel(`${generalCategory}`, {
|
||||
type: "category",
|
||||
position: 2
|
||||
}).then(async (cat) => {
|
||||
await message.guild.createChannel(`${generalChannel}`, {
|
||||
type: "text",
|
||||
position: 1,
|
||||
topic: `${bot.settings.GeneralTopic}`,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${botSpam}`, {
|
||||
type: "text",
|
||||
position: 2,
|
||||
topic: `${bot.settings.BotSpam_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
});
|
||||
// Support Category
|
||||
await message.guild.createChannel(`${ticketCategory}`, {
|
||||
type: "category",
|
||||
position: 3
|
||||
}).then(async (cat) => {
|
||||
await message.guild.createChannel(`${ticketsChannel}`, {
|
||||
type: "text",
|
||||
position: 1,
|
||||
topic: `${bot.settings.Tickets_Topic}`,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${ticketsVoice1}`, {
|
||||
type: "voice",
|
||||
position: 2,
|
||||
parent: cat,
|
||||
userLimit: 2,
|
||||
speakable: true,
|
||||
joineable: true
|
||||
});
|
||||
await message.guild.createChannel(`${ticketsVoice2}`, {
|
||||
type: "voice",
|
||||
position: 3,
|
||||
parent: cat,
|
||||
userLimit: 2,
|
||||
speakable: true,
|
||||
joineable: true
|
||||
});
|
||||
});
|
||||
// Staff Category (Private)
|
||||
await message.guild.createChannel(`${staffCategory}`, {
|
||||
type: "category",
|
||||
position: 4
|
||||
}).then(async (cat) => {
|
||||
await message.guild.createChannel(`${staffGeneral}`, {
|
||||
type: "text",
|
||||
position: 1,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${staffCommands}`, {
|
||||
type: "text",
|
||||
position: 2,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${staffVoice}`, {
|
||||
type: "voice",
|
||||
position: 3,
|
||||
parent: cat,
|
||||
joineable: true,
|
||||
speakable: true
|
||||
});
|
||||
await message.guild.createChannel(`${ticketLogs}`, {
|
||||
type: "text",
|
||||
position: 4,
|
||||
parent: cat
|
||||
});
|
||||
await message.guild.createChannel(`${commandLogs}`, {
|
||||
type: "text",
|
||||
position: 5,
|
||||
parent: cat
|
||||
});
|
||||
|
||||
await message.guild.createRole({
|
||||
name: `${staffRole}`,
|
||||
color: "#ff0000",
|
||||
position: 1,
|
||||
permissions: {
|
||||
"MANAGE_CHANNELS": true,
|
||||
"MANAGE_GUILD": true,
|
||||
"MENTION_EVERYONE": true,
|
||||
"CREATE_INSTANT_INVITE": true,
|
||||
"KICK_MEMBERS": true,
|
||||
"VIEW_AUDIT_LOG": true,
|
||||
"MANAGE_NICKNAMES": true,
|
||||
"CONNECT": true,
|
||||
"SPEAK": true,
|
||||
"USE_EXTERNAL_EMOJIS": true,
|
||||
"MANAGE_MESSAGES": true,
|
||||
"PRIORITY_SPEAKER": true
|
||||
},
|
||||
mentionable: true
|
||||
});
|
||||
await message.guild.createRole({
|
||||
name: `${autoRole}`,
|
||||
color: "#ffffff",
|
||||
position: 2,
|
||||
permissions: {
|
||||
"MANAGE_CHANNELS": false,
|
||||
"MANAGE_GUILD": false,
|
||||
"MENTION_EVERYONE": false,
|
||||
"CREATE_INSTANT_INVITE": true,
|
||||
"KICK_MEMBERS": false,
|
||||
"VIEW_AUDIT_LOG": false,
|
||||
"MANAGE_NICKNAMES": false,
|
||||
"CONNECT": true,
|
||||
"SPEAK": true,
|
||||
"USE_EXTERNAL_EMOJIS": true,
|
||||
"MANAGE_MESSAGES": false,
|
||||
"PRIORITY_SPEAKER": false
|
||||
},
|
||||
mentionable: false
|
||||
});
|
||||
await message.guild.createRole({
|
||||
name: `${Department_Role_1}`,
|
||||
color: "#ffffff",
|
||||
position: 2,
|
||||
permissions: {
|
||||
"MANAGE_CHANNELS": false,
|
||||
"MANAGE_GUILD": false,
|
||||
"MENTION_EVERYONE": false,
|
||||
"CREATE_INSTANT_INVITE": true,
|
||||
"KICK_MEMBERS": true,
|
||||
"VIEW_AUDIT_LOG": true,
|
||||
"MANAGE_NICKNAMES": true,
|
||||
"CONNECT": true,
|
||||
"SPEAK": true,
|
||||
"USE_EXTERNAL_EMOJIS": true,
|
||||
"MANAGE_MESSAGES": true,
|
||||
"PRIORITY_SPEAKER": true
|
||||
},
|
||||
mentionable: false
|
||||
});
|
||||
await message.guild.createRole({
|
||||
name: `${Department_Role_2}`,
|
||||
color: "#ffffff",
|
||||
position: 2,
|
||||
permissions: {
|
||||
"MANAGE_CHANNELS": false,
|
||||
"MANAGE_GUILD": false,
|
||||
"MENTION_EVERYONE": false,
|
||||
"CREATE_INSTANT_INVITE": true,
|
||||
"KICK_MEMBERS": true,
|
||||
"VIEW_AUDIT_LOG": true,
|
||||
"MANAGE_NICKNAMES": true,
|
||||
"CONNECT": true,
|
||||
"SPEAK": true,
|
||||
"USE_EXTERNAL_EMOJIS": true,
|
||||
"MANAGE_MESSAGES": true,
|
||||
"PRIORITY_SPEAKER": true
|
||||
},
|
||||
mentionable: false
|
||||
});
|
||||
await message.guild.createRole({
|
||||
name: `${Department_Role_3}`,
|
||||
color: "#ffffff",
|
||||
position: 2,
|
||||
permissions: {
|
||||
"MANAGE_CHANNELS": false,
|
||||
"MANAGE_GUILD": false,
|
||||
"MENTION_EVERYONE": false,
|
||||
"CREATE_INSTANT_INVITE": true,
|
||||
"KICK_MEMBERS": true,
|
||||
"VIEW_AUDIT_LOG": true,
|
||||
"MANAGE_NICKNAMES": true,
|
||||
"CONNECT": true,
|
||||
"SPEAK": true,
|
||||
"USE_EXTERNAL_EMOJIS": true,
|
||||
"MANAGE_MESSAGES": true,
|
||||
"PRIORITY_SPEAKER": true
|
||||
},
|
||||
mentionable: false
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
message.channel.send(":x: **Error:** You don't have permissions to use this command.").then((msg) => {
|
||||
msg.delete(5000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: bot.settings.Setup_Command
|
||||
}
|
||||
+62
-10
@@ -48,11 +48,17 @@ exports.run = (bot, message, args) => {
|
||||
}).then(TicketChannel => {
|
||||
|
||||
// Roles
|
||||
let staff = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.support}`)
|
||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === `@everyone`)
|
||||
let staff = message.guild.roles.find(supportRole => supportRole.name === `${bot.settings.staff}`)
|
||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
|
||||
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_1}`)
|
||||
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_2}`)
|
||||
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_3}`)
|
||||
|
||||
// Permissions
|
||||
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
||||
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
||||
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
||||
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
@@ -75,16 +81,62 @@ exports.run = (bot, message, args) => {
|
||||
// Ticket Message - ( Able to edit this message via the settings.json file )
|
||||
const ticketMessage = `Hi! <@${message.author.id}>\n${bot.settings.Ticket_Message}`;
|
||||
|
||||
const Department_1 = bot.settings.Ticket_Department_1;
|
||||
const Department_2 = bot.settings.Ticket_Department_2;
|
||||
const Department_3 = bot.settings.Ticket_Department_3;
|
||||
|
||||
const Emoji_1 = bot.settings.Ticket_Department_Emoji_1;
|
||||
const Emoji_2 = bot.settings.Ticket_Department_Emoji_2;
|
||||
const Emoji_3 = bot.settings.Ticket_Department_Emoji_3;
|
||||
|
||||
const TicketMessage = new Discord.RichEmbed()
|
||||
.setDescription(ticketMessage)
|
||||
.setDescription(ticketMessage, true)
|
||||
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
|
||||
.setColor(bot.settings.colour)
|
||||
.setFooter(bot.settings.footer)
|
||||
TicketChannel.send({embed: TicketMessage});
|
||||
|
||||
if (subject != 'No Subject.') {
|
||||
TicketChannel.setTopic(subject);
|
||||
}
|
||||
|
||||
if (subject != 'No Subject.') {
|
||||
TicketChannel.setTopic(subject);
|
||||
}
|
||||
|
||||
|
||||
TicketChannel.send({embed: TicketMessage}).then(function(msg) {
|
||||
|
||||
msg.react(Emoji_1).then(() => msg.react(Emoji_2)).then(() => msg.react(Emoji_3));
|
||||
|
||||
const filter = (reaction, user) => {
|
||||
return [Emoji_1, Emoji_2, Emoji_3].includes(reaction.emoji.name) && user.id !== msg.author.id;
|
||||
};
|
||||
|
||||
msg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
|
||||
.then(collected => {
|
||||
const reaction = collected.first();
|
||||
|
||||
if (reaction.emoji.name === `${Emoji_1}`) {
|
||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
|
||||
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for somone to reach out to you.")
|
||||
}
|
||||
|
||||
if (reaction.emoji.name === `${Emoji_2}`) {
|
||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
|
||||
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for somone to reach out to you.")
|
||||
}
|
||||
|
||||
if (reaction.emoji.name === `${Emoji_3}`) {
|
||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||
|
||||
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for somone to reach out to you.")
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Ticket Logging
|
||||
const logEmbed = new Discord.RichEmbed()
|
||||
.setTitle(":ticket: Logistics of your Ticket")
|
||||
@@ -123,9 +175,9 @@ exports.run = (bot, message, args) => {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ exports.run = async(bot, message, args) => {
|
||||
message.delete();
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
||||
let everyoneRole = message.guild.roles.find(everyone => everyone.name === `${bot.settings.everyone}`)
|
||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${bot.settings.locked_role}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
||||
@@ -22,8 +22,8 @@ exports.run = async(bot, message, args) => {
|
||||
.setColor(bot.settings.colour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||
|
||||
message.channel.overwritePermissions(everyoneRole, { 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 });
|
||||
const lockmsg = new Discord.RichEmbed()
|
||||
.setDescription(":white_check_mark: **Chat Un-Locked**")
|
||||
.setColor(bot.settings.colour)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
// Resource: SupportBot
|
||||
// Developed by Emerald Services
|
||||
// Version: 4.0.0
|
||||
// Version: 4.2.0
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
@@ -48,9 +48,8 @@ fs.readdir("./sb-addons/", (err, files) => {
|
||||
|
||||
bot.on("ready", async () => {
|
||||
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
|
||||
console.log(`\x1b[36m`, `=== [SupportBot] ===\n\nSupportBot - Created by Emerald Services\nInvite ${bot.user.username} to your server\nhttps://discordapp.com/api/oauth2/authorize?client_id=${bot.user.id}&permissions=8&scope=bot\n\n=== [SupportBot] ===`)
|
||||
console.log(`\u001b[31m`, `------------[ SupportBot ]------------`)
|
||||
console.log(`\u001b[32m`, `Thank you for using SupportBot\n If you have any issues\n contact our team and we will\n give you furthur instructions`)
|
||||
console.log(`\u001b[32m`, `Thank you for using SupportBot\n If you have any issues\n contact our team and we will\n give you furthur instructions\nContact us on discord if you require any support discord.gg/SPKDBX9`)
|
||||
console.log(`\u001b[31m`, `------------[ SupportBot ]------------`)
|
||||
|
||||
console.log(`\u001b[31m`, `\n\n------------[ SupportBot Stats ]------------`)
|
||||
|
||||
Generated
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "SupportBot",
|
||||
"version": "4.0",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
+1
-1
@@ -13,8 +13,8 @@
|
||||
"npm": "6.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"discord.js": "^11.5.1",
|
||||
"array-sort": "^1.0.0",
|
||||
"discord.js": "^11.5.1",
|
||||
"table": "^5.4.4"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
+42
-16
@@ -1,34 +1,51 @@
|
||||
{
|
||||
"SupportBot": "v4.0.0",
|
||||
|
||||
"SupportBot": "v4.2.0",
|
||||
|
||||
"token": "BOT_TOKEN_HERE",
|
||||
"prefix": "!",
|
||||
"prefix": "dev-",
|
||||
"botname": "SupportBot",
|
||||
"colour": "#13bd2a",
|
||||
"footer": "Support Bot, By Emerald Services",
|
||||
|
||||
"BotStatus": "Support Bot",
|
||||
|
||||
"staff": "Staff",
|
||||
"support": "Support",
|
||||
|
||||
"locked_role": "@everyone",
|
||||
"everyone": "@everyone",
|
||||
"Auto_Role": "Member",
|
||||
|
||||
"LINKS": {
|
||||
"Discord": "https://discord.gg/",
|
||||
"Twitter": "https://twitter.com/",
|
||||
"Website": "https://example.com/",
|
||||
"AddMore": "AddMoreIfYouWant"
|
||||
},
|
||||
|
||||
"LINKS_TITLE": "SupportBot Links",
|
||||
|
||||
"Department_Role_1": "Support",
|
||||
"Department_Role_2": "Security",
|
||||
"Department_Role_3": "Sales",
|
||||
|
||||
"category": "Tickets",
|
||||
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
|
||||
"Ticket_Logs": "ticket-logs",
|
||||
"bot.settings.Default_Ticket_Reason": "No Subject",
|
||||
"Default_Ticket_Reason": "No Subject",
|
||||
"Ticket_React_Message": ":mailbox: React to create your support ticket.",
|
||||
|
||||
"Ticket_Department_1": "Support",
|
||||
"Ticket_Department_2": "Security",
|
||||
"Ticket_Department_3": "Sales",
|
||||
|
||||
"Ticket_Department_Emoji_1": "🎧",
|
||||
"Ticket_Department_Emoji_2": "🔐",
|
||||
"Ticket_Department_Emoji_3": "💵",
|
||||
|
||||
"General_Category": "General",
|
||||
"InformationCategory": "Information",
|
||||
"StaffCategory": "Staff",
|
||||
|
||||
"Access_Channel": "welcome",
|
||||
"GeneralChannel": "general",
|
||||
"BotSpam_Channel": "bot-spam",
|
||||
"Tickets_Channel": "open-a-ticket",
|
||||
"StaffChat": "staff-chat",
|
||||
"StaffCmds": "staff-commands",
|
||||
"StaffVoice": "Staff Room",
|
||||
"TicketsVoice1": "Support Lounge",
|
||||
"TicketsVoice2": "Support Lounge",
|
||||
|
||||
"Commands_Log_Title": "SupportBot Logs",
|
||||
"Command_Log_Channel": "command-logs",
|
||||
|
||||
@@ -55,6 +72,14 @@
|
||||
"Report_Channel": "reports",
|
||||
"Report_Title": "SupportBot Report",
|
||||
|
||||
"LINKS_TITLE": "SupportBot Links",
|
||||
|
||||
"LINKS": {
|
||||
"Discord": "https://discord.gg/",
|
||||
"Twitter": "https://twitter.com/",
|
||||
"Website": "https://example.com/",
|
||||
"AddMore": "AddMoreIfYouWant"
|
||||
},
|
||||
|
||||
"Announcement_Command": "announce",
|
||||
"Say_Command": "say",
|
||||
@@ -71,5 +96,6 @@
|
||||
"Lockchat_Command": "lock",
|
||||
"UnLockchat_Command": "unlock",
|
||||
"Poll_Command": "poll",
|
||||
"Report_Command": "report"
|
||||
"Report_Command": "report",
|
||||
"Setup_Command": "setup"
|
||||
}
|
||||
Reference in new issue
Block a user