Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82be317595 | ||
|
|
a43c76529f | ||
|
|
26065c2a5c | ||
|
|
6b1dfe01cf | ||
|
|
72443fb7c6 | ||
|
|
28cad23746 | ||
|
|
ebc0d4b137 | ||
|
|
4b198acda7 | ||
|
|
b84c3c75a5 |
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>
|
<h4 align="center">A Self Hosted discord application</h4>
|
||||||
|
|
||||||
<p align="center">
|
<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">
|
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=shield" alt="Discord Server">
|
||||||
</a>
|
</a>
|
||||||
<img src="https://img.shields.io/badge/Made%20with-NodeJS-blue.svg" alt="Made with NodeJS">
|
<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",
|
"category": "Tickets",
|
||||||
"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.",
|
||||||
"Ticket_Logs": "ticket-logs",
|
"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_React_Message": ":mailbox: React to create your support ticket.",
|
||||||
|
|
||||||
"Commands_Log_Title": "SupportBot Logs",
|
"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
|
# 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}`)
|
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()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ exports.run = async(bot, message, args) => {
|
|||||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Announcement_Channel}`)
|
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}**`)
|
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Announcement_Channel}**`)
|
||||||
|
|
||||||
ac.send(embed)
|
ac.send("@everyone").then((msg) => {
|
||||||
// ac.send("@everyone")
|
ac.send(embed);
|
||||||
|
});
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
||||||
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
|
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ bot.settings = require("../settings.json");
|
|||||||
exports.run = (bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
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()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
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 = "";
|
let userCommands = "";
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Link_Command}**: Get some important links!\n`;
|
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.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.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.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 = "";
|
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.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.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 = "";
|
let staffCommands = "";
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Announcement_Command} <message>**: Create a bot announcement\n`;
|
staffCommands += `**${bot.settings.prefix}${bot.settings.Announcement_Command} <message>**: Create a bot announcement\n`;
|
||||||
|
|||||||
+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}`)
|
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()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
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) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
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()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
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
|
||||||
|
}
|
||||||
+63
-11
@@ -48,12 +48,18 @@ exports.run = (bot, message, args) => {
|
|||||||
}).then(TicketChannel => {
|
}).then(TicketChannel => {
|
||||||
|
|
||||||
// Roles
|
// Roles
|
||||||
let support = message.guild.roles.find(supportRole => supportRole.name === `${bot.settings.support}`)
|
let staff = message.guild.roles.find(supportRole => supportRole.name === `${bot.settings.staff}`)
|
||||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === `@everyone`)
|
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
|
// Permissions
|
||||||
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
||||||
TicketChannel.overwritePermissions(support, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
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(message.author, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
TicketChannel.overwritePermissions(bot.user, { 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 )
|
// Ticket Message - ( Able to edit this message via the settings.json file )
|
||||||
const ticketMessage = `Hi! <@${message.author.id}>\n${bot.settings.Ticket_Message}`;
|
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()
|
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)
|
.setColor(bot.settings.colour)
|
||||||
.setFooter(bot.settings.footer)
|
.setFooter(bot.settings.footer)
|
||||||
TicketChannel.send({embed: TicketMessage});
|
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
if (subject != 'No Subject.') {
|
||||||
TicketChannel.setTopic(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
|
// Ticket Logging
|
||||||
const logEmbed = new Discord.RichEmbed()
|
const logEmbed = new Discord.RichEmbed()
|
||||||
.setTitle(":ticket: Logistics of your Ticket")
|
.setTitle(":ticket: Logistics of your Ticket")
|
||||||
@@ -123,9 +175,9 @@ exports.run = (bot, message, args) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
// Resource: SupportBot
|
// Resource: SupportBot
|
||||||
// Developed by Emerald Services
|
// Developed by Emerald Services
|
||||||
// Version: 4.0.1
|
// Version: 4.2.0
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
@@ -49,7 +49,7 @@ fs.readdir("./sb-addons/", (err, files) => {
|
|||||||
bot.on("ready", async () => {
|
bot.on("ready", async () => {
|
||||||
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
|
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
|
||||||
console.log(`\u001b[31m`, `------------[ 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`, `------------[ SupportBot ]------------`)
|
||||||
|
|
||||||
console.log(`\u001b[31m`, `\n\n------------[ SupportBot Stats ]------------`)
|
console.log(`\u001b[31m`, `\n\n------------[ SupportBot Stats ]------------`)
|
||||||
|
|||||||
Generated
+1
-49
@@ -1,53 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "SupportBot",
|
"name": "SupportBot",
|
||||||
"version": "4.0",
|
"version": "4.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"async-limiter": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
|
||||||
},
|
|
||||||
"discord.js": {
|
|
||||||
"version": "11.5.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.5.1.tgz",
|
|
||||||
"integrity": "sha512-tGhV5xaZXE3Z+4uXJb3hYM6gQ1NmnSxp9PClcsSAYFVRzH6AJH74040mO3afPDMWEAlj8XsoPXXTJHTxesqcGw==",
|
|
||||||
"requires": {
|
|
||||||
"long": "^4.0.0",
|
|
||||||
"prism-media": "^0.0.3",
|
|
||||||
"snekfetch": "^3.6.4",
|
|
||||||
"tweetnacl": "^1.0.0",
|
|
||||||
"ws": "^6.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"long": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
|
|
||||||
},
|
|
||||||
"prism-media": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-c9KkNifSMU/iXT8FFTaBwBMr+rdVcN+H/uNv1o+CuFeTThNZNTOrQ+RgXA1yL/DeLk098duAeRPP3QNPNbhxYQ=="
|
|
||||||
},
|
|
||||||
"snekfetch": {
|
|
||||||
"version": "3.6.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz",
|
|
||||||
"integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw=="
|
|
||||||
},
|
|
||||||
"tweetnacl": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A=="
|
|
||||||
},
|
|
||||||
"ws": {
|
|
||||||
"version": "6.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
|
|
||||||
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
|
|
||||||
"requires": {
|
|
||||||
"async-limiter": "~1.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+41
-16
@@ -1,35 +1,51 @@
|
|||||||
{
|
{
|
||||||
"SupportBot": "v4.0.1",
|
"SupportBot": "v4.2.0",
|
||||||
|
|
||||||
"token": "BOT_TOKEN_HERE",
|
"token": "BOT_TOKEN_HERE",
|
||||||
"prefix": "!d",
|
"prefix": "dev-",
|
||||||
"botname": "SupportBot",
|
"botname": "SupportBot",
|
||||||
"colour": "#13bd2a",
|
"colour": "#13bd2a",
|
||||||
"footer": "Support Bot, By Emerald Services",
|
"footer": "Support Bot, By Emerald Services",
|
||||||
|
|
||||||
"BotStatus": "Support Bot",
|
"BotStatus": "Support Bot",
|
||||||
|
|
||||||
"staff": "Staff",
|
"staff": "Staff",
|
||||||
"support": "Support",
|
|
||||||
"locked_role": "@everyone",
|
"locked_role": "@everyone",
|
||||||
"everyone": "@everyone",
|
"everyone": "@everyone",
|
||||||
"Auto_Role": "Member",
|
"Auto_Role": "Member",
|
||||||
|
|
||||||
"LINKS": {
|
"Department_Role_1": "Support",
|
||||||
"Discord": "https://discord.gg/",
|
"Department_Role_2": "Security",
|
||||||
"Twitter": "https://twitter.com/",
|
"Department_Role_3": "Sales",
|
||||||
"Website": "https://example.com/",
|
|
||||||
"AddMore": "AddMoreIfYouWant"
|
|
||||||
},
|
|
||||||
|
|
||||||
"LINKS_TITLE": "SupportBot Links",
|
|
||||||
|
|
||||||
"category": "Tickets",
|
"category": "Tickets",
|
||||||
"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.",
|
||||||
"Ticket_Logs": "ticket-logs",
|
"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_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",
|
"Commands_Log_Title": "SupportBot Logs",
|
||||||
"Command_Log_Channel": "command-logs",
|
"Command_Log_Channel": "command-logs",
|
||||||
|
|
||||||
@@ -56,6 +72,14 @@
|
|||||||
"Report_Channel": "reports",
|
"Report_Channel": "reports",
|
||||||
"Report_Title": "SupportBot Report",
|
"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",
|
"Announcement_Command": "announce",
|
||||||
"Say_Command": "say",
|
"Say_Command": "say",
|
||||||
@@ -72,5 +96,6 @@
|
|||||||
"Lockchat_Command": "lock",
|
"Lockchat_Command": "lock",
|
||||||
"UnLockchat_Command": "unlock",
|
"UnLockchat_Command": "unlock",
|
||||||
"Poll_Command": "poll",
|
"Poll_Command": "poll",
|
||||||
"Report_Command": "report"
|
"Report_Command": "report",
|
||||||
|
"Setup_Command": "setup"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user