Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87b9301e20 | ||
|
|
d0a6bed727 | ||
|
|
29881fbf28 | ||
|
|
4f05ad6546 | ||
|
|
36fc9aae6c | ||
|
|
fb3f87c685 | ||
|
|
a4c0eeb9b3 | ||
|
|
c64f249fd0 | ||
|
|
48b542293f | ||
|
|
95e92970c9 | ||
|
|
afdb16da07 | ||
|
|
0a230cfab9 | ||
|
|
c752a07ad0 | ||
|
|
cc5a6b7317 | ||
|
|
d93991ad86 | ||
|
|
5c98376a8c | ||
|
|
28699f0ff0 | ||
|
|
e3576b17b1 | ||
|
|
17c49b2b03 | ||
|
|
dcc00d8d1f | ||
|
|
05a772eee2 | ||
|
|
59dd291dc6 | ||
|
|
f0a791e354 | ||
|
|
94db6cff7b | ||
|
|
72a02bf6d2 | ||
|
|
cf99209887 | ||
|
|
ff7ed49905 | ||
|
|
ecd17a51df | ||
|
|
63b08f8c12 | ||
|
|
3077772aff | ||
|
|
f40aa9ed14 | ||
|
|
4ae6dc3a69 | ||
|
|
bdb8389d8d | ||
|
|
f7254c7ec7 | ||
|
|
3701156362 | ||
|
|
575d25f5ad | ||
|
|
698b82c7d3 | ||
|
|
eaa9da6d2e | ||
|
|
ca7294a0e3 | ||
|
|
5281ffce60 | ||
|
|
2f84fd3b33 | ||
|
|
bef270da74 | ||
|
|
bdf839ffca | ||
|
|
b1b2ead0d8 | ||
|
|
0b74473c64 | ||
|
|
2fb189cf5c | ||
|
|
24a29639e9 | ||
|
|
50258dc359 | ||
|
|
d9c6b7698f | ||
|
|
f042f34ae2 | ||
|
|
c087edc14f | ||
|
|
d96ccc3265 | ||
|
|
018ef19efd | ||
|
|
159317a15a | ||
|
|
34583c96bf | ||
|
|
887d3d3ab4 | ||
|
|
f2de39de33 | ||
|
|
8173c31a60 | ||
|
|
80a2871741 | ||
|
|
3b37e9c420 | ||
|
|
730ba561bc | ||
|
|
4d7ddc9d6f | ||
|
|
680f71a602 | ||
|
|
170a7b50b9 | ||
|
|
805c48c1bb | ||
|
|
7d92ed51bb | ||
|
|
f849897f29 | ||
|
|
75e0f1ad1e | ||
|
|
2f015aff2b | ||
|
|
bb322adb2f | ||
|
|
6ee0981885 | ||
|
|
877fb0f201 | ||
|
|
ded4b9094a | ||
|
|
36ab931998 | ||
|
|
20baddfcca | ||
|
|
d180c147db | ||
|
|
86fa91cc52 | ||
|
|
b8c12a0307 | ||
|
|
eff2f9c195 | ||
|
|
8a8597afef | ||
|
|
067e619488 | ||
|
|
f7f8bc8c55 | ||
|
|
0c71fd7e59 | ||
|
|
5b2bd21c06 | ||
|
|
9ac68f68e2 | ||
|
|
aa32f00b0d | ||
|
|
bd5f5dffad | ||
|
|
645ad63f4f | ||
|
|
c83c6afecc | ||
|
|
689a191d4c | ||
|
|
5767ba0de5 | ||
|
|
cdf78f2598 | ||
|
|
d23f46ad9e | ||
|
|
8453fa5007 | ||
|
|
0bd990a9e3 | ||
|
|
9c8ee1471b | ||
|
|
87262e82a3 | ||
|
|
953db88ed2 | ||
|
|
a44bb949eb | ||
|
|
9d11369059 | ||
|
|
8c92f39349 | ||
|
|
bce9d733d3 | ||
|
|
525c216401 | ||
|
|
c145e9f11d | ||
|
|
53700003f1 | ||
|
|
03094a4c35 | ||
|
|
934ebed24f |
No files matched your search
@@ -1,2 +0,0 @@
|
|||||||
# Auto detect text files and perform LF normalization
|
|
||||||
* text=auto
|
|
||||||
-76
@@ -1,76 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
|
||||||
.cache
|
|
||||||
|
|
||||||
# next.js build output
|
|
||||||
.next
|
|
||||||
|
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Emerald Services
|
Copyright (c) 2020 ItzEmerald
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
<h1 align="center">SupportBot</h1>
|
```
|
||||||
<p align="center">Created by Emerald Services</p>
|
_________ __ __________ __
|
||||||
<h4 align="center">Our documentation is currently being rewritten, This will be updated once we push the next update (5.1). If you require our assitance please contact us in discord. https://discord.gg/bXjdkr8</h4>
|
/ _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
||||||
|
\_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
||||||
|
/ \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
||||||
|
/_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||||
|
\/ |__| |__| \/
|
||||||
|
|
||||||
|
SupportBot version 6.0
|
||||||
|
Created by Emerald Services
|
||||||
|
|
||||||
|
The #1 self-hosted discord ticket bot
|
||||||
|
```
|
||||||
|
|
||||||
|
## SUPPORTBOT SUPPORTED VERSIONS
|
||||||
|
|
||||||
|
| SupportBot | Status | Supported |
|
||||||
|
|------------|-----------|--------------|
|
||||||
|
| 1.x | ❌ | Discontinued |
|
||||||
|
| 2.x | ❌ | Discontinued |
|
||||||
|
| 3.x | ❌ | Discontinued |
|
||||||
|
| 4.x | ✔️ | Previous |
|
||||||
|
| 5.x | ✔️ | Current |
|
||||||
|
| 6.x | ⚠️ | Under Development |
|
||||||
@@ -1 +0,0 @@
|
|||||||
theme: jekyll-theme-cayman
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Help Command
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
// location for the addons configuration, to keep it simple we generate a settings folder within the addons directory.
|
||||||
|
const example = yaml.load(fs.readFileSync('./addons/settings/exampleaddon.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: example.ExampleAddonCommand,
|
||||||
|
description: example.ExampleAddonDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
message.channel.send(example.ExampleAddonMessage)
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# SupportBot 6.0
|
||||||
|
# Example Addon
|
||||||
|
#
|
||||||
|
|
||||||
|
ExampleAddonCommand: "exampleaddon"
|
||||||
|
ExampleAddonDesc: "This is the default/example addon for SupportBot."
|
||||||
|
|
||||||
|
ExampleAddonMessage: "> :white_check_mark: This is the **default** addon for SupportBot. You can download addons from our website, https://emeraldservices.xyz/"
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Add
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
const fs = require("fs")
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
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});
|
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
|
||||||
|
|
||||||
const cantfinduser = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
|
||||||
|
|
||||||
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
|
||||||
|
|
||||||
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: true, SEND_MESSAGES: true });
|
|
||||||
|
|
||||||
const useradded = new Discord.RichEmbed()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setTitle("User Added")
|
|
||||||
.setDescription(`👍 ${rUser} has been added to this ticket`)
|
|
||||||
.setTimestamp();
|
|
||||||
message.channel.send({embed: useradded});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Add_Command,
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Add User
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: supportbot.AddUser,
|
||||||
|
description: supportbot.AddUserDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.AddUser}!`);
|
||||||
|
|
||||||
|
let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff)
|
||||||
|
let Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin)
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``)
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
|
||||||
|
if (message.member.roles.cache.has(SupportStaff.id) || message.member.roles.cache.has(Admins.id)) {
|
||||||
|
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(`${supportbot.NoValidTicket}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
message.channel.send({ embed: Exists });
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(`${supportbot.UserNotFound}\n\nTry Again:\`${supportbot.Prefix}${supportbot.AddUser} <user#0000>\``)
|
||||||
|
.setColor(supportbot.ErrorColour)
|
||||||
|
|
||||||
|
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
||||||
|
|
||||||
|
message.channel.updateOverwrite(rUser, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
CREATE_INVITE: false,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
READ_MESSAGES: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Added!")
|
||||||
|
.setDescription(supportbot.AddedUser.replace(/%user%/g, rUser.id))
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: Complete });
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return message.channel.send({ embed: NoPerms });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
+60
-46
@@ -1,54 +1,68 @@
|
|||||||
// SupportBot
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
// Created by © 2020 Emerald Services
|
// Links Command
|
||||||
// Command: Announce (including @everyone)
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client();
|
const fs = require("fs");
|
||||||
|
|
||||||
const fs = require("fs")
|
|
||||||
const yaml = require('js-yaml');
|
const yaml = require('js-yaml');
|
||||||
|
const { execute } = require("./help");
|
||||||
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) => {
|
module.exports = {
|
||||||
message.delete();
|
name: supportbot.AnnounceCommand,
|
||||||
|
description: supportbot.AnnounceDesc,
|
||||||
|
|
||||||
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}`);
|
execute(message, args) {
|
||||||
|
|
||||||
|
let locateChannel = message.guild.channels.cache.find(AnnouncementChannel => AnnouncementChannel.name === supportbot.AnnouncementChannel);
|
||||||
|
|
||||||
|
const errornochannel = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Channel")
|
||||||
|
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.AnnouncementChannel}`)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
||||||
|
|
||||||
|
let Admins = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${Admins.name}\``)
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
|
||||||
|
if (!message.member.roles.cache.has(Admins.id))
|
||||||
|
return message.channel.send({ embed: NoPerms });
|
||||||
|
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`> **${supportbot.AnnouncementStarter}**`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: embed });
|
||||||
|
|
||||||
|
let announcement = []
|
||||||
|
message.channel.awaitMessages(response => response.content.length > 2, {
|
||||||
|
max: 1,
|
||||||
|
time: 500000,
|
||||||
|
errors: ['time'],
|
||||||
|
}).then((collected) => {
|
||||||
|
announcement.push(collected.map(r => r.content));
|
||||||
|
|
||||||
|
const AnnouncementEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.AnnouncementTitle)
|
||||||
|
.setThumbnail(supportbot.AnnouncementIcon)
|
||||||
|
.setDescription(announcement)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL());
|
||||||
|
|
||||||
|
locateChannel.send({ embed: AnnouncementEmbed }).then(async function(msg) {
|
||||||
|
const AnnouncementComplete = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.SuccessColour)
|
||||||
|
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${locateChannel.id}>`)
|
||||||
|
message.channel.send({ embed: AnnouncementComplete })
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
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()
|
|
||||||
.setTitle(`${supportbot.Announcement_Title}`)
|
|
||||||
.setDescription(args.join(" "))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.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) => {
|
|
||||||
ac.send(embed);
|
|
||||||
});
|
|
||||||
|
|
||||||
const AccSuccessEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle("Announcement Created")
|
|
||||||
.setDescription(`👍 Successfully sent your announcement to <#${ac.id}>`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({embed: AccSuccessEmbed});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Announcement_Command,
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Say Command
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const { execute } = require("./help");
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: supportbot.BotSay,
|
||||||
|
description: supportbot.BotSayDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
|
||||||
|
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
|
||||||
|
if (!message.member.roles.cache.has(SupportStaff.id))
|
||||||
|
return message.channel.send({ embed: NoPerms });
|
||||||
|
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`> **What would you like me to say!**`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: embed });
|
||||||
|
|
||||||
|
let announcement = []
|
||||||
|
message.channel.awaitMessages(response => response.content.length > 2, {
|
||||||
|
max: 1,
|
||||||
|
time: 500000,
|
||||||
|
errors: ['time'],
|
||||||
|
}).then((collected) => {
|
||||||
|
announcement.push(collected.map(r => r.content));
|
||||||
|
|
||||||
|
const AnnouncementEmbed = new Discord.MessageEmbed()
|
||||||
|
.setDescription(announcement)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
message.channel.send({ embed: AnnouncementEmbed })
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
+107
-74
@@ -1,71 +1,66 @@
|
|||||||
// SupportBot
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
// Created by © 2020 Emerald Services
|
// Links Command
|
||||||
// Command: Close
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const { execute } = require("./help");
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
/**
|
module.exports = {
|
||||||
* @param {Discord.Message} message
|
name: supportbot.CloseTicket,
|
||||||
*/
|
description: supportbot.CloseTicketDesc,
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
execute(message, args) {
|
||||||
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.CloseTicket}!`);
|
||||||
|
|
||||||
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.TicketChannel}-` )) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(`${supportbot.NoValidTicket}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
message.channel.send({ embed: Exists });
|
||||||
|
|
||||||
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
|
return;
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
|
|
||||||
message.channel.send(embed);
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const closeRequestEmbed = new Discord.RichEmbed()
|
if (supportbot.CloseConfirmation === "true") {
|
||||||
.setDescription(`**${supportbot.Ticket_Closure}**`)
|
const CloseTicketRequest = new Discord.MessageEmbed()
|
||||||
.addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
|
.setTitle(`**${supportbot.ClosingTicket}**`)
|
||||||
.setFooter("Your request will be avoided in 20 seconds")
|
.setDescription(`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `)
|
||||||
.setColor(supportbot.EmbedColour)
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
|
message.channel.send(CloseTicketRequest).then(m => {
|
||||||
|
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.ClosingConfirmation_Word, {
|
||||||
|
max: 1,
|
||||||
|
time: 20000,
|
||||||
|
errors: [ 'time' ],
|
||||||
|
|
||||||
message.channel.send(closeRequestEmbed).then( m => {
|
|
||||||
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.Closure_Confirm_Word, {
|
}).then( collected => {
|
||||||
max: 1,
|
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog);
|
||||||
time: 20000,
|
let user = message.author;
|
||||||
errors: [ 'time' ],
|
let reason = args.join(" ") || "No Reason Provided.";
|
||||||
|
|
||||||
} ).then( collected => {
|
let name = message.channel.name;
|
||||||
let logChannel = message.guild.channels.find( channel => channel.name === supportbot.Transcript_Logs );
|
let ticketChannel = message.channel;
|
||||||
|
|
||||||
let user = message.author;
|
message.channel.send(`**${supportbot.ClosingTicket}**`)
|
||||||
|
|
||||||
let reason = args.join(" ") || "No reason provided.";
|
.then(() => {
|
||||||
|
const logEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TranscriptTitle)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
.addField("Closed By", message.author.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
|
||||||
let name = message.channel.name;
|
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
||||||
let ticketChannel = message.channel;
|
|
||||||
|
|
||||||
message.channel.send(`**${supportbot.Ticket_Closing}**`)
|
|
||||||
.then( () => {
|
|
||||||
const logEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle(supportbot.Transcript_Title)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Ticket Author", user)
|
|
||||||
.addField("Closed By", message.author.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
message.channel.fetchMessages({ limit: 100 })
|
|
||||||
.then( msgs => {
|
|
||||||
let txt = '';
|
let txt = '';
|
||||||
|
|
||||||
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
||||||
|
|
||||||
txt += `${message.guild.name}\n`;
|
txt += `${message.guild.name}\n`;
|
||||||
txt += `#${ticketChannel.name}\n`;
|
txt += `#${ticketChannel.name}\n`;
|
||||||
txt += `${msgs.size} messages\n\n\n`;
|
txt += `${msgs.size} messages\n\n\n`;
|
||||||
@@ -76,39 +71,77 @@ exports.run = (bot, message, args) => {
|
|||||||
txt += `${msg.content}\n`;
|
txt += `${msg.content}\n`;
|
||||||
txt += `-----\n\n`;
|
txt += `-----\n\n`;
|
||||||
}
|
}
|
||||||
} );
|
});
|
||||||
|
|
||||||
// message.author.send( `A transcript has been generated for the ticket you closed.` );
|
logChannel.send(logEmbed).catch(err => {
|
||||||
// message.author.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
message.reply(err)
|
||||||
|
})
|
||||||
logChannel.send(logEmbed)
|
|
||||||
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 } )
|
})
|
||||||
|
})
|
||||||
|
|
||||||
// .then( msg => {
|
|
||||||
// const merged = msgs.concat( msg );
|
|
||||||
// const output = merged.reduce( ( out, msg ) => {
|
|
||||||
// out += `[${message.createdAt}] ${message.author.tag}: ${message.cleanContent ? message.cleanContent.replace( /\n/g, '\r\n' ) : ''}\r\n`;
|
|
||||||
// return out;
|
|
||||||
// }, '' );
|
|
||||||
|
|
||||||
// log.send( { files: [ { attachment: Buffer.from( output, 'utf8' ), name: `${name}.txt` } ] } ).then( c.delete() ).catch( console.error ); // sends the file to logs
|
|
||||||
// return log.send( embed1 ).catch( console.error );
|
|
||||||
// } )
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}).catch( () => {
|
}).catch( () => {
|
||||||
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (supportbot.CloseConfirmation === "false") {
|
||||||
|
|
||||||
exports.help = {
|
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog);
|
||||||
name: supportbot.Close_Command,
|
let user = message.author;
|
||||||
}
|
let reason = args.join(" ") || "No Reason Provided.";
|
||||||
|
|
||||||
|
let name = message.channel.name;
|
||||||
|
let ticketChannel = message.channel;
|
||||||
|
|
||||||
|
message.channel.send(`**${supportbot.ClosingTicket}**`)
|
||||||
|
|
||||||
|
.then(() => {
|
||||||
|
const logEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TranscriptTitle)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
.addField("Closed By", message.author.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
|
||||||
|
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
||||||
|
let txt = '';
|
||||||
|
|
||||||
|
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
||||||
|
txt += `${message.guild.name}\n`;
|
||||||
|
txt += `#${ticketChannel.name}\n`;
|
||||||
|
txt += `${msgs.size} messages\n\n\n`;
|
||||||
|
|
||||||
|
msgs.forEach( msg => {
|
||||||
|
if ( msg.content ) {
|
||||||
|
txt += `----- ${msg.author.tag} at ${msg.createdAt}\n`;
|
||||||
|
txt += `${msg.content}\n`;
|
||||||
|
txt += `-----\n\n`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
logChannel.send(logEmbed).catch(err => {
|
||||||
|
message.reply(err)
|
||||||
|
})
|
||||||
|
|
||||||
|
logChannel.send( new Discord.MessageAttachment( Buffer.from( txt ), `${name}.txt` ) );
|
||||||
|
|
||||||
|
message.channel.delete();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}).catch( () => {
|
||||||
|
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Forceclose
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
const fs = require("fs")
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
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});
|
|
||||||
|
|
||||||
const log = message.guild.channels.find(channel => channel.name === supportbot.Transcript_Logs)
|
|
||||||
const uID = message.author
|
|
||||||
const reason = args.join(" ") || "No Reason Provided.";
|
|
||||||
const name = message.channel.name;
|
|
||||||
const c = message.channel;
|
|
||||||
|
|
||||||
message.channel.send(`Your ticket is currently closing`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
|
|
||||||
const embed1 = new Discord.RichEmbed()
|
|
||||||
.setTitle(supportbot.Transcript_Title)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Ticket Author", uID)
|
|
||||||
.addField("Closed By", message.author.tag)
|
|
||||||
.addField("Reason", reason)
|
|
||||||
message.channel.fetchMessages({ limit: 100 })
|
|
||||||
|
|
||||||
.then(msgs => {
|
|
||||||
message.channel.fetchMessages({ limit: 100, before: msgs.last().id })
|
|
||||||
|
|
||||||
.then(msg => {
|
|
||||||
const merged = msgs.concat(msg);
|
|
||||||
const output = merged.reduce((out, msg) => {
|
|
||||||
out += `[${message.createdAt}] ${message.author.tag}: ${message.cleanContent ? message.cleanContent.replace(/\n/g, '\r\n') : ''}\r\n`;
|
|
||||||
return out;
|
|
||||||
}, '');
|
|
||||||
|
|
||||||
log.send({ files: [{ attachment: Buffer.from(output, 'utf8'), name: `${name}.txt` }] }).then(c.delete()).catch(console.error); // sends the file to logs
|
|
||||||
return log.send(embed1).catch(console.error);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Forceclose_Command,
|
|
||||||
}
|
|
||||||
+39
-39
@@ -1,51 +1,51 @@
|
|||||||
// SupportBot
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
// Created by © 2020 Emerald Services
|
// Help Command
|
||||||
// Command: Help
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const fs = require("fs");
|
||||||
|
|
||||||
const fs = require("fs")
|
|
||||||
const yaml = require('js-yaml');
|
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) => {
|
module.exports = {
|
||||||
|
name: supportbot.HelpCommand,
|
||||||
|
description: supportbot.HelpDesc,
|
||||||
|
|
||||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Help_Command}`);
|
execute(message, args) {
|
||||||
|
let generalCommands = "";
|
||||||
|
generalCommands += `**${supportbot.Prefix}${supportbot.HelpCommand}** ${supportbot.HelpDesc}\n`;
|
||||||
|
generalCommands += `**${supportbot.Prefix}${supportbot.LinksCommand}** ${supportbot.LinkDesc}\n`;
|
||||||
|
generalCommands += `**${supportbot.Prefix}${supportbot.SuggestCommand}** ${supportbot.SuggestionDesc}\n`;
|
||||||
|
generalCommands += `**${supportbot.Prefix}${supportbot.PingCommand}** ${supportbot.PingDesc}\n`;
|
||||||
|
|
||||||
|
let supportCommands = "";
|
||||||
|
supportCommands += `**${supportbot.Prefix}${supportbot.NewTicket} [reason]** ${supportbot.NewTicketDesc}\n`
|
||||||
|
supportCommands += `**${supportbot.Prefix}${supportbot.CloseTicket} [reason]** ${supportbot.CloseTicketDesc}\n`
|
||||||
|
|
||||||
|
let staffCommands = "";
|
||||||
|
staffCommands += `**${supportbot.Prefix}${supportbot.AddUser} <user#0000>** ${supportbot.AddUserDesc}\n`
|
||||||
|
staffCommands += `**${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>** ${supportbot.RemoveUserDesc}\n`
|
||||||
|
staffCommands += `**${supportbot.Prefix}${supportbot.BotSay}** ${supportbot.BotSayDesc}\n`
|
||||||
|
staffCommands += `**${supportbot.Prefix}${supportbot.AnnounceCommand}** ${supportbot.AnnounceDesc}\n`
|
||||||
|
|
||||||
|
const HelpCommandEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.Bot_Name)
|
||||||
|
.setThumbnail(message.author.displayAvatarURL())
|
||||||
|
|
||||||
let userCommands = "";
|
.addFields(
|
||||||
userCommands += `**${supportbot.Prefix}${supportbot.Ticket_Command} <reason>**: Create a support ticket\n`;
|
{ name: '🖥️ General Commands', value: `${generalCommands}\n`, inline: false },
|
||||||
userCommands += `**${supportbot.Prefix}${supportbot.Close_Command}**: Close your support ticket\n`;
|
{ name: '🎫 Support Commands', value: `${supportCommands}\n`, inline: false },
|
||||||
userCommands += `**${supportbot.Prefix}${supportbot.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
|
)
|
||||||
userCommands += `**${supportbot.Prefix}${supportbot.Report_Command} <user> <reason>**: Report a valid user\n`;
|
|
||||||
userCommands += `**${supportbot.Prefix}${supportbot.Link_Command}**: Get some important links!\n`;
|
|
||||||
userCommands += `**${supportbot.Prefix}${supportbot.Ping_Command}**: Check the bots ping. Pong!\n`;
|
|
||||||
|
|
||||||
let supportCommands = "";
|
|
||||||
supportCommands += `**${supportbot.Prefix}${supportbot.Add_Command} <user>**: Adds a user to a ticket\n`;
|
|
||||||
supportCommands += `**${supportbot.Prefix}${supportbot.Remove_Command} <user>**: Removes a user from a ticket\n`;
|
|
||||||
supportCommands += `**${supportbot.Prefix}${supportbot.Forceclose_Command}**: Forceclose a support ticket\n`;
|
|
||||||
supportCommands += `**${supportbot.Prefix}${supportbot.Rename_Command}**: Rename a support ticket\n`;
|
|
||||||
|
|
||||||
let staffCommands = "";
|
.setColor(supportbot.EmbedColour)
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.Announcement_Command} <message>**: Create a bot announcement\n`;
|
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL());
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.Say_Command} <message>**: Send a message as the bot\n`;
|
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.Lockchat_Command}**: Lock 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`;
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
if (message.member.roles.cache.some(role => role.name === supportbot.Staff || supportbot.Admin)) {
|
||||||
.setTitle(supportbot.Bot_Name)
|
HelpCommandEmbed.addFields(
|
||||||
.addField("👨 User Commands", userCommands)
|
{ name: '🔑 Staff Commands', value: `${staffCommands}\n`, inline: false },
|
||||||
.addField(":pushpin: Support Commands", supportCommands)
|
)
|
||||||
.addField("🔑 Staff Commands", staffCommands)
|
}
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL);
|
|
||||||
message.channel.send(embed);
|
|
||||||
|
|
||||||
}
|
message.channel.send({ embed: HelpCommandEmbed });
|
||||||
|
}
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Help_Command,
|
|
||||||
};
|
};
|
||||||
+21
-24
@@ -1,36 +1,33 @@
|
|||||||
// SupportBot
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
// Created by © 2020 Emerald Services
|
// Links Command
|
||||||
// Command: Links
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const { execute } = require("./help");
|
||||||
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 ) => {
|
module.exports = {
|
||||||
|
name: supportbot.LinksCommand,
|
||||||
|
description: supportbot.LinksDesc,
|
||||||
|
|
||||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Link_Command}`);
|
execute(message, args) {
|
||||||
|
|
||||||
|
const LinksEmbed = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
let botLinks = supportbot.LINKS;
|
let botLinks = supportbot.LINKS;
|
||||||
|
|
||||||
|
let links = '';
|
||||||
|
|
||||||
|
for ( let name in botLinks ) {
|
||||||
|
links += `[${name}](${botLinks[ name ]})\n`;
|
||||||
|
};
|
||||||
|
|
||||||
let links = '';
|
LinksEmbed.addField(supportbot.LinksTitle, links)
|
||||||
|
|
||||||
for ( let name in botLinks ) {
|
message.channel.send({ embed: LinksEmbed });
|
||||||
links += `[${name}](${botLinks[ name ]})\n`;
|
|
||||||
};
|
|
||||||
|
|
||||||
let embed = new Discord.RichEmbed()
|
}
|
||||||
.setTitle(supportbot.LINKS_TITLE)
|
|
||||||
.setDescription(links)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter);
|
|
||||||
message.channel.send(embed);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Link_Command,
|
|
||||||
};
|
};
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Close
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
|
||||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
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(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
|
||||||
|
|
||||||
const lockmsg = new Discord.RichEmbed()
|
|
||||||
.setDescription(":white_check_mark: **Chat Locked**")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send(lockmsg);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Lockchat_Command,
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
const Discord = require("discord.js");
|
||||||
|
const bot = new Discord.Client()
|
||||||
|
|
||||||
|
const fs = require("fs")
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
const TicketNumberID = require('../utils/TicketNumber.js');
|
||||||
|
|
||||||
|
const reacted = [];
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: supportbot.NewTicket,
|
||||||
|
description: supportbot.NewTicketDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.NewTicket}!`);
|
||||||
|
|
||||||
|
// Ticket ID
|
||||||
|
let ticketNumberID = TicketNumberID.pad(message.guild.id);
|
||||||
|
|
||||||
|
// Ticket Subject
|
||||||
|
const TicketSubject = args.join(" ") || supportbot.NoTicketSubject;
|
||||||
|
|
||||||
|
// Ticket Exists
|
||||||
|
const TicketExists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Ticket Exists!")
|
||||||
|
.setDescription(`${supportbot.TicketExists}`)
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
|
||||||
|
if (message.guild.channels.cache.find(SupportTicket => SupportTicket.name === `${supportbot.TicketChannel}-${ticketNumberID}`))
|
||||||
|
return message.channel.send({ embed: TicketExists });
|
||||||
|
|
||||||
|
message.guild.channels.create(`${supportbot.TicketChannel}-${ticketNumberID}`, {
|
||||||
|
type: "text",
|
||||||
|
}).then(SupportTicket => {
|
||||||
|
|
||||||
|
let AllUsers = message.guild.roles.cache.find(everyone => everyone.name === '@everyone')
|
||||||
|
let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff)
|
||||||
|
let Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin)
|
||||||
|
|
||||||
|
let DeptRole1 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.DepartmentRole_1}`)
|
||||||
|
let DeptRole2 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.DepartmentRole_2}`)
|
||||||
|
let DeptRole3 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.DepartmentRole_3}`)
|
||||||
|
|
||||||
|
SupportTicket.updateOverwrite(AllUsers, {
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
SupportTicket.updateOverwrite(message.author, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
READ_MESSAGES: true,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
READ_MESSAGES: true,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
SupportTicket.updateOverwrite(Admins, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
READ_MESSAGES: true,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Ticket Category
|
||||||
|
let TicketCategory = message.guild.channels.cache.find(category => category.name === supportbot.TicketCategory)
|
||||||
|
|
||||||
|
if (TicketCategory) {
|
||||||
|
SupportTicket.setParent(TicketCategory.id)
|
||||||
|
} else {
|
||||||
|
if (message.guild.channels.cache.get(supportbot.TicketCategory)) {
|
||||||
|
SupportTicket.setParent(message.guild.channels.cache.get(supportbot.TicketCategory).id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ticket Created, Message Sent
|
||||||
|
const TicketMessage = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.Ticket_Title.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, SupportTicket.id).replace(/%ticketusername%/g, message.member.user.username))
|
||||||
|
.setDescription(supportbot.TicketMessage.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, SupportTicket.id).replace(/%ticketusername%/g, message.member.user.username))
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
if (supportbot.TicketSubject === "embed") {
|
||||||
|
|
||||||
|
if (TicketSubject != 'No Reason Provided.') {
|
||||||
|
TicketMessage.addFields({ name: 'Reason', value: TicketSubject })
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.TicketSubject === "description") {
|
||||||
|
|
||||||
|
if (TicketSubject != 'No Reason Provided.') {
|
||||||
|
SupportTicket.setTopic(`Reason: ${TicketSubject} - User ID: ${message.author.id} - Ticket: ${SupportTicket.name}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.TicketDepartments === "true") {
|
||||||
|
TicketMessage.addFields({ name: 'Departments', value: `${supportbot.DepartmentEmoji_1} **${supportbot.DepartmentTitle_1}**\n${supportbot.DepartmentEmoji_2} **${supportbot.DepartmentTitle_2}**\n${supportbot.DepartmentEmoji_3} **${supportbot.DepartmentTitle_3}**` })
|
||||||
|
}
|
||||||
|
|
||||||
|
SupportTicket.send({ embed: TicketMessage }).then( async function(msg) {
|
||||||
|
|
||||||
|
const Emoji_1 = supportbot.DepartmentEmoji_1;
|
||||||
|
const Emoji_2 = supportbot.DepartmentEmoji_2;
|
||||||
|
const Emoji_3 = supportbot.DepartmentEmoji_3;
|
||||||
|
|
||||||
|
reacted[ticketNumberID] = false;
|
||||||
|
|
||||||
|
if (supportbot.TicketDepartments === "true") {
|
||||||
|
await msg.react(Emoji_1);
|
||||||
|
await msg.react(Emoji_2);
|
||||||
|
await msg.react(Emoji_3);
|
||||||
|
let filter = (reaction, user) => {
|
||||||
|
if (user.id !== message.author.id) return;
|
||||||
|
if (typeof reacted[ticketNumberID] !== "boolean") return;
|
||||||
|
delete reacted[ticketNumberID];
|
||||||
|
if (reaction.emoji.name === Emoji_1) {
|
||||||
|
SupportTicket.updateOverwrite(message.author.id, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(Admins, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(DeptRole1, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
|
||||||
|
if (supportbot.AllowStaff === "true") {
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.AllowStaff === "false") {
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: false, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
}
|
||||||
|
|
||||||
|
const Department1 = new Discord.MessageEmbed()
|
||||||
|
.setTitle(`> Thank for reaching out to the **${supportbot.DepartmentTitle_1} Department**. Please provide us information regarding your query.`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
SupportTicket.send({ embed: Department1 });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reaction.emoji.name === Emoji_2) {
|
||||||
|
SupportTicket.updateOverwrite(message.author.id, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(Admins, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(DeptRole2, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
|
||||||
|
if (supportbot.AllowStaff === "true") {
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.AllowStaff === "false") {
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: false, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
}
|
||||||
|
|
||||||
|
const Department2 = new Discord.MessageEmbed()
|
||||||
|
.setTitle(`> Thank for reaching out to the **${supportbot.DepartmentTitle_2} Department**. Please provide us information regarding your query.`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
SupportTicket.send({ embed: Department2 });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reaction.emoji.name === `${Emoji_3}`) {
|
||||||
|
SupportTicket.updateOverwrite(message.author.id, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(Admins, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(DeptRole3, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: false, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
|
||||||
|
if (supportbot.AllowStaff === "true") {
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: true, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.AllowStaff === "false") {
|
||||||
|
SupportTicket.updateOverwrite(SupportStaff, { VIEW_CHANNEL: false, READ_MESSAGES: true, SEND_MESSAGES: true, })
|
||||||
|
}
|
||||||
|
|
||||||
|
const Department3 = new Discord.MessageEmbed()
|
||||||
|
.setTitle(`> Thank for reaching out to the **${supportbot.DepartmentTitle_3} Department**. Please provide us information regarding your query.`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
SupportTicket.send({ embed: Department3 });
|
||||||
|
}
|
||||||
|
return [Emoji_1, Emoji_2, Emoji_3].includes(reaction.emoji.name) && user.id !== message.author.id;
|
||||||
|
}
|
||||||
|
msg.awaitReactions(filter, {
|
||||||
|
max: 4,
|
||||||
|
time: 60000,
|
||||||
|
errors: ['time']
|
||||||
|
}).then(async collected => {
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(async function() {
|
||||||
|
if (typeof reacted[ticketNumberID] == "boolean") {
|
||||||
|
delete reacted[ticketNumberID];
|
||||||
|
//delete channel because didn't react in a minute
|
||||||
|
}
|
||||||
|
}, 60000);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
const CreatedTicket = new Discord.MessageEmbed()
|
||||||
|
.setDescription(supportbot.TicketCreatedAlert.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, SupportTicket.id).replace(/%ticketusername%/g, message.member.user.username))
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: CreatedTicket });
|
||||||
|
|
||||||
|
fs.writeFileSync("./storage/SupportTickets.json", '{\n "ticket": "' + SupportTicket.name + '", \n "id":' + message.author.id + "\n}", (err) => {
|
||||||
|
if (!err) return;
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Ticket Logs
|
||||||
|
|
||||||
|
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.TicketLog}\`\n\nError Code: \`SB-03\``)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
const TicketLogs = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Ticket Log")
|
||||||
|
.setThumbnail(supportbot.Ticket_Thumbnail)
|
||||||
|
.addFields(
|
||||||
|
{ name: 'Ticket', value: `<#${SupportTicket.id}>` },
|
||||||
|
{ name: 'User', value: `<@${message.author.id}>` },
|
||||||
|
)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
|
||||||
|
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === supportbot.TicketLog)
|
||||||
|
|
||||||
|
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
||||||
|
|
||||||
|
locateChannel.send({ embed: TicketLogs });
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
+15
-18
@@ -1,26 +1,23 @@
|
|||||||
// SupportBot
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
// Created by © 2020 Emerald Services
|
// Help Command
|
||||||
// Command: Ping
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
|
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) => {
|
module.exports = {
|
||||||
|
name: supportbot.PingCommand,
|
||||||
|
description: supportbot.PingDesc,
|
||||||
|
|
||||||
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}`);
|
execute(message, args) {
|
||||||
|
let ping = Date.now() - message.createdTimestamp + " ms";
|
||||||
|
|
||||||
|
const PingCommandEmbed = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`🏓 **Pong!** \`${Date.now() - message.createdTimestamp}ms\``)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
message.channel.send({ embed: PingCommandEmbed });
|
||||||
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
|
}
|
||||||
.setColor(supportbot.EmbedColour)
|
};
|
||||||
message.channel.send(embed).catch(console.error);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Ping_Command,
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Poll
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
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()
|
|
||||||
.setTitle(`${supportbot.Poll_Title}`)
|
|
||||||
.setDescription(args.join(" "))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
|
|
||||||
|
|
||||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${supportbot.Poll_Channel}`)
|
|
||||||
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Poll_Channel}**`)
|
|
||||||
|
|
||||||
ac.send(embed)
|
|
||||||
|
|
||||||
.then(async function(msg) {
|
|
||||||
msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2));
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Poll_Command,
|
|
||||||
};
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Remove
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
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});
|
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
|
||||||
|
|
||||||
const cantfinduser = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
|
||||||
|
|
||||||
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
|
||||||
|
|
||||||
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)
|
|
||||||
.setTitle("User Removed")
|
|
||||||
.setDescription(`👍 ${rUser} has been removed from this ticket`)
|
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
message.channel.send({embed: useradded});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Remove_Command,
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Add User
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: supportbot.RemoveUser,
|
||||||
|
description: supportbot.RemoveUserDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.RemoveUser}!`);
|
||||||
|
|
||||||
|
let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff)
|
||||||
|
let Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin)
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``)
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
|
||||||
|
if (message.member.roles.cache.has(SupportStaff.id) || message.member.roles.cache.has(Admins.id)) {
|
||||||
|
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(`${supportbot.NoValidTicket}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
message.channel.send({ embed: Exists });
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(`${supportbot.UserNotFound}\n\nTry Again:\`${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>\``)
|
||||||
|
.setColor(supportbot.ErrorColour)
|
||||||
|
|
||||||
|
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
||||||
|
|
||||||
|
message.channel.updateOverwrite(rUser, {
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
CREATE_INVITE: false,
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
READ_MESSAGES: false
|
||||||
|
});
|
||||||
|
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Removed!")
|
||||||
|
.setDescription(supportbot.RemovedUser.replace(/%user%/g, rUser.id))
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: Complete });
|
||||||
|
} else {
|
||||||
|
return message.channel.send({ embed: NoPerms });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Rename
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
|
||||||
.setColor(supportbot.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(supportbot.colour)
|
|
||||||
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
|
|
||||||
const renameto = args.join(" ")
|
|
||||||
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
|
|
||||||
|
|
||||||
// Renamed Ticket Logistic
|
|
||||||
const logEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle(":ticket: Ticket Renamed")
|
|
||||||
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
|
|
||||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Logs}`);
|
|
||||||
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
|
|
||||||
|
|
||||||
logChannel.send({embed: logEmbed});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Rename_Command,
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Report
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) {
|
|
||||||
message.reply(rolemissing).catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
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)) {
|
|
||||||
message.reply(donothaverole);
|
|
||||||
} else {
|
|
||||||
if(!args[0]) {
|
|
||||||
message.reply(":x: Sorry! Please specify the user to report.");
|
|
||||||
} else {
|
|
||||||
if(!args[1]) {
|
|
||||||
message.reply(":x: Sorry! Specify the reason of your report.");
|
|
||||||
} else {
|
|
||||||
let reportDesc = args.slice(1).join(" ");
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle(`${supportbot.Report_Title}`)
|
|
||||||
.setThumbnail(message.author.avatarURL)
|
|
||||||
.addField("Report by:", `<@${message.author.id}>`, false)
|
|
||||||
.addField("Description:", `${reportDesc}`, false)
|
|
||||||
.addField("Reported User:", `${args[0]}`, false)
|
|
||||||
.setTimestamp(new Date())
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
|
|
||||||
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${supportbot.Report_Channel}`)
|
|
||||||
if(!rc) {
|
|
||||||
message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Report_Channel}**`);
|
|
||||||
} else {
|
|
||||||
rc.send(embed);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Report_Command
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Say
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.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) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
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()
|
|
||||||
.setTitle(`${supportbot.Announcement_Title}`)
|
|
||||||
.setDescription(args.join(" "))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
|
||||||
|
|
||||||
message.channel.send(embed);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Say_Command,
|
|
||||||
}
|
|
||||||
+51
-35
@@ -1,42 +1,58 @@
|
|||||||
// SupportBot
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
// Created by © 2020 Emerald Services
|
// Suggest Command
|
||||||
// Command: Say
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
|
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 = async(bot, message, args) => {
|
module.exports = {
|
||||||
|
name: supportbot.SuggestCommand,
|
||||||
|
description: supportbot.SuggestionDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
let locateChannel = message.guild.channels.cache.find(SuggestionChannel => SuggestionChannel.name === supportbot.SuggestionChannel);
|
||||||
|
|
||||||
|
const errornochannel = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Channel")
|
||||||
|
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.SuggestionChannel}\``)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`> **${supportbot.SuggestionStarter}**`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({ embed: embed });
|
||||||
|
|
||||||
|
let suggestion = []
|
||||||
|
message.channel.awaitMessages(response => response.content.length > 2, {
|
||||||
|
max: 1,
|
||||||
|
time: 500000,
|
||||||
|
errors: ['time'],
|
||||||
|
}).then((collected) => {
|
||||||
|
suggestion.push(collected.map(r => r.content));
|
||||||
|
|
||||||
|
const SuggestionMessage = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
|
||||||
|
.setTitle(supportbot.SuggestionTitle)
|
||||||
|
.setDescription(`\`\`\`${suggestion}\`\`\``)
|
||||||
|
|
||||||
|
.addFields( { name: "From", value: `<@${message.author.id}>`, inline: false }, )
|
||||||
|
|
||||||
|
locateChannel.send({ embed: SuggestionMessage }).then(async function(msg) {
|
||||||
|
msg.react(supportbot.SuggestReact_1).then(() => msg.react(supportbot.SuggestReact_2));
|
||||||
|
});
|
||||||
|
|
||||||
|
const SuggestionComplete = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.SuccessColour)
|
||||||
|
.setDescription(`:white_check_mark: Your suggestion has been successfully created. <#${locateChannel.id}>`)
|
||||||
|
message.channel.send({ embed: SuggestionComplete })
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
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()
|
|
||||||
.setTitle(`${supportbot.Suggestion_Title}`)
|
|
||||||
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
|
|
||||||
.setFooter(`${supportbot.footer}`, message.author.avatarURL)
|
|
||||||
.setTimestamp(new Date())
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${supportbot.Suggestion_Channel}`);
|
|
||||||
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${supportbot.Suggestion_Channel}**`);
|
|
||||||
|
|
||||||
sc.send(SuggestionEmbed)
|
|
||||||
|
|
||||||
.then(async function(msg) {
|
|
||||||
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
|
|
||||||
});
|
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
|
||||||
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${sc.id}>`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send(SuggestionSuccessEmbed);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Suggest_Command,
|
|
||||||
}
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Say
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
const TicketNumberID = require('../utility/TicketNumber');
|
|
||||||
|
|
||||||
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.Ticket_Command}`);
|
|
||||||
|
|
||||||
// Ticket Number ID Settings
|
|
||||||
let ticketNumberID = TicketNumberID.pad(message.guild.id);
|
|
||||||
|
|
||||||
// Ticket Subject Settings
|
|
||||||
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
|
|
||||||
|
|
||||||
// Ticket Limitiations
|
|
||||||
const alreadyopen = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
// Ticket Creation
|
|
||||||
if (message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
|
|
||||||
message.guild.createChannel(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
|
|
||||||
type: 'text',
|
|
||||||
}).then(TicketChannel => {
|
|
||||||
|
|
||||||
// Roles
|
|
||||||
let staff = message.guild.roles.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
|
|
||||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
|
|
||||||
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
|
|
||||||
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
|
|
||||||
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.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 })
|
|
||||||
|
|
||||||
// Category
|
|
||||||
let category = message.guild.channels.find(c => c.name === supportbot.category);
|
|
||||||
if (category) {
|
|
||||||
TicketChannel.setParent(category.id);
|
|
||||||
} else {
|
|
||||||
if (message.guild.channels.get(supportbot.category)) {
|
|
||||||
TicketChannel.setParent(message.guild.channels.get(supportbot.category).id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const ticketopened = new Discord.RichEmbed()
|
|
||||||
.setTitle(":white_check_mark: Support Ticket Created")
|
|
||||||
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
|
|
||||||
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
|
|
||||||
.setColor(supportbot.Ticket_Colour)
|
|
||||||
message.channel.send({embed: ticketopened});
|
|
||||||
// Ticket Message - ( Able to edit this message via the settings.json file )
|
|
||||||
const ticketMessage = `Hi! <@${message.author.id}>\n${supportbot.Ticket_Message}`;
|
|
||||||
|
|
||||||
const Department_1 = supportbot.Ticket_Department_1;
|
|
||||||
const Department_2 = supportbot.Ticket_Department_2;
|
|
||||||
const Department_3 = supportbot.Ticket_Department_3;
|
|
||||||
|
|
||||||
const Emoji_1 = supportbot.Ticket_Department_Emoji_1;
|
|
||||||
const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
|
|
||||||
const Emoji_3 = supportbot.Ticket_Department_Emoji_3;
|
|
||||||
|
|
||||||
const TicketMessage = new Discord.RichEmbed()
|
|
||||||
.setDescription(ticketMessage, true)
|
|
||||||
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
|
|
||||||
.setColor(supportbot.Ticket_Colour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
|
||||||
TicketMessage.addField("Reason", 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 someone 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 someone 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 someone to reach out to you.")
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Ticket Logging
|
|
||||||
const logEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle(":ticket: Logistics of your Ticket")
|
|
||||||
.addField("Ticket ID", ticketNumberID, true)
|
|
||||||
.addField("User", `<@${message.author.id}>`, true)
|
|
||||||
.addField("Channel", `ticket#${ticketNumberID}`, true)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
|
||||||
logEmbed.addField('Subject', subject, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Logs}`);
|
|
||||||
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
|
|
||||||
|
|
||||||
logChannel.send({embed: logEmbed})
|
|
||||||
|
|
||||||
}).catch(err=>{console.error(err)});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.Ticket_Command,
|
|
||||||
};
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Created by © 2020 Emerald Services
|
|
||||||
// Command: Say
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
|
||||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
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(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
|
||||||
|
|
||||||
const lockmsg = new Discord.RichEmbed()
|
|
||||||
.setDescription(":white_check_mark: **Chat Un-Locked**")
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
message.channel.send(lockmsg);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: supportbot.UnLockchat_Command,
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
cd /home/container
|
|
||||||
|
|
||||||
if [ "${GIT_CLONE}" == "true" ] || [ "${GIT_CLONE}" == "1" ]; then
|
|
||||||
if [ "$(ls -A /home/container)" ]; then
|
|
||||||
echo "Pulling Updates"
|
|
||||||
git pull
|
|
||||||
else
|
|
||||||
echo -e "/home/container is empty.\nCloning files into the directory."
|
|
||||||
git clone https://github.com/1tzemerald/SupportBot.git
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i '/s/BOT_TOKEN_HERE/${BOT_TOKEN}/g' settings.json
|
|
||||||
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
|
|
||||||
${MODIFIED_STARTUP}
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Ready Event
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = async (bot, member) => {
|
||||||
|
|
||||||
|
if (supportbot.SystemMessages === "true") {
|
||||||
|
const SystemChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.SystemMessage_Channel)
|
||||||
|
|
||||||
|
if (!SystemChannel) return;
|
||||||
|
|
||||||
|
console.log(`[${supportbot.Bot_Name}]: ${member.user.username} has joined ${member.guild.name}!`)
|
||||||
|
console.log(supportbot.AutoRole_Role)
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Type === "embed") {
|
||||||
|
const GuildAddMember = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.Welcome_Title)
|
||||||
|
.setDescription(supportbot.WelcomeMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Icon === "BOT") {
|
||||||
|
GuildAddMember.setThumbnail(bot.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Icon === "USER") {
|
||||||
|
GuildAddMember.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_EmbedFooter === "true") {
|
||||||
|
GuildAddMember.setFooter(supportbot.EmbedFooter)
|
||||||
|
}
|
||||||
|
|
||||||
|
SystemChannel.send({ embed: GuildAddMember });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Type === "normal") {
|
||||||
|
SystemChannel.send(supportbot.WelcomeMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Ready Event
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = async (bot, member) => {
|
||||||
|
|
||||||
|
if (supportbot.SystemMessages === "true") {
|
||||||
|
const SystemChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.SystemMessage_Channel)
|
||||||
|
|
||||||
|
if (!SystemChannel) return;
|
||||||
|
|
||||||
|
console.log(`[${supportbot.Bot_Name}]: ${member.user.username} has left ${member.guild.name}!`)
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Type === "embed") {
|
||||||
|
const GuildRemoveMember = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.Leave_Title)
|
||||||
|
.setDescription(supportbot.LeaveMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Icon === "BOT") {
|
||||||
|
GuildAddMember.setThumbnail(bot.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Icon === "USER") {
|
||||||
|
GuildAddMember.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_EmbedFooter === "true") {
|
||||||
|
GuildAddMember.setFooter(supportbot.EmbedFooter)
|
||||||
|
}
|
||||||
|
|
||||||
|
SystemChannel.send({ embed: GuildRemoveMember });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.SystemMessage_Type === "normal") {
|
||||||
|
SystemChannel.send(supportbot.LeaveMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Message Event
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = async (bot, message) => {
|
||||||
|
if(message.author.bot) return;
|
||||||
|
if(message.channel.type === "dm") return;
|
||||||
|
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
||||||
|
|
||||||
|
let messageArray = message.content.split(" ");
|
||||||
|
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
||||||
|
const command = args.shift().toLowerCase();
|
||||||
|
|
||||||
|
const cmd = bot.commands.get(command);
|
||||||
|
if(!cmd) return;
|
||||||
|
cmd.execute(message, args);
|
||||||
|
message.delete();
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// SupportBot 6.0, Created by Emerald Services
|
||||||
|
// Ready Event
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = async (bot) => {
|
||||||
|
bot.user.setActivity(supportbot.BotActivity, {
|
||||||
|
type: supportbot.ActvityType
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||||
|
console.log(`\u001b[37m`, `${supportbot.Bot_Name} has successfully connected to discord`)
|
||||||
|
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||||
|
};
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
// ____ _ ____ _
|
// _________ __ __________ __
|
||||||
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
|
// / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
||||||
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
|
// \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
||||||
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
|
// / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
||||||
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
|
// /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||||
// |_| |_|
|
// \/ |__| |__| \/
|
||||||
// © 2020 Created by Emerald Services
|
//
|
||||||
// Licnese: MIT
|
// SupportBot version 6.0
|
||||||
// SupportBot v5.1.0
|
// Created by Emerald Services
|
||||||
|
// Installed with MIT License
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
@@ -17,104 +18,73 @@ bot.commands = new Discord.Collection();
|
|||||||
const yaml = require('js-yaml');
|
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'));
|
||||||
|
|
||||||
fs.readdir("./commands/", (err, files) => {
|
const { promisify } = require("util");
|
||||||
if(err) console.log(err);
|
const readdir = promisify(require("fs").readdir);
|
||||||
|
|
||||||
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
|
||||||
if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No commands found. Try to Re-download the resource`);
|
|
||||||
|
|
||||||
jsfile.forEach((f, i) =>{
|
|
||||||
let props = require(`./commands/${f}`);
|
|
||||||
console.log(`[${supportbot.Bot_Name}] > Command Loaded > ${f}`);
|
|
||||||
bot.commands.set(props.help.name, props);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.addons = new Discord.Collection();
|
String.prototype.toProperCase = function () {
|
||||||
|
return this.replace(
|
||||||
|
/([^\W_]+[^\s-]*) */g,
|
||||||
|
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
fs.readdir("./sb-addons/", (err, files) => {
|
const init = async () => {
|
||||||
if(err) console.log(err);
|
const evtFiles = await readdir("./events/");
|
||||||
|
|
||||||
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/`);
|
|
||||||
|
|
||||||
jsfile.forEach((f, i) =>{
|
|
||||||
let props = require(`./sb-addons/${f}`);
|
|
||||||
console.log(`[${supportbot.Bot_Name}] > Addons Loaded > ${f}`);
|
|
||||||
bot.addons.set(props.help.name, props);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("ready", async () => {
|
|
||||||
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
|
|
||||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
|
||||||
console.log(`\u001b[37m`, `Emerald Services has successfully connected to discord`)
|
|
||||||
console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=516372960110444574&permissions=8&scope=bot`)
|
|
||||||
console.log(`\u001b[37m`, `© ️SupportBot created by Emerald Services`)
|
|
||||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("message", async message => {
|
|
||||||
if(message.author.bot) return;
|
|
||||||
if(message.channel.type === "dm") return;
|
|
||||||
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
|
||||||
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
|
||||||
const command = args.shift().toLowerCase();
|
|
||||||
|
|
||||||
const cmd = bot.commands.get(command);
|
|
||||||
if(!cmd) return;
|
|
||||||
cmd.run(bot, message, args);
|
|
||||||
message.delete();
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("message", async message => {
|
|
||||||
if(message.author.bot) return;
|
|
||||||
if(message.channel.type === "dm") return;
|
|
||||||
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
|
||||||
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
|
||||||
const addon = args.shift().toLowerCase();
|
|
||||||
|
|
||||||
const cmd = bot.addons.get(addon);
|
|
||||||
if(!cmd) return;
|
|
||||||
cmd.run(bot, message, args);
|
|
||||||
message.delete();
|
|
||||||
});
|
|
||||||
|
|
||||||
// [SupportBot] Welcome Message && Auto Join Role
|
|
||||||
|
|
||||||
bot.on("guildMemberAdd", (member) => {
|
|
||||||
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
|
|
||||||
let autorole = member.guild.roles.find(autorole => autorole.name === `${supportbot.AutoRole}`)
|
|
||||||
|
|
||||||
const WelcomeMsg= new Discord.RichEmbed()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setThumbnail(member.user.avatarURL)
|
|
||||||
.setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`)
|
|
||||||
|
|
||||||
channel.send(WelcomeMsg);
|
|
||||||
member.addRole(autorole).catch(console.error);
|
|
||||||
|
|
||||||
|
evtFiles.forEach((file, i) => {
|
||||||
|
const eventName = file.split(".")[0];
|
||||||
|
const event = require(`./events/${file}`);
|
||||||
|
|
||||||
|
console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[31m`, `#${i + 1} Event Loaded: ${eventName.toProperCase()} `);
|
||||||
|
|
||||||
|
bot.on(eventName, event.bind(null, bot));
|
||||||
|
delete require.cache[require.resolve(`./events/${file}`)];
|
||||||
|
});
|
||||||
|
|
||||||
|
console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `Successfully loaded ${evtFiles.length} events.`);
|
||||||
|
console.info(`\u001b[37m`, "-----------------------------------------------------------------------------");
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
fs.readdir("./commands/", (err, files) => {
|
||||||
|
if (err) console.info(err, "error");
|
||||||
|
|
||||||
|
let jsfiles = files.filter((f) => f.split(".").pop() === "js");
|
||||||
|
|
||||||
|
if (jsfiles.length <= 0) {
|
||||||
|
console.log(`[${supportbot.Bot_Name}]: No commands found. Try to Re-download the resource`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
jsfiles.forEach((f, i) => {
|
||||||
|
let props = require(`./commands/${f}`);
|
||||||
|
console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[31m`, `#${i + 1} Command Loaded: ${props.name.toProperCase()}`);
|
||||||
|
bot.commands.set(props.name, props);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `Loaded ${jsfiles.length} commands!`);
|
||||||
|
console.info(`\u001b[37m`, "-----------------------------------------------------------------------------");
|
||||||
});
|
});
|
||||||
|
|
||||||
// [SupportBot] Leave Message
|
fs.readdir("./addons/", (err, files) => {
|
||||||
|
if (err) console.info(err, "error");
|
||||||
|
|
||||||
|
let jsfiles = files.filter((f) => f.split(".").pop() === "js");
|
||||||
|
|
||||||
bot.on("guildMemberRemove", (member) => {
|
if (jsfiles.length <= 0) {
|
||||||
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.LeaveChannel}`)
|
console.log(`[${supportbot.Bot_Name}]: No addons found. You can download addons from https://emeraldservices.xyz`);
|
||||||
|
return;
|
||||||
const LeaveMsg= new Discord.RichEmbed()
|
}
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setThumbnail(member.user.avatarURL)
|
jsfiles.forEach((f, i) => {
|
||||||
.setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`)
|
let props = require(`./addons/${f}`);
|
||||||
|
console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[31m`, `#${i + 1} Command Loaded: ${props.name.toProperCase()}`);
|
||||||
channel.send(LeaveMsg);
|
bot.commands.set(props.name, props);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.info(`\u001b[37m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `Loaded ${jsfiles.length} commands!`);
|
||||||
|
console.info(`\u001b[37m`, "-----------------------------------------------------------------------------");
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.login(supportbot.Token);
|
bot.login(supportbot.Token);
|
||||||
Generated
+91
-37
@@ -1,9 +1,32 @@
|
|||||||
{
|
{
|
||||||
"name": "SupportBot",
|
"name": "supportbot",
|
||||||
"version": "4.0",
|
"version": "6.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@discordjs/collection": {
|
||||||
|
"version": "0.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||||
|
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
||||||
|
},
|
||||||
|
"@discordjs/form-data": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||||
|
"requires": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"abort-controller": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||||
|
"requires": {
|
||||||
|
"event-target-shim": "^5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"argparse": {
|
"argparse": {
|
||||||
"version": "1.0.10",
|
"version": "1.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||||
@@ -12,21 +35,37 @@
|
|||||||
"sprintf-js": "~1.0.2"
|
"sprintf-js": "~1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"async-limiter": {
|
"asynckit": {
|
||||||
"version": "1.0.1",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
|
},
|
||||||
|
"combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"requires": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "11.5.1",
|
"version": "12.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.2.0.tgz",
|
||||||
"integrity": "sha512-tGhV5xaZXE3Z+4uXJb3hYM6gQ1NmnSxp9PClcsSAYFVRzH6AJH74040mO3afPDMWEAlj8XsoPXXTJHTxesqcGw==",
|
"integrity": "sha512-Ueb/0SOsxXyqwvwFYFe0msMrGqH1OMqpp2Dpbplnlr4MzcRrFWwsBM9gKNZXPVBHWUKiQkwU8AihXBXIvTTSvg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"long": "^4.0.0",
|
"@discordjs/collection": "^0.1.5",
|
||||||
"prism-media": "^0.0.3",
|
"@discordjs/form-data": "^3.0.1",
|
||||||
"snekfetch": "^3.6.4",
|
"abort-controller": "^3.0.0",
|
||||||
"tweetnacl": "^1.0.0",
|
"node-fetch": "^2.6.0",
|
||||||
"ws": "^6.0.0"
|
"prism-media": "^1.2.0",
|
||||||
|
"setimmediate": "^1.0.5",
|
||||||
|
"tweetnacl": "^1.0.3",
|
||||||
|
"ws": "^7.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"esprima": {
|
"esprima": {
|
||||||
@@ -34,29 +73,47 @@
|
|||||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||||
},
|
},
|
||||||
|
"event-target-shim": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
||||||
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "3.13.1",
|
"version": "3.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
|
||||||
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
|
"integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"argparse": "^1.0.7",
|
"argparse": "^1.0.7",
|
||||||
"esprima": "^4.0.0"
|
"esprima": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"long": {
|
"mime-db": {
|
||||||
"version": "4.0.0",
|
"version": "1.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||||
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
|
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||||
|
},
|
||||||
|
"mime-types": {
|
||||||
|
"version": "2.1.27",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||||
|
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||||
|
"requires": {
|
||||||
|
"mime-db": "1.44.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node-fetch": {
|
||||||
|
"version": "2.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||||
|
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||||
},
|
},
|
||||||
"prism-media": {
|
"prism-media": {
|
||||||
"version": "0.0.3",
|
"version": "1.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.2.tgz",
|
||||||
"integrity": "sha512-c9KkNifSMU/iXT8FFTaBwBMr+rdVcN+H/uNv1o+CuFeTThNZNTOrQ+RgXA1yL/DeLk098duAeRPP3QNPNbhxYQ=="
|
"integrity": "sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw=="
|
||||||
},
|
},
|
||||||
"snekfetch": {
|
"setimmediate": {
|
||||||
"version": "3.6.4",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||||
"integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw=="
|
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
||||||
},
|
},
|
||||||
"sprintf-js": {
|
"sprintf-js": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
@@ -64,17 +121,14 @@
|
|||||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||||
},
|
},
|
||||||
"tweetnacl": {
|
"tweetnacl": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||||
"integrity": "sha512-+8aPRjmXgf1VqvyxSlBUzKzeYqVS9Ai8vZ28g+mL7dNQl1jlUTCMDZnvNQdAS1xTywMkIXwJsfipsR/6s2+syw=="
|
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "6.2.1",
|
"version": "7.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz",
|
||||||
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
|
"integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA=="
|
||||||
"requires": {
|
|
||||||
"async-limiter": "~1.0.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+13
-27
@@ -1,38 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "SupportBot",
|
"name": "supportbot",
|
||||||
"version": "4.0",
|
"version": "6.0.0",
|
||||||
"description": "SupportBot",
|
"description": "SupportBot | #1 Self-Hosted Ticket Bot",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"private": "true",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"start": "node index.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "12.6.0",
|
|
||||||
"npm": "6.9.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"array-sort": "^1.0.0",
|
"discord.js": "^12.2.0",
|
||||||
"discord.js": "^11.5.1",
|
"js-yaml": "^3.14.0"
|
||||||
"js-yaml": "^3.13.1",
|
},
|
||||||
"table": "^5.4.4"
|
"devDependencies": {},
|
||||||
|
"scripts": {
|
||||||
|
"test": "help"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EmeraldRusher/SupportBot.git"
|
"url": "git+https://github.com/1tzemerald/SupportBot.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
|
||||||
"SupportBot",
|
|
||||||
"Emerald Services"
|
|
||||||
],
|
|
||||||
"author": "Emerald Services",
|
"author": "Emerald Services",
|
||||||
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/EmeraldRusher/SupportBot/issues"
|
"url": "https://github.com/1tzemerald/SupportBot/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://discord.gg/hmWgxdF",
|
"homepage": "https://github.com/1tzemerald/SupportBot#readme"
|
||||||
"contributors": [
|
|
||||||
"iJosGCS",
|
|
||||||
"RedstoneGamez"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
// SupportBot Addons
|
|
||||||
// Default Addon
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
const someaddon = new Discord.Client()
|
|
||||||
|
|
||||||
someaddon.settings = require("./settings/someaddon.json");
|
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
|
||||||
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")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: someaddon.settings.Addon_Example_Command,
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
"Addon_Example_Command": "addonexample"
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"ticket": "ticket-0064",
|
||||||
|
"id":207937608779694080
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"716992597377286145": {
|
||||||
|
"id": 65
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
+159
-88
@@ -1,115 +1,186 @@
|
|||||||
# _________ __ __________ __
|
# _________ __ __________ __
|
||||||
# / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
# / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
||||||
# \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
# \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
||||||
# / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
# / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
||||||
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||||
# \/ |__| |__| \/
|
# \/ |__| |__| \/
|
||||||
#
|
#
|
||||||
# SupportBot v5.1.0
|
# SupportBot version 6.0
|
||||||
# Created by © 2020 Emerald Services
|
# Created by Emerald Services
|
||||||
# License: MIT
|
# Installed with MIT License
|
||||||
|
|
||||||
#Bot Indentification
|
# General Bot Configuration
|
||||||
Token: "Bot_Token_Here"
|
|
||||||
Prefix: "!"
|
Token: "BOT_TOKEN_HERE"
|
||||||
|
Prefix: "-"
|
||||||
Bot_Name: "SupportBot"
|
Bot_Name: "SupportBot"
|
||||||
|
|
||||||
BotActivity: "SupportBot v5.1"
|
BotActivity: "!help ~ SupportBot 6.0"
|
||||||
ActivityType: "PLAYING"
|
ActivityType: "PLAYING"
|
||||||
|
# Activity status can either be PLAYING, WATCHING or LISTENING.
|
||||||
|
|
||||||
EmbedColour: "#4bbf5c"
|
# Embed Configuration
|
||||||
|
|
||||||
|
EmbedColour: "#04b545"
|
||||||
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
|
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
|
||||||
|
|
||||||
# Role Settings
|
ErrorColour: "#d12519"
|
||||||
AutoRole: "Member"
|
SuccessColour: "#04b545"
|
||||||
StaffRole: "Support"
|
WarningColour: "#fca117"
|
||||||
|
|
||||||
locked_role: "@everyone"
|
# Role Configuration
|
||||||
everyone: "@everyone"
|
|
||||||
|
|
||||||
Department_Role_1: "Support"
|
AutoRole: "true"
|
||||||
Department_Role_2: "Security"
|
# By setting "AutoRole to 'true' the bot will automatically apply the role below when members joins. Set to 'false' to disable this feature.
|
||||||
Department_Role_3: "Sales"
|
AutoRole_Role: "Member"
|
||||||
|
LockdownRole: "@everyone"
|
||||||
|
|
||||||
# Welcome & Leave
|
Staff: "Support"
|
||||||
WelcomeChannel: "welcome"
|
Admin: "Admin"
|
||||||
WelcomeMessage: "Welcome to the server!"
|
|
||||||
|
|
||||||
LeaveChannel: "welcome"
|
# Ticket Configuration
|
||||||
LeaveMessage: "Thank you for visiting us!"
|
|
||||||
|
|
||||||
# Ticket Settings
|
TicketChannel: "ticket"
|
||||||
category: "Tickets"
|
TicketCategory: "Tickets"
|
||||||
Ticket_Colour: "#000e42"
|
TicketLog: "ticket-logs"
|
||||||
Ticket_Channel_Name: "ticket"
|
TranscriptLog: "transcripts"
|
||||||
Ticket_Logs: "ticket-logs"
|
TicketSubject: "description"
|
||||||
|
# TicketSuvject: "description" means that the subject (reason) of the ticket will be displayed upon the channel description if set to "embed" it will be displayed within the embed.
|
||||||
|
|
||||||
Transcript_Log: "ticket-data"
|
Ticket_Thumbnail: "https://images.emojiterra.com/google/android-pie/512px/1f39f.png"
|
||||||
Transcript_Title: "Support Transcript"
|
Ticket_Title: "Server Support | %ticketusername%"
|
||||||
|
TicketMessage: "Hello <@%ticketauthor%>, Thank you for creating a support ticket\nPlease wait patiently whilst a member of our team reaches out to you."
|
||||||
|
NoTicketSubject: "No Reason Provided!"
|
||||||
|
TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%>"
|
||||||
|
TranscriptTitle: "Ticket Transcript"
|
||||||
|
|
||||||
Ticket_Closing: "⚠ Your ticket is now closing!"
|
AddedUser: "👍 <@%user%> has been added to this ticket"
|
||||||
Ticket_Closure: "Looks like you have come to the end of your support ticket\nPlease confirm that you want to close your ticket."
|
RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
||||||
Closure_Confirm_Word: "confirm"
|
|
||||||
|
|
||||||
Ticket_Message: "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you."
|
ClosingTicket: ":warning: You have requested to close your support ticket."
|
||||||
Default_Ticket_Reason: "No Subject"
|
ClosingConfirmation_Word: "confirm"
|
||||||
|
CloseConfirmation: "true"
|
||||||
|
# CloseConfirmation to true will make users confirm that they want to close a their ticket, settings to false will just close the ticket.
|
||||||
|
|
||||||
# Ticket Department Settings
|
# Ticket Department Configuration
|
||||||
Ticket_Department_1: "Support"
|
|
||||||
Ticket_Department_2: "Security"
|
|
||||||
Ticket_Department_3: "Sales"
|
|
||||||
|
|
||||||
Ticket_Department_Emoji_1: "🎧"
|
TicketDepartments: "true"
|
||||||
Ticket_Department_Emoji_2: "🔐"
|
# This option enable or disable the ticket departments. If set false Ticket Departments will not work
|
||||||
Ticket_Department_Emoji_3: "💵"
|
|
||||||
|
|
||||||
# Announcement Settings
|
AllowStaff: "true"
|
||||||
Announcement_Title: "SupportBot Announcement"
|
# AllowStaff is an option to whether or not you want the users with the "Staff" role to be able to view inside tickets. If set false "Staff" will not view tickets.
|
||||||
Announcement_Channel: "announcements"
|
|
||||||
Announcement_Tag_Role: "@everyone"
|
|
||||||
|
|
||||||
# Poll Settings
|
DepartmentEmoji_1: "🙋"
|
||||||
Poll_Channel": "polls"
|
DepartmentEmoji_2: "💸"
|
||||||
Poll_Title": "📊 Polls"
|
DepartmentEmoji_3: "📗"
|
||||||
|
# Ticket emojis, the emojis are what users will need to react with inorder to proceed furthur if departments are enabled.
|
||||||
|
|
||||||
Reaction_Poll_1": "✅"
|
DepartmentTitle_1: "Support"
|
||||||
Reaction_Poll_2": "❎"
|
DepartmentTitle_2: "Billing"
|
||||||
|
DepartmentTitle_3: "Other"
|
||||||
|
# Ticket department title, This is the title for a ticket department to help users know what is available.
|
||||||
|
|
||||||
# Suggestion Settings
|
DepartmentRole_1: "Support"
|
||||||
Suggestion_Title: "SupportBot Suggestions"
|
DepartmentRole_2: "Admin"
|
||||||
Suggestion_Channel: "suggestions"
|
DepartmentRole_3: "Support"
|
||||||
|
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been choosen.
|
||||||
|
|
||||||
suggestyes: "✅"
|
# System Message Configuration
|
||||||
suggestno: "❎"
|
|
||||||
|
|
||||||
# Report Settings
|
SystemMessages: "true"
|
||||||
Report_Channel: "reports"
|
|
||||||
Report_Title: "SupportBot Report"
|
|
||||||
|
|
||||||
# Link Settings
|
SystemMessage_Channel: "system-messages"
|
||||||
LINKS_TITLE: "SupportBot Links"
|
SystemMessage_Type: "embed"
|
||||||
|
# There are 2 types of how you can send system messages, 'normal' or 'embed'
|
||||||
|
SystemMessage_Icon: "USER"
|
||||||
|
|
||||||
LINKS:
|
Welcome_Title: "User Joined!"
|
||||||
"Discord": "https://discord.gg/"
|
WelcomeMessage: "Hello %member%, Welcome to %guildname%!"
|
||||||
"Twitter": "https://twitter.com/"
|
# %member% define the user who joined and %guildnamne% defines the server name.
|
||||||
"Website": "https://example.com/"
|
|
||||||
"AddMore": "AddMoreIfYouWant"
|
|
||||||
|
|
||||||
# Bot Command Settings
|
Leave_Title: "User Left!"
|
||||||
Add_Command: "add"
|
LeaveMessage: "Goodbye %member%, Thank you for visting %guildname%!"
|
||||||
Remove_Command: "remove"
|
# %member% define the user who left and %guildnamne% defines the server name.
|
||||||
Ticket_Command: "ticket"
|
|
||||||
Close_Command: "close"
|
SystemMessage_EmbedFooter: "false"
|
||||||
Forceclose_Command: "forceclose"
|
|
||||||
Rename_Command: "rename"
|
# LINKS Configuration
|
||||||
Lockchat_Command: "lock"
|
|
||||||
UnLockchat_Command: "unlock"
|
LinksTitle: "Quick Links"
|
||||||
Announcement_Command: "announce"
|
|
||||||
Say_Command: "say"
|
LINKS:
|
||||||
Suggest_Command: "suggest"
|
"Website": "https://www.example.com"
|
||||||
Ping_Command: "ping"
|
"Store": "https://store.example.com"
|
||||||
Help_Command: "help"
|
"Discord": "https://discord.gg/example"
|
||||||
Link_Command: "links"
|
# "Twitter": "https://twitter.com/example"
|
||||||
Poll_Command: "poll"
|
|
||||||
Report_Command: "report"
|
# Suggestions Configuration
|
||||||
Setup_Command: "setup"
|
|
||||||
|
SuggestionChannel: "suggestions"
|
||||||
|
SuggestionTitle: "Suggestion"
|
||||||
|
SuggestionStarter: "What would you like to suggest?"
|
||||||
|
SuggestReact_1: 👍
|
||||||
|
SuggestReact_2: 👎
|
||||||
|
|
||||||
|
# Poll Configuration
|
||||||
|
|
||||||
|
PollChannel: "polls"
|
||||||
|
PollTitle: "Suggestion"
|
||||||
|
PollStarter: "What would you like to create a poll about?"
|
||||||
|
PollReact_1: 👍
|
||||||
|
PollReact_2: 👎
|
||||||
|
|
||||||
|
|
||||||
|
# Announcement Configuration
|
||||||
|
|
||||||
|
AnnouncementChannel: "announcements"
|
||||||
|
AnnouncementTitle: "Servername Announcement"
|
||||||
|
AnnouncementIcon: "https://i.imgur.com/HbkZyB7.png"
|
||||||
|
|
||||||
|
AnnouncementStarter: "What would you like to announce?"
|
||||||
|
|
||||||
|
MentionedRole: "@everyone"
|
||||||
|
|
||||||
|
# General Command Configuration
|
||||||
|
|
||||||
|
HelpCommand: "help"
|
||||||
|
LinksCommand: "links"
|
||||||
|
PingCommand: "ping"
|
||||||
|
SuggestCommand: "suggest"
|
||||||
|
|
||||||
|
# Support Command Configuration
|
||||||
|
|
||||||
|
NewTicket: "ticket"
|
||||||
|
CloseTicket: "close"
|
||||||
|
AddUser: "add"
|
||||||
|
RemoveUser: "remove"
|
||||||
|
RenameTicket: "rename"
|
||||||
|
|
||||||
|
# Staff Command Configuration
|
||||||
|
|
||||||
|
BotSay: "say"
|
||||||
|
|
||||||
|
# Admin Command Configuration
|
||||||
|
|
||||||
|
AnnounceCommand: "announce"
|
||||||
|
|
||||||
|
# Commmand Descriptions
|
||||||
|
|
||||||
|
NewTicketDesc: "Create a new support ticket"
|
||||||
|
AnnounceDesc: "Create a server announcement"
|
||||||
|
CloseTicketDesc: "Close your support ticket"
|
||||||
|
LinksDesc: "View some important links"
|
||||||
|
PingDesc: "Get the bot's latency"
|
||||||
|
HelpDesc: "Get a list of all the commands"
|
||||||
|
RemoveUserDesc: "Remove a user from a support ticket"
|
||||||
|
AddUserDesc: "Add a user to a support ticket"
|
||||||
|
SuggestionDesc: "Create a server suggestion"
|
||||||
|
BotSayDesc: "Say something with the bot"
|
||||||
|
|
||||||
|
# Error / Warining Messages
|
||||||
|
|
||||||
|
IncorrectPerms: ":x: **Err!** You do not have the correct permissions to use this command."
|
||||||
|
InvalidChannel: ":x: **Err!** Channel not found. Please create it!"
|
||||||
|
UserNotFound: ":x: **Err!** This user doesn't exist, Are they in this server?"
|
||||||
|
NoValidTicket: ":warning: You cannot execute this command here. This command is used when closing a ticket."
|
||||||
|
TicketExists: ":warning: This ticket cannot be opened, It already exists!"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// SupportBot Utility
|
// SupportBot Utils
|
||||||
// Ticket Numbers
|
// Ticket Numbers
|
||||||
|
|
||||||
const discord = require("discord.js")
|
const discord = require("discord.js")
|
||||||
@@ -21,14 +21,14 @@ class TicketNumberID {
|
|||||||
|
|
||||||
static get(guildId) {
|
static get(guildId) {
|
||||||
|
|
||||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/TicketID.json", "utf8"));
|
||||||
|
|
||||||
if (!ticketnumberID[guildId]) {
|
if (!ticketnumberID[guildId]) {
|
||||||
ticketnumberID[guildId] = {
|
ticketnumberID[guildId] = {
|
||||||
id: 0
|
id: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
fs.writeFileSync("./storage/TicketID.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||||
if (err) console.log(err);
|
if (err) console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -41,13 +41,13 @@ class TicketNumberID {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static set(guildId, value) {
|
static set(guildId, value) {
|
||||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/TicketID.json", "utf8"));
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
ticketnumberID[guildId] = {
|
||||||
id: value
|
id: value
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
fs.writeFileSync("./storage/TicketID.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||||
if (err) console.log(err);
|
if (err) console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -55,13 +55,13 @@ class TicketNumberID {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static reset(guildId) {
|
static reset(guildId) {
|
||||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/TicketID.json", "utf8"));
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
ticketnumberID[guildId] = {
|
||||||
id: 0
|
id: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
fs.writeFileSync("./storage/TicketID.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||||
if (err) console.log(err);
|
if (err) console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -69,4 +69,4 @@ class TicketNumberID {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = TicketNumberID;
|
module.exports = TicketNumberID;
|
||||||
Reference in new issue
Block a user