Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f469e1637 | ||
|
|
77fe39774d | ||
|
|
186d688ec8 | ||
|
|
de3181b5c7 | ||
|
|
6d53234f7a | ||
|
|
b0d3673f4b | ||
|
|
e40083f585 | ||
|
|
f7b702fa29 | ||
|
|
5089a19a56 | ||
|
|
d77e9842aa | ||
|
|
88ae76a25a | ||
|
|
9b0b0d10a1 | ||
|
|
68340a8b02 | ||
|
|
d14f0966d5 | ||
|
|
e4b83f28c4 | ||
|
|
1925deec90 | ||
|
|
e9ba960b29 | ||
|
|
821f0f5b60 | ||
|
|
8fa8915673 | ||
|
|
5405aa469e | ||
|
|
cfa50b4e8c | ||
|
|
c5014baeb4 | ||
|
|
c14f120ec2 | ||
|
|
b72fcf39da | ||
|
|
6da3b0cba0 | ||
|
|
752387a02d | ||
|
|
32d3e1b957 | ||
|
|
a029dff202 | ||
|
|
89e1b85a56 | ||
|
|
4350eb709c | ||
|
|
2b1b6e916e | ||
|
|
3f6f9045bd | ||
|
|
8294496faa | ||
|
|
9f58118ecd | ||
|
|
3ba9d42587 | ||
|
|
e496a5f3d0 | ||
|
|
04e2bb29b0 | ||
|
|
131a7a015c | ||
|
|
6f430f5f14 | ||
|
|
0154c106ef | ||
|
|
04de6e6fc0 | ||
|
|
2b17e5f842 | ||
|
|
0dc8c1e68a | ||
|
|
67b291eb09 | ||
|
|
d7865a5a4e | ||
|
|
d1809587a8 | ||
|
|
64ec4dfd53 | ||
|
|
6e07d21a3d | ||
|
|
018e47bd53 | ||
|
|
065a2e9347 | ||
|
|
b53307c7fd | ||
|
|
e4cc0d960e | ||
|
|
3336824df7 | ||
|
|
166173d53c | ||
|
|
45da2d7924 | ||
|
|
af14a65ef5 | ||
|
|
9049a4b9ad | ||
|
|
2f4873ab9a | ||
|
|
0fb25d71dc | ||
|
|
34b6901434 | ||
|
|
a90b43aba3 | ||
|
|
0ac5c2c300 | ||
|
|
6290fee7bd | ||
|
|
320992f3fa | ||
|
|
bd714f0c93 | ||
|
|
45d3867c1f | ||
|
|
deafa66565 | ||
|
|
ce8fcdaa7a | ||
|
|
b83965c144 | ||
|
|
2505a8cab8 | ||
|
|
21e598bb31 | ||
|
|
ee2f3c0dfc | ||
|
|
197bda14b8 |
No files matched your search
+18
@@ -0,0 +1,18 @@
|
|||||||
|
FROM node:alpine
|
||||||
|
|
||||||
|
MAINTAINER Thien Tran, <contact@thientran.io>
|
||||||
|
|
||||||
|
RUN apk update \
|
||||||
|
&& apk upgrade
|
||||||
|
|
||||||
|
RUN apk add --no-cache git && \
|
||||||
|
adduser -D -h /home/container container
|
||||||
|
|
||||||
|
# Ensure UTF-8
|
||||||
|
ENV LANG en_US.UTF-8
|
||||||
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
|
||||||
|
WORKDIR /home/container
|
||||||
|
|
||||||
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
CMD ["/bin/ash", "/entrypoint.sh"]
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 Emerald Services
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,126 +1,3 @@
|
|||||||
<h1 align="center">SupportBot v5</h1>
|
<h1 align="center">SupportBot</h1>
|
||||||
<h4 align="center">#1 Discord Support System</h4>
|
<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>
|
||||||
<p align="center">
|
|
||||||
<img src="https://img.shields.io/badge/Made%20with-NodeJS-blue.svg" alt="Made with NodeJS">
|
|
||||||
<img src="https://img.shields.io/github/release/EmeraldRusher/SupportBot.svg" alt="GitHub release">
|
|
||||||
<img src="https://img.shields.io/github/package-json/dependency-version/EmeraldRusher/SupportBot/discord.js.svg" alt="GitHub package.json dependency version (prod)">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
SupportBot is a free & open source discord bot for your server that has the capability to control & manage your servers support.
|
|
||||||
|
|
||||||
| Version | Supported | Status |
|
|
||||||
| ------- | ------------------ |--------------------|
|
|
||||||
| 1.x | 🚫 | Discontinued |
|
|
||||||
| 2.x | 🚫 | Discontinued |
|
|
||||||
| 3.x | ✔️ | Supported |
|
|
||||||
| 4.x | ✔️ | Supported |
|
|
||||||
| 5.x | ✔️ | Supported |
|
|
||||||
|
|
||||||
# Getting Started
|
|
||||||
Firstly you will need to download the resource, Once you have downloaded the resource open a new tab in your browser and go to https://discordapp.com/developers/applications/. Create a new application and then open your app and select bot and then create your bot. Copy the bot token and paste it where it says ``"token": "BOT TOKEN HERE",`` in the ``settings.json`` file.
|
|
||||||
|
|
||||||
# Invite the bot
|
|
||||||
Head back to discord developers portal where your application is and head into the ``OAuth`` tab and select bot and then below select ``Administrator`` then copy the link and paste into your browser and it should as your to invite the bot to a server.
|
|
||||||
|
|
||||||
# Help
|
|
||||||
If you don't understand something, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [Emerald Services Server](https://discord.gg/u47MQJ).
|
|
||||||
|
|
||||||
# Configurating SupportBot
|
|
||||||
Once you have setup your discord application such as invited the bot and added your bot token to the ``settings.json`` we can begin configurating your bot. Firstly open up the ``settings.json`` file and you will see loads of different things to config. You will see the following below:
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"SupportBot": "v4.0.0",
|
|
||||||
|
|
||||||
"token": "BOT_TOKEN_HERE",
|
|
||||||
"prefix": "!",
|
|
||||||
"botname": "SupportBot",
|
|
||||||
"colour": "#13bd2a",
|
|
||||||
"footer": "Support Bot, By Emerald Services",
|
|
||||||
|
|
||||||
"BotStatus": "Support Bot",
|
|
||||||
|
|
||||||
"staff": "Staff",
|
|
||||||
"support": "Support",
|
|
||||||
"everyone": "@everyone",
|
|
||||||
"Auto_Role": "Member",
|
|
||||||
|
|
||||||
"LINKS": {
|
|
||||||
"Discord": "https://discord.gg/",
|
|
||||||
"Twitter": "https://twitter.com/",
|
|
||||||
"Website": "https://example.com/",
|
|
||||||
"AddMore": "AddMoreIfYouWant"
|
|
||||||
},
|
|
||||||
|
|
||||||
"LINKS_TITLE": "SupportBot Links",
|
|
||||||
|
|
||||||
"category": "Tickets",
|
|
||||||
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
|
|
||||||
"Ticket_Logs": "ticket-logs",
|
|
||||||
"Default_Ticket_Reason": "No Subject",
|
|
||||||
"Ticket_React_Message": ":mailbox: React to create your support ticket.",
|
|
||||||
|
|
||||||
"Commands_Log_Title": "SupportBot Logs",
|
|
||||||
"Command_Log_Channel": "command-logs",
|
|
||||||
|
|
||||||
"Announcement_Title": "SupportBot Announcement",
|
|
||||||
"Announcement_Channel": "announcements",
|
|
||||||
"Announcement_Tag_Role": "@everyone",
|
|
||||||
|
|
||||||
"Welcome_Message": "Welcome to the server!",
|
|
||||||
"Welcome_Channel": "welcome",
|
|
||||||
|
|
||||||
"Leave_Message": "Thank you for visiting us!",
|
|
||||||
"Leave_Channel": "welcome",
|
|
||||||
|
|
||||||
"Poll_Channel": "polls",
|
|
||||||
"Poll_Title": "📊 Polls",
|
|
||||||
"Reaction_Poll_1": "✅",
|
|
||||||
"Reaction_Poll_2": "❎",
|
|
||||||
|
|
||||||
"Suggestion_Title": "SupportBot Suggestions",
|
|
||||||
"Suggestion_Channel": "suggestions",
|
|
||||||
"suggestyes": "✅",
|
|
||||||
"suggestno": "❎",
|
|
||||||
|
|
||||||
"Report_Channel": "reports",
|
|
||||||
"Report_Title": "SupportBot Report",
|
|
||||||
|
|
||||||
|
|
||||||
"Announcement_Command": "announce",
|
|
||||||
"Say_Command": "say",
|
|
||||||
"Suggest_Command": "suggest",
|
|
||||||
"Ping_Command": "ping",
|
|
||||||
"Ticket_Command": "ticket",
|
|
||||||
"Remove_Command": "remove",
|
|
||||||
"Add_Command": "add",
|
|
||||||
"Close_Command": "close",
|
|
||||||
"Forceclose_Command": "forceclose",
|
|
||||||
"Rename_Command": "rename",
|
|
||||||
"Help_Command": "help",
|
|
||||||
"Link_Command": "links",
|
|
||||||
"Lockchat_Command": "lock",
|
|
||||||
"UnLockchat_Command": "unlock",
|
|
||||||
"Poll_Command": "poll",
|
|
||||||
"Report_Command": "report"
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
# Contributors List
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/RedstoneGamez">
|
|
||||||
<img src="https://cdn.discordapp.com/avatars/282610987801247744/9567e0674a5a6d371bb5d6efb956d57b.png?size=32" alt="RedstoneGamez Profile">
|
|
||||||
<strong>RedstoneGamez</strong>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# Donators List
|
|
||||||
|
|
||||||
# Community
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://discord.gg/tNt95Ba">
|
|
||||||
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=banner1" alt="Discord Server">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
+41
-54
@@ -1,75 +1,62 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Add User
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Add
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client()
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs")
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
module.exports.run = async (bot, message, args) => {
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
message.delete()
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
|
exports.run = (bot, message, args) => {
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
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}`);
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour);
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour);
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
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 cantfinduser = new Discord.RichEmbed()
|
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
||||||
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
|
||||||
|
|
||||||
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
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 cantfindchannel = new Discord.RichEmbed()
|
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
||||||
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!channel) return message.channel.send({embed: cantfindchannel});
|
|
||||||
message.delete().catch(O_o=>{});
|
|
||||||
|
|
||||||
message.channel.overwritePermissions(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
const cantfindchannel = new Discord.RichEmbed()
|
||||||
|
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
const useradded = new Discord.RichEmbed()
|
if(!channel) return message.channel.send({embed: cantfindchannel});
|
||||||
.setColor(bot.settings.colour)
|
// message.delete().catch(O_o=>{});
|
||||||
.setDescription(`:white_check_mark: Successfully Added ${rUser} to the ticket.`)
|
message.channel.overwritePermissions(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
message.channel.send({embed: useradded});
|
const useradded = new Discord.RichEmbed()
|
||||||
console.log(`\x1b[36m`, `${message.author} has successfully added ${rUser} to ${message.channel}`)
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setTitle("User Added")
|
||||||
|
.setDescription(`👍 ${rUser} has been added to this ticket`)
|
||||||
|
.setTimestamp();
|
||||||
|
message.channel.send({embed: useradded});
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
};
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Add_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Add_Command,
|
name: supportbot.Add_Command,
|
||||||
}
|
};
|
||||||
+25
-35
@@ -1,64 +1,54 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Say
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Announce (including @everyone)
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs")
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
message.delete();
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Announcement_Command}`);
|
||||||
|
|
||||||
|
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle(`${bot.settings.Announcement_Title}`)
|
.setTitle(`${supportbot.Announcement_Title}`)
|
||||||
.setDescription(args.join(" "))
|
.setDescription(args.join(" "))
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
||||||
|
|
||||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Announcement_Channel}`)
|
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 **${bot.settings.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("@everyone").then((msg) => {
|
||||||
ac.send(embed);
|
ac.send(embed);
|
||||||
});
|
});
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
const AccSuccessEmbed = new Discord.RichEmbed()
|
||||||
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
|
.setTitle("Announcement Created")
|
||||||
.setColor(bot.settings.colour)
|
.setDescription(`👍 Successfully sent your announcement to <#${ac.id}>`)
|
||||||
message.channel.send(SuggestionSuccessEmbed);
|
.setColor(supportbot.EmbedColour)
|
||||||
|
message.channel.send({embed: AccSuccessEmbed});
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Announcement_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Announcement_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Announcement_Command,
|
name: supportbot.Announcement_Command,
|
||||||
}
|
}
|
||||||
+42
-53
@@ -1,60 +1,66 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Close Ticket
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Close
|
||||||
|
|
||||||
const Discord = require( "discord.js" );
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require( "../settings.json" );
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Discord.Message} message
|
* @param {Discord.Message} message
|
||||||
*/
|
*/
|
||||||
exports.run = ( bot, message, args ) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
|
exports.run = (bot, message, args) => {
|
||||||
|
|
||||||
if ( !message.channel.name.startsWith( `ticket-` ) ) {
|
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Close_Command}`);
|
||||||
|
|
||||||
|
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setDescription( `:x: Cannot use this command becase you are outside a ticket channel.` )
|
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
||||||
.setColor( bot.settings.colour );
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
message.channel.send( embed );
|
message.channel.send(embed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeRequestEmbed = new Discord.RichEmbed()
|
const closeRequestEmbed = new Discord.RichEmbed()
|
||||||
.setDescription( `Looks like you have come to the end of your support ticket\nPlease confirm that you want to close your ticket by saying ||**confirm**||` )
|
.setDescription(`**${supportbot.Ticket_Closure}**`)
|
||||||
.setFooter( "Your request will be avoided in 20 seconds" )
|
.addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
|
||||||
.setColor( bot.settings.colour )
|
.setFooter("Your request will be avoided in 20 seconds")
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
|
||||||
message.channel.send( closeRequestEmbed ).then( m => {
|
message.channel.send(closeRequestEmbed).then( m => {
|
||||||
message.channel.awaitMessages( response => response.content.toLowerCase() === `confirm`, {
|
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.Closure_Confirm_Word, {
|
||||||
max: 1,
|
max: 1,
|
||||||
time: 20 * 1000,
|
time: 20000,
|
||||||
errors: [ 'time' ],
|
errors: [ 'time' ],
|
||||||
|
|
||||||
} ).then( collected => {
|
} ).then( collected => {
|
||||||
let logChannel = message.guild.channels.find( channel => channel.name === bot.settings.Transcript_Logs );
|
let logChannel = message.guild.channels.find( channel => channel.name === supportbot.Transcript_Logs );
|
||||||
|
|
||||||
let user = message.author;
|
let user = message.author;
|
||||||
|
|
||||||
let reason = args.join( " " ) || "No reason provided.";
|
let reason = args.join(" ") || "No reason provided.";
|
||||||
|
|
||||||
let name = message.channel.name;
|
let name = message.channel.name;
|
||||||
let ticketChannel = message.channel;
|
let ticketChannel = message.channel;
|
||||||
|
|
||||||
message.channel.send( bot.settings.Ticket_Closing )
|
message.channel.send(`**${supportbot.Ticket_Closing}**`)
|
||||||
.then( () => {
|
.then( () => {
|
||||||
const logEmbed = new Discord.RichEmbed()
|
const logEmbed = new Discord.RichEmbed()
|
||||||
.setTitle( bot.settings.Transcript_Title )
|
.setTitle(supportbot.Transcript_Title)
|
||||||
.setColor( bot.settings.colour )
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter( bot.settings.footer )
|
.setFooter(supportbot.EmbedFooter)
|
||||||
.addField( "Ticket Author", user )
|
.addField("Ticket Author", user)
|
||||||
.addField( "Closed By", message.author.tag )
|
.addField("Closed By", message.author.tag)
|
||||||
.addField( "Reason", reason );
|
.addField("Reason", reason);
|
||||||
|
|
||||||
message.channel.fetchMessages( { limit: 100 } )
|
message.channel.fetchMessages({ limit: 100 })
|
||||||
.then( msgs => {
|
.then( msgs => {
|
||||||
let txt = '';
|
let txt = '';
|
||||||
|
|
||||||
@@ -72,10 +78,10 @@ exports.run = ( bot, message, args ) => {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
message.author.send( `A transcript has been generated for the ticket you closed.` );
|
// message.author.send( `A transcript has been generated for the ticket you closed.` );
|
||||||
message.author.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
// message.author.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
||||||
|
|
||||||
logChannel.send( logEmbed );
|
logChannel.send(logEmbed)
|
||||||
logChannel.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
logChannel.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
||||||
|
|
||||||
message.channel.delete();
|
message.channel.delete();
|
||||||
@@ -92,34 +98,17 @@ exports.run = ( bot, message, args ) => {
|
|||||||
// log.send( { files: [ { attachment: Buffer.from( output, 'utf8' ), name: `${name}.txt` } ] } ).then( c.delete() ).catch( console.error ); // sends the file to logs
|
// 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 );
|
// return log.send( embed1 ).catch( console.error );
|
||||||
// } )
|
// } )
|
||||||
} );
|
});
|
||||||
} )
|
})
|
||||||
|
|
||||||
} ).catch( () => {
|
|
||||||
m.edit( 'The request to close the ticket has timed out.' ).then( m2 => m2.delete( 3000 ) );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
|
|
||||||
console.log( `\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Close_Command}` )
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle( bot.settings.Commands_Log_Title )
|
|
||||||
.addField( `User`, `<@${message.author.id}>` )
|
|
||||||
.addField( `Command`, bot.settings.Close_Command, true )
|
|
||||||
.addField( `Channel`, message.channel, true )
|
|
||||||
.addField( `Executed At`, message.createdAt, true )
|
|
||||||
.setColor( bot.settings.colour )
|
|
||||||
.setFooter( bot.settings.footer )
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find( LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}` );
|
|
||||||
if ( !CommandLog ) return message.channel.send( `:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json``` );
|
|
||||||
|
|
||||||
CommandLog.send( CMDLog );
|
|
||||||
|
|
||||||
|
}).catch( () => {
|
||||||
|
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Close_Command,
|
name: supportbot.Close_Command,
|
||||||
}
|
}
|
||||||
+36
-46
@@ -1,43 +1,50 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Forceclose Ticket
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Forceclose
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client()
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs")
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
exports.run = async (bot, message, args) => {
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
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}`);
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
const log = message.guild.channels.find(channel => channel.name === bot.settings.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 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()
|
const embed1 = new Discord.RichEmbed()
|
||||||
.setTitle(bot.settings.Transcript_Title)
|
.setTitle(supportbot.Transcript_Title)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(bot.settings.footer)
|
.setFooter(supportbot.EmbedFooter)
|
||||||
.addField("Ticket Author", uID)
|
.addField("Ticket Author", uID)
|
||||||
.addField("Closed By", message.author.tag)
|
.addField("Closed By", message.author.tag)
|
||||||
.addField("Reason", reason)
|
.addField("Reason", reason)
|
||||||
@@ -57,27 +64,10 @@ if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({em
|
|||||||
return log.send(embed1).catch(console.error);
|
return log.send(embed1).catch(console.error);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Forceclose_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Forceclose_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Forceclose_Command,
|
name: supportbot.Forceclose_Command,
|
||||||
}
|
}
|
||||||
+32
-44
@@ -1,63 +1,51 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
|
// Created by © 2020 Emerald Services
|
||||||
// Command: Help
|
// Command: Help
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client()
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs")
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Help_Command}`);
|
||||||
|
|
||||||
let userCommands = "";
|
let userCommands = "";
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Link_Command}**: Get some important links!\n`;
|
userCommands += `**${supportbot.Prefix}${supportbot.Ticket_Command} <reason>**: Create a support ticket\n`;
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ping_Command}**: Check the bots ping. Pong!\n`;
|
userCommands += `**${supportbot.Prefix}${supportbot.Close_Command}**: Close your support ticket\n`;
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ticket_Command} <reason>**: Create a support ticket\n`;
|
userCommands += `**${supportbot.Prefix}${supportbot.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Close_Command}**: Close your support ticket\n`;
|
userCommands += `**${supportbot.Prefix}${supportbot.Report_Command} <user> <reason>**: Report a valid user\n`;
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
|
userCommands += `**${supportbot.Prefix}${supportbot.Link_Command}**: Get some important links!\n`;
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Report_Command} <user> <reason>**: Create a server suggestion\n`;
|
userCommands += `**${supportbot.Prefix}${supportbot.Ping_Command}**: Check the bots ping. Pong!\n`;
|
||||||
|
|
||||||
let supportCommands = "";
|
let supportCommands = "";
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Add_Command} <user>**: Adds a user to a ticket\n`;
|
supportCommands += `**${supportbot.Prefix}${supportbot.Add_Command} <user>**: Adds a user to a ticket\n`;
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Remove_Command} <user>**: Removes a user from a ticket\n`;
|
supportCommands += `**${supportbot.Prefix}${supportbot.Remove_Command} <user>**: Removes a user from a ticket\n`;
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Forceclose_Command}**: Forceclose a support ticket\n`;
|
supportCommands += `**${supportbot.Prefix}${supportbot.Forceclose_Command}**: Forceclose a support ticket\n`;
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Rename_Command}**: Rename a support ticket\n`;
|
supportCommands += `**${supportbot.Prefix}${supportbot.Rename_Command}**: Rename a support ticket\n`;
|
||||||
|
|
||||||
let staffCommands = "";
|
let staffCommands = "";
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Announcement_Command} <message>**: Create a bot announcement\n`;
|
staffCommands += `**${supportbot.Prefix}${supportbot.Announcement_Command} <message>**: Create a bot announcement\n`;
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Say_Command} <message>**: Send a message as the bot\n`;
|
staffCommands += `**${supportbot.Prefix}${supportbot.Say_Command} <message>**: Send a message as the bot\n`;
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Lockchat_Command}**: Lock the chat channel\n`;
|
staffCommands += `**${supportbot.Prefix}${supportbot.Lockchat_Command}**: Lock the chat channel\n`;
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.UnLockchat_Command}**: UnLock the chat channel\n`;
|
staffCommands += `**${supportbot.Prefix}${supportbot.UnLockchat_Command}**: UnLock the chat channel\n`;
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Poll_Command}**: Create a poll\n`;
|
staffCommands += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`;
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle(bot.settings.botname)
|
.setTitle(supportbot.Bot_Name)
|
||||||
.addField(":ticket: Support Commands", userCommands)
|
.addField("👨 User Commands", userCommands)
|
||||||
.addField(":pushpin: Support Commands", supportCommands, true)
|
.addField(":pushpin: Support Commands", supportCommands)
|
||||||
.addField(":pushpin: Staff Commands", staffCommands, true)
|
.addField("🔑 Staff Commands", staffCommands)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(bot.settings.footer, message.author.displayAvatarURL);
|
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL);
|
||||||
|
message.channel.send(embed);
|
||||||
message.channel.send(embed)
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Help_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Help_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via settings.json`);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Help_Command,
|
name: supportbot.Help_Command,
|
||||||
}
|
};
|
||||||
+20
-32
@@ -1,48 +1,36 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Help
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Links
|
||||||
|
|
||||||
const Discord = require( "discord.js" );
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require( "../settings.json" );
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
exports.run = ( bot, message, args ) => {
|
exports.run = ( bot, message, args ) => {
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let botLinks = bot.settings.LINKS;
|
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}`);
|
||||||
|
|
||||||
|
let botLinks = supportbot.LINKS;
|
||||||
|
|
||||||
let links = '';
|
let links = '';
|
||||||
|
|
||||||
for ( let name in botLinks ) {
|
for ( let name in botLinks ) {
|
||||||
links += `[${name}](${botLinks[ name ]})\n`;
|
links += `[${name}](${botLinks[ name ]})\n`;
|
||||||
}
|
};
|
||||||
|
|
||||||
let embed = new Discord.RichEmbed()
|
let embed = new Discord.RichEmbed()
|
||||||
.setTitle( bot.settings.LINKS_TITLE )
|
.setTitle(supportbot.LINKS_TITLE)
|
||||||
.setDescription( links )
|
.setDescription(links)
|
||||||
.setColor( bot.settings.colour )
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter( bot.settings.footer )
|
.setFooter(supportbot.EmbedFooter);
|
||||||
|
message.channel.send(embed);
|
||||||
|
|
||||||
message.channel.send( embed );
|
};
|
||||||
|
|
||||||
console.log( `\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Link_Command}` )
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Link_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Link_Command,
|
name: supportbot.Link_Command,
|
||||||
}
|
};
|
||||||
+20
-31
@@ -1,25 +1,30 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Lockchat
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Close
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
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) => {
|
exports.run = async(bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
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 lockedRole = message.guild.roles.find(lc => lc.name === `${bot.settings.locked_role}`)
|
|
||||||
|
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()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||||
|
|
||||||
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
||||||
@@ -27,27 +32,11 @@ exports.run = async(bot, message, args) => {
|
|||||||
|
|
||||||
const lockmsg = new Discord.RichEmbed()
|
const lockmsg = new Discord.RichEmbed()
|
||||||
.setDescription(":white_check_mark: **Chat Locked**")
|
.setDescription(":white_check_mark: **Chat Locked**")
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
message.channel.send(lockmsg)
|
message.channel.send(lockmsg);
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Lockchat_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Lockchat_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Lockchat_Command,
|
name: supportbot.Lockchat_Command,
|
||||||
}
|
};
|
||||||
+11
-22
@@ -1,37 +1,26 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
|
// Created by © 2020 Emerald Services
|
||||||
// Command: Ping
|
// Command: Ping
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Ping_Command}`);
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
|
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
message.channel.send(embed).catch(console.error);
|
message.channel.send(embed).catch(console.error);
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ping_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Ping_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Ping_Command,
|
name: supportbot.Ping_Command,
|
||||||
}
|
}
|
||||||
+22
-33
@@ -1,60 +1,49 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
|
// Created by © 2020 Emerald Services
|
||||||
// Command: Poll
|
// Command: Poll
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
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()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle(`${bot.settings.Poll_Title}`)
|
.setTitle(`${supportbot.Poll_Title}`)
|
||||||
.setDescription(args.join(" "))
|
.setDescription(args.join(" "))
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(bot.settings.footer, message.author.displayAvatarURL)
|
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
|
||||||
|
|
||||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Poll_Channel}`)
|
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 **${bot.settings.Poll_Channel}**`)
|
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Poll_Channel}**`)
|
||||||
|
|
||||||
ac.send(embed)
|
ac.send(embed)
|
||||||
|
|
||||||
.then(async function(msg) {
|
.then(async function(msg) {
|
||||||
msg.react(bot.settings.Reaction_Poll_1).then(() => msg.react(bot.settings.Reaction_Poll_2));
|
msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2));
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Poll_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Close_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Poll_Command,
|
name: supportbot.Poll_Command,
|
||||||
}
|
};
|
||||||
+41
-52
@@ -1,74 +1,63 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Remove User
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Remove
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
module.exports.run = async (bot, message, args) => {
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
message.delete()
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
|
exports.run = async (bot, message, args) => {
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
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}`);
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole)
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
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 cantfinduser = new Discord.RichEmbed()
|
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
||||||
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
|
||||||
|
|
||||||
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
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 cantfindchannel = new Discord.RichEmbed()
|
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
||||||
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!channel) return message.channel.send({embed: cantfindchannel});
|
|
||||||
message.delete().catch(O_o=>{});
|
|
||||||
|
|
||||||
message.channel.overwritePermissions(rUser, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
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=>{});
|
||||||
|
|
||||||
const useradded = new Discord.RichEmbed()
|
message.channel.overwritePermissions(rUser, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setDescription(`:white_check_mark: Successfully remove ${rUser} from the ticket.`)
|
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
message.channel.send({embed: useradded});
|
const useradded = new Discord.RichEmbed()
|
||||||
console.log(`\x1b[36m`, `${message.author} has successfully removed ${rUser} from ${message.channel}`)
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setTitle("User Removed")
|
||||||
|
.setDescription(`👍 ${rUser} has been removed from this ticket`)
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
message.channel.send({embed: useradded});
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Remove_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
};
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Remove_Command,
|
name: supportbot.Remove_Command,
|
||||||
}
|
}
|
||||||
+26
-37
@@ -1,63 +1,52 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Close Ticket
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Rename
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
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()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.colour)
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.colour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
const outsideticket = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.colour)
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
|
||||||
const renameto = args.join(" ")
|
const renameto = args.join(" ")
|
||||||
message.channel.setName(`ticket-${renameto}-${message.author.username}`)
|
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
|
||||||
|
|
||||||
// Renamed Ticket Logistic
|
// Renamed Ticket Logistic
|
||||||
const logEmbed = new Discord.RichEmbed()
|
const logEmbed = new Discord.RichEmbed()
|
||||||
.setTitle(":ticket: Ticket Renamed")
|
.setTitle(":ticket: Ticket Renamed")
|
||||||
.setDescription(`<@${message.author.id}> has renamed a ticket to ${renameto}`)
|
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(bot.settings.footer)
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
|
||||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
|
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 **${bot.settings.Ticket_Logs}**`);
|
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
|
||||||
|
|
||||||
logChannel.send({embed: logEmbed})
|
logChannel.send({embed: logEmbed});
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Rename_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Rename_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Rename_Command,
|
name: supportbot.Rename_Command,
|
||||||
}
|
}
|
||||||
+19
-29
@@ -1,19 +1,24 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
|
// Created by © 2020 Emerald Services
|
||||||
// Command: Report
|
// Command: Report
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`);
|
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()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
if(!staffGroup) {
|
if(!staffGroup) {
|
||||||
message.reply(rolemissing).catch(err => {
|
message.reply(rolemissing).catch(err => {
|
||||||
@@ -21,8 +26,8 @@ exports.run = (bot, message, args) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if(!message.member.roles.has(staffGroup.id)) {
|
if(!message.member.roles.has(staffGroup.id)) {
|
||||||
message.reply(donothaverole);
|
message.reply(donothaverole);
|
||||||
} else {
|
} else {
|
||||||
@@ -34,42 +39,27 @@ exports.run = (bot, message, args) => {
|
|||||||
} else {
|
} else {
|
||||||
let reportDesc = args.slice(1).join(" ");
|
let reportDesc = args.slice(1).join(" ");
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle(`${bot.settings.Report_Title}`)
|
.setTitle(`${supportbot.Report_Title}`)
|
||||||
.setThumbnail(message.author.avatarURL)
|
.setThumbnail(message.author.avatarURL)
|
||||||
.addField("Report by:", `<@${message.author.id}>`, false)
|
.addField("Report by:", `<@${message.author.id}>`, false)
|
||||||
.addField("Description:", `${reportDesc}`, false)
|
.addField("Description:", `${reportDesc}`, false)
|
||||||
.addField("Reported User:", `${args[0]}`, false)
|
.addField("Reported User:", `${args[0]}`, false)
|
||||||
.setTimestamp(new Date())
|
.setTimestamp(new Date())
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
|
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
|
||||||
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${bot.settings.Report_Channel}`)
|
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${supportbot.Report_Channel}`)
|
||||||
if(!rc) {
|
if(!rc) {
|
||||||
message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Report_Channel}**`);
|
message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Report_Channel}**`);
|
||||||
} else {
|
} else {
|
||||||
rc.send(embed);
|
rc.send(embed);
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Report_Command}`);
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Report_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Report_Command
|
name: supportbot.Report_Command
|
||||||
}
|
}
|
||||||
+17
-27
@@ -1,52 +1,42 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
|
// Created by © 2020 Emerald Services
|
||||||
// Command: Say
|
// Command: Say
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
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()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle(`${bot.settings.Announcement_Title}`)
|
.setTitle(`${supportbot.Announcement_Title}`)
|
||||||
.setDescription(args.join(" "))
|
.setDescription(args.join(" "))
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
||||||
|
|
||||||
message.channel.send(embed);
|
message.channel.send(embed);
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Say_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Say_Command, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Say_Command,
|
name: supportbot.Say_Command,
|
||||||
}
|
}
|
||||||
@@ -1,294 +0,0 @@
|
|||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async (bot, message, args) => {
|
|
||||||
if (message.guild.owner === message.member) {
|
|
||||||
message.delete(1000);
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle("SupportBot Setup Mode")
|
|
||||||
.setColor("#fff")
|
|
||||||
.setDescription(`${bot.settings.botname} is about to enter **Setup Mode**.\nThis means that all the roles & channels that are\nrequired to allow supportbot to work will be created.`)
|
|
||||||
.setFooter("Setup mode will expire in 60 seconds")
|
|
||||||
message.channel.send(embed).then((msg) => {
|
|
||||||
msg.react("✅");
|
|
||||||
const filter = (reaction, user) => reaction.emoji.name === "✅" && user.id === message.author.id;
|
|
||||||
msg.awaitReactions(filter, {
|
|
||||||
max: 1,
|
|
||||||
time: 60000,
|
|
||||||
errors: ["time"]
|
|
||||||
}).then(async (collected) => {
|
|
||||||
msg.clearReactions();
|
|
||||||
|
|
||||||
const embed1 = new Discord.RichEmbed()
|
|
||||||
.setTitle("SupportBot Setup Mode")
|
|
||||||
.setColor("#fff")
|
|
||||||
.setDescription(`${bot.settings.botname} has activated **Setup Mode**\nPlease allow a couple minutes for the process to be complete.`)
|
|
||||||
msg.edit(embed1).then((m) => {
|
|
||||||
m.delete(5000);
|
|
||||||
m.edit(":white_check_mark: **Success!** You\'r server is ready, thanks for using SupportBot by Emerald Services.");
|
|
||||||
});
|
|
||||||
const reaction = collected.first();
|
|
||||||
if (reaction.emoji.name === "✅") {
|
|
||||||
// Roles
|
|
||||||
let supportRole = bot.settings.support;
|
|
||||||
let staffRole = bot.settings.staff;
|
|
||||||
let autoRole = bot.settings.Auto_Role;
|
|
||||||
let Department_Role_1 = bot.settings.Department_Role_1
|
|
||||||
let Department_Role_2 = bot.settings.Department_Role_2
|
|
||||||
let Department_Role_3 = bot.settings.Department_Role_3
|
|
||||||
|
|
||||||
|
|
||||||
// Channels & Categories
|
|
||||||
let generalCategory = bot.settings.General_Category;
|
|
||||||
let informationCategory = bot.settings.InformationCategory;
|
|
||||||
let ticketCategory = bot.settings.category;
|
|
||||||
let staffCategory = bot.settings.StaffCategory;
|
|
||||||
let accessChannel = bot.settings.Access_Channel;
|
|
||||||
let announceChannel = bot.settings.Announcement_Channel;
|
|
||||||
let suggestChannel = bot.settings.Suggestion_Channel;
|
|
||||||
let reportsChannel = bot.settings.Report_Channel;
|
|
||||||
let ticketsChannel = bot.settings.Tickets_Channel;
|
|
||||||
let ticketsVoice1 = bot.settings.TicketsVoice1;
|
|
||||||
let ticketsVoice2 = bot.settings.TicketsVoice2;
|
|
||||||
let generalChannel = bot.settings.GeneralChannel;
|
|
||||||
let pollsChannel = bot.settings.Poll_Channel;
|
|
||||||
let botSpam = bot.settings.BotSpam_Channel;
|
|
||||||
let staffGeneral = bot.settings.StaffChat;
|
|
||||||
let staffCommands = bot.settings.StaffCmds;
|
|
||||||
let staffVoice = bot.settings.StaffVoice;
|
|
||||||
let ticketLogs = bot.settings.Ticket_Logs;
|
|
||||||
let commandLogs = bot.settings.Command_Log_Channel;
|
|
||||||
|
|
||||||
// Information Category
|
|
||||||
await message.guild.createChannel(`${informationCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 1
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${accessChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
topic: `${bot.settings.Access_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${announceChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 2,
|
|
||||||
topic: `${bot.settings.Announcement_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${pollsChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 3,
|
|
||||||
topic: `${bot.settings.Poll_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${suggestChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 4,
|
|
||||||
topic: `${bot.settings.Suggestion_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${reportsChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 5,
|
|
||||||
topic: `${bot.settings.Report_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// General Category
|
|
||||||
await message.guild.createChannel(`${generalCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 2
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${generalChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
topic: `${bot.settings.GeneralTopic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${botSpam}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 2,
|
|
||||||
topic: `${bot.settings.BotSpam_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// Support Category
|
|
||||||
await message.guild.createChannel(`${ticketCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 3
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${ticketsChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
topic: `${bot.settings.Tickets_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${ticketsVoice1}`, {
|
|
||||||
type: "voice",
|
|
||||||
position: 2,
|
|
||||||
parent: cat,
|
|
||||||
userLimit: 2,
|
|
||||||
speakable: true,
|
|
||||||
joineable: true
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${ticketsVoice2}`, {
|
|
||||||
type: "voice",
|
|
||||||
position: 3,
|
|
||||||
parent: cat,
|
|
||||||
userLimit: 2,
|
|
||||||
speakable: true,
|
|
||||||
joineable: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// Staff Category (Private)
|
|
||||||
await message.guild.createChannel(`${staffCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 4
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${staffGeneral}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${staffCommands}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 2,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${staffVoice}`, {
|
|
||||||
type: "voice",
|
|
||||||
position: 3,
|
|
||||||
parent: cat,
|
|
||||||
joineable: true,
|
|
||||||
speakable: true
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${ticketLogs}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 4,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${commandLogs}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 5,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${staffRole}`,
|
|
||||||
color: "#ff0000",
|
|
||||||
position: 1,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": true,
|
|
||||||
"MANAGE_GUILD": true,
|
|
||||||
"MENTION_EVERYONE": true,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: true
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${autoRole}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": false,
|
|
||||||
"VIEW_AUDIT_LOG": false,
|
|
||||||
"MANAGE_NICKNAMES": false,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": false,
|
|
||||||
"PRIORITY_SPEAKER": false
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${Department_Role_1}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${Department_Role_2}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${Department_Role_3}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
message.channel.send(":x: **Error:** You don't have permissions to use this command.").then((msg) => {
|
|
||||||
msg.delete(5000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Setup_Command
|
|
||||||
}
|
|
||||||
+19
-30
@@ -1,53 +1,42 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Suggest
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Say
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
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) => {
|
exports.run = async(bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Suggest_Command}`);
|
||||||
|
|
||||||
const SuggestionEmbed = new Discord.RichEmbed()
|
const SuggestionEmbed = new Discord.RichEmbed()
|
||||||
.setTitle(`${bot.settings.Suggestion_Title}`)
|
.setTitle(`${supportbot.Suggestion_Title}`)
|
||||||
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
|
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
|
||||||
.setFooter(`${bot.settings.footer}`, message.author.avatarURL)
|
.setFooter(`${supportbot.footer}`, message.author.avatarURL)
|
||||||
.setTimestamp(new Date())
|
.setTimestamp(new Date())
|
||||||
.setColor(bot.settings.colour);
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${bot.settings.Suggestion_Channel}`);
|
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 **${bot.settings.Suggestion_Channel}**`);
|
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${supportbot.Suggestion_Channel}**`);
|
||||||
|
|
||||||
sc.send(SuggestionEmbed)
|
sc.send(SuggestionEmbed)
|
||||||
|
|
||||||
.then(async function(msg) {
|
.then(async function(msg) {
|
||||||
msg.react(bot.settings.suggestyes).then(() => msg.react(bot.settings.suggestno));
|
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
|
||||||
});
|
});
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
||||||
.setDescription(`:white_check_mark: You have successfully created your suggestion. <#${sc.id}>`)
|
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${sc.id}>`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
message.channel.send(SuggestionSuccessEmbed);
|
message.channel.send(SuggestionSuccessEmbed);
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Suggest_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Suggest_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**`);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Suggest_Command,
|
name: supportbot.Suggest_Command,
|
||||||
}
|
}
|
||||||
+56
-59
@@ -1,31 +1,43 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Ticket
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Say
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
const fs = require("fs");
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
message.delete();
|
const TicketNumberID = require('../utility/TicketNumber');
|
||||||
|
|
||||||
const ID = Math.floor(Math.random() * 10) + 2000;
|
exports.run = async (bot, message, args) => {
|
||||||
const subject = args.join(" ") || `${bot.settings.Default_Ticket_Reason}`;
|
|
||||||
|
|
||||||
const alreadyopen = new Discord.RichEmbed()
|
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}`);
|
||||||
.setDescription(`:x: Cannot create a ticket because **ticket-${message.author.username}** already exists.`)
|
|
||||||
.setColor(bot.settings.colour)
|
// Ticket Number ID Settings
|
||||||
if (message.guild.channels.find(TicketChannel => TicketChannel.name === 'ticket-' + message.author.username)) return message.channel.send(alreadyopen);
|
let ticketNumberID = TicketNumberID.pad(message.guild.id);
|
||||||
message.guild.createChannel(`ticket-${message.author.username}`, {
|
|
||||||
type: 'text',
|
// Ticket Subject Settings
|
||||||
}).then(TicketChannel => {
|
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
|
// Roles
|
||||||
let staff = message.guild.roles.find(supportRole => supportRole.name === `${bot.settings.staff}`)
|
let staff = message.guild.roles.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
|
||||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
|
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
|
||||||
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_1}`)
|
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
|
||||||
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_2}`)
|
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
|
||||||
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_3}`)
|
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`)
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
||||||
@@ -37,12 +49,12 @@ exports.run = (bot, message, args) => {
|
|||||||
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
let category = message.guild.channels.find(c => c.name === bot.settings.category);
|
let category = message.guild.channels.find(c => c.name === supportbot.category);
|
||||||
if (category) {
|
if (category) {
|
||||||
TicketChannel.setParent(category.id);
|
TicketChannel.setParent(category.id);
|
||||||
} else {
|
} else {
|
||||||
if (message.guild.channels.get(bot.settings.category)) {
|
if (message.guild.channels.get(supportbot.category)) {
|
||||||
TicketChannel.setParent(message.guild.channels.get(bot.settings.category).id);
|
TicketChannel.setParent(message.guild.channels.get(supportbot.category).id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,27 +62,27 @@ exports.run = (bot, message, args) => {
|
|||||||
.setTitle(":white_check_mark: Support Ticket Created")
|
.setTitle(":white_check_mark: Support Ticket Created")
|
||||||
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
|
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
|
||||||
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
|
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
|
||||||
.setColor(bot.settings.Ticket_Colour)
|
.setColor(supportbot.Ticket_Colour)
|
||||||
message.channel.send({embed: ticketopened});
|
message.channel.send({embed: ticketopened});
|
||||||
// Ticket Message - ( Able to edit this message via the settings.json file )
|
// Ticket Message - ( Able to edit this message via the settings.json file )
|
||||||
const ticketMessage = `Hi! <@${message.author.id}>\n${bot.settings.Ticket_Message}`;
|
const ticketMessage = `Hi! <@${message.author.id}>\n${supportbot.Ticket_Message}`;
|
||||||
|
|
||||||
const Department_1 = bot.settings.Ticket_Department_1;
|
const Department_1 = supportbot.Ticket_Department_1;
|
||||||
const Department_2 = bot.settings.Ticket_Department_2;
|
const Department_2 = supportbot.Ticket_Department_2;
|
||||||
const Department_3 = bot.settings.Ticket_Department_3;
|
const Department_3 = supportbot.Ticket_Department_3;
|
||||||
|
|
||||||
const Emoji_1 = bot.settings.Ticket_Department_Emoji_1;
|
const Emoji_1 = supportbot.Ticket_Department_Emoji_1;
|
||||||
const Emoji_2 = bot.settings.Ticket_Department_Emoji_2;
|
const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
|
||||||
const Emoji_3 = bot.settings.Ticket_Department_Emoji_3;
|
const Emoji_3 = supportbot.Ticket_Department_Emoji_3;
|
||||||
|
|
||||||
const TicketMessage = new Discord.RichEmbed()
|
const TicketMessage = new Discord.RichEmbed()
|
||||||
.setDescription(ticketMessage, true)
|
.setDescription(ticketMessage, true)
|
||||||
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
|
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
|
||||||
.setColor(bot.settings.Ticket_Colour)
|
.setColor(supportbot.Ticket_Colour)
|
||||||
.setFooter(bot.settings.footer)
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
if (subject != 'No Subject.') {
|
||||||
TicketChannel.setTopic(subject);
|
TicketMessage.addField("Reason", subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -90,21 +102,21 @@ exports.run = (bot, message, args) => {
|
|||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
|
|
||||||
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for somone to reach out to you.")
|
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for someone to reach out to you.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reaction.emoji.name === `${Emoji_2}`) {
|
if (reaction.emoji.name === `${Emoji_2}`) {
|
||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
|
|
||||||
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for somone to reach out to you.")
|
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for someone to reach out to you.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reaction.emoji.name === `${Emoji_3}`) {
|
if (reaction.emoji.name === `${Emoji_3}`) {
|
||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
||||||
|
|
||||||
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for somone to reach out to you.")
|
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for someone to reach out to you.")
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -114,40 +126,25 @@ exports.run = (bot, message, args) => {
|
|||||||
// Ticket Logging
|
// Ticket Logging
|
||||||
const logEmbed = new Discord.RichEmbed()
|
const logEmbed = new Discord.RichEmbed()
|
||||||
.setTitle(":ticket: Logistics of your Ticket")
|
.setTitle(":ticket: Logistics of your Ticket")
|
||||||
.addField("Ticket ID", ID, true)
|
.addField("Ticket ID", ticketNumberID, true)
|
||||||
.addField("User", `<@${message.author.id}>`, true)
|
.addField("User", `<@${message.author.id}>`, true)
|
||||||
.addField("Channel", `ticket#${ID}`, true)
|
.addField("Channel", `ticket#${ticketNumberID}`, true)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(bot.settings.footer)
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
if (subject != 'No Subject.') {
|
||||||
logEmbed.addField('Subject', subject, true);
|
logEmbed.addField('Subject', subject, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
|
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 **${bot.settings.Ticket_Logs}**`);
|
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
|
||||||
|
|
||||||
logChannel.send({embed: logEmbed})
|
logChannel.send({embed: logEmbed})
|
||||||
|
|
||||||
}).catch(err=>{console.error(err)});
|
}).catch(err=>{console.error(err)});
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ticket_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Ticket_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Ticket_Command,
|
name: supportbot.Ticket_Command,
|
||||||
}
|
};
|
||||||
+20
-30
@@ -1,52 +1,42 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Lockchat
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Say
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
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) => {
|
exports.run = async(bot, message, args) => {
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
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 lockedRole = message.guild.roles.find(lc => lc.name === `${bot.settings.locked_role}`)
|
|
||||||
|
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()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
const donothaverole = new Discord.RichEmbed()
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||||
|
|
||||||
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
||||||
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
||||||
|
|
||||||
const lockmsg = new Discord.RichEmbed()
|
const lockmsg = new Discord.RichEmbed()
|
||||||
.setDescription(":white_check_mark: **Chat Un-Locked**")
|
.setDescription(":white_check_mark: **Chat Un-Locked**")
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour);
|
||||||
message.channel.send(lockmsg)
|
message.channel.send(lockmsg);
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.UnLockchat_Command}`)
|
};
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.UnLockchat_Command, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.UnLockchat_Command,
|
name: supportbot.UnLockchat_Command,
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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}
|
||||||
@@ -4,27 +4,28 @@
|
|||||||
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
|
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
|
||||||
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
|
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
|
||||||
// |_| |_|
|
// |_| |_|
|
||||||
|
// © 2020 Created by Emerald Services
|
||||||
// Resource: SupportBot
|
// Licnese: MIT
|
||||||
// Developed by Emerald Services
|
// SupportBot v5.1.0
|
||||||
// Version: 5.0.0
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const bot = new Discord.Client();
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.commands = new Discord.Collection();
|
bot.commands = new Discord.Collection();
|
||||||
bot.settings = require("./settings.json");
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
fs.readdir("./commands/", (err, files) => {
|
fs.readdir("./commands/", (err, files) => {
|
||||||
if(err) console.log(err);
|
if(err) console.log(err);
|
||||||
|
|
||||||
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
||||||
if(jsfile.length <= 0) return console.log(`${bot.settings.botname} No commands found. Try to Re-download the resource`);
|
if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No commands found. Try to Re-download the resource`);
|
||||||
|
|
||||||
jsfile.forEach((f, i) =>{
|
jsfile.forEach((f, i) =>{
|
||||||
let props = require(`./commands/${f}`);
|
let props = require(`./commands/${f}`);
|
||||||
console.log(`[${bot.settings.botname}] > Command Loaded > ${f}`);
|
console.log(`[${supportbot.Bot_Name}] > Command Loaded > ${f}`);
|
||||||
bot.commands.set(props.help.name, props);
|
bot.commands.set(props.help.name, props);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -36,65 +37,66 @@ fs.readdir("./sb-addons/", (err, files) => {
|
|||||||
if(err) console.log(err);
|
if(err) console.log(err);
|
||||||
|
|
||||||
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
||||||
if(jsfile.length <= 0) return console.log(`${bot.settings.botname} No addons detected nor default! Either download addons from https://itzemerald.tk/`);
|
if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No addons detected nor default! Either download addons from https://itzemerald.tk/`);
|
||||||
|
|
||||||
jsfile.forEach((f, i) =>{
|
jsfile.forEach((f, i) =>{
|
||||||
let props = require(`./sb-addons/${f}`);
|
let props = require(`./sb-addons/${f}`);
|
||||||
console.log(`[${bot.settings.botname}] > Addons Loaded > ${f}`);
|
console.log(`[${supportbot.Bot_Name}] > Addons Loaded > ${f}`);
|
||||||
bot.addons.set(props.help.name, props);
|
bot.addons.set(props.help.name, props);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.on("ready", async () => {
|
bot.on("ready", async () => {
|
||||||
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
|
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
|
||||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||||
console.log(`\u001b[37m`, `Emerald Services has successfully connected to discord`)
|
console.log(`\u001b[37m`, `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`, `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[37m`, `© ️SupportBot created by Emerald Services`)
|
||||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||||
console.log(`\u001b[43;1m \u001b[37m \u001b[1m`, `If you require any assistance you can contact us at discord, https://discord.gg/tNt95Ba`)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.on("message", async message => {
|
bot.on("message", async message => {
|
||||||
if(message.author.bot) return;
|
if(message.author.bot) return;
|
||||||
if(message.channel.type === "dm") return;
|
if(message.channel.type === "dm") return;
|
||||||
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
|
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
let messageArray = message.content.split(" ");
|
||||||
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
|
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
||||||
const command = args.shift().toLowerCase();
|
const command = args.shift().toLowerCase();
|
||||||
|
|
||||||
const cmd = bot.commands.get(command);
|
const cmd = bot.commands.get(command);
|
||||||
if(!cmd) return;
|
if(!cmd) return;
|
||||||
cmd.run(bot, message, args);
|
cmd.run(bot, message, args);
|
||||||
|
message.delete();
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.on("message", async message => {
|
bot.on("message", async message => {
|
||||||
if(message.author.bot) return;
|
if(message.author.bot) return;
|
||||||
if(message.channel.type === "dm") return;
|
if(message.channel.type === "dm") return;
|
||||||
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
|
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
let messageArray = message.content.split(" ");
|
||||||
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
|
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
||||||
const addon = args.shift().toLowerCase();
|
const addon = args.shift().toLowerCase();
|
||||||
|
|
||||||
const cmd = bot.addons.get(addon);
|
const cmd = bot.addons.get(addon);
|
||||||
if(!cmd) return;
|
if(!cmd) return;
|
||||||
cmd.run(bot, message, args);
|
cmd.run(bot, message, args);
|
||||||
|
message.delete();
|
||||||
});
|
});
|
||||||
|
|
||||||
// [SupportBot] Welcome Message && Auto Join Role
|
// [SupportBot] Welcome Message && Auto Join Role
|
||||||
|
|
||||||
bot.on("guildMemberAdd", (member) => {
|
bot.on("guildMemberAdd", (member) => {
|
||||||
let channel = member.guild.channels.find(channel => channel.name === `${bot.settings.Welcome_Channel}`)
|
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
|
||||||
let autorole = member.guild.roles.find(autorole => autorole.name === `${bot.settings.Auto_Role}`)
|
let autorole = member.guild.roles.find(autorole => autorole.name === `${supportbot.AutoRole}`)
|
||||||
|
|
||||||
const WelcomeMsg= new Discord.RichEmbed()
|
const WelcomeMsg= new Discord.RichEmbed()
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setThumbnail(member.user.avatarURL)
|
.setThumbnail(member.user.avatarURL)
|
||||||
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Welcome_Message}`)
|
.setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`)
|
||||||
|
|
||||||
channel.send(WelcomeMsg);
|
channel.send(WelcomeMsg);
|
||||||
member.addRole(autorole).catch(console.error);
|
member.addRole(autorole).catch(console.error);
|
||||||
@@ -104,15 +106,15 @@ bot.on("guildMemberAdd", (member) => {
|
|||||||
// [SupportBot] Leave Message
|
// [SupportBot] Leave Message
|
||||||
|
|
||||||
bot.on("guildMemberRemove", (member) => {
|
bot.on("guildMemberRemove", (member) => {
|
||||||
let channel = member.guild.channels.find(channel => channel.name === `${bot.settings.Leave_Channel}`)
|
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.LeaveChannel}`)
|
||||||
|
|
||||||
const LeaveMsg= new Discord.RichEmbed()
|
const LeaveMsg= new Discord.RichEmbed()
|
||||||
.setColor(bot.settings.colour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setThumbnail(member.user.avatarURL)
|
.setThumbnail(member.user.avatarURL)
|
||||||
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Leave_Message}`)
|
.setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`)
|
||||||
|
|
||||||
channel.send(LeaveMsg);
|
channel.send(LeaveMsg);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.login(bot.settings.token);
|
bot.login(supportbot.Token);
|
||||||
Generated
+76
-1
@@ -1,5 +1,80 @@
|
|||||||
{
|
{
|
||||||
"name": "SupportBot",
|
"name": "SupportBot",
|
||||||
"version": "4.0",
|
"version": "4.0",
|
||||||
"lockfileVersion": 1
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"argparse": {
|
||||||
|
"version": "1.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||||
|
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||||
|
"requires": {
|
||||||
|
"sprintf-js": "~1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"async-limiter": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
||||||
|
},
|
||||||
|
"discord.js": {
|
||||||
|
"version": "11.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.5.1.tgz",
|
||||||
|
"integrity": "sha512-tGhV5xaZXE3Z+4uXJb3hYM6gQ1NmnSxp9PClcsSAYFVRzH6AJH74040mO3afPDMWEAlj8XsoPXXTJHTxesqcGw==",
|
||||||
|
"requires": {
|
||||||
|
"long": "^4.0.0",
|
||||||
|
"prism-media": "^0.0.3",
|
||||||
|
"snekfetch": "^3.6.4",
|
||||||
|
"tweetnacl": "^1.0.0",
|
||||||
|
"ws": "^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"esprima": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||||
|
},
|
||||||
|
"js-yaml": {
|
||||||
|
"version": "3.13.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
|
||||||
|
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
|
||||||
|
"requires": {
|
||||||
|
"argparse": "^1.0.7",
|
||||||
|
"esprima": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"long": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
|
||||||
|
},
|
||||||
|
"prism-media": {
|
||||||
|
"version": "0.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.3.tgz",
|
||||||
|
"integrity": "sha512-c9KkNifSMU/iXT8FFTaBwBMr+rdVcN+H/uNv1o+CuFeTThNZNTOrQ+RgXA1yL/DeLk098duAeRPP3QNPNbhxYQ=="
|
||||||
|
},
|
||||||
|
"snekfetch": {
|
||||||
|
"version": "3.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz",
|
||||||
|
"integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw=="
|
||||||
|
},
|
||||||
|
"sprintf-js": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||||
|
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||||
|
},
|
||||||
|
"tweetnacl": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-+8aPRjmXgf1VqvyxSlBUzKzeYqVS9Ai8vZ28g+mL7dNQl1jlUTCMDZnvNQdAS1xTywMkIXwJsfipsR/6s2+syw=="
|
||||||
|
},
|
||||||
|
"ws": {
|
||||||
|
"version": "6.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
|
||||||
|
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
|
||||||
|
"requires": {
|
||||||
|
"async-limiter": "~1.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"array-sort": "^1.0.0",
|
"array-sort": "^1.0.0",
|
||||||
"discord.js": "^11.5.1",
|
"discord.js": "^11.5.1",
|
||||||
|
"js-yaml": "^3.13.1",
|
||||||
"table": "^5.4.4"
|
"table": "^5.4.4"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client()
|
||||||
|
const someaddon = new Discord.Client()
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
someaddon.settings = require("./settings/someaddon.json");
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
exports.run = async(bot, message, args) => {
|
||||||
message.delete();
|
message.delete();
|
||||||
@@ -14,5 +15,5 @@ exports.run = async(bot, message, args) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: 'addon',
|
name: someaddon.settings.Addon_Example_Command,
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
"Addon_Example_Command": "addonexample"
|
||||||
|
|
||||||
|
}
|
||||||
-105
@@ -1,105 +0,0 @@
|
|||||||
{
|
|
||||||
"SupportBot": "v5.0",
|
|
||||||
|
|
||||||
"token": "BOT_TOKEN_HERE",
|
|
||||||
"prefix": "-",
|
|
||||||
"botname": "SupportBot",
|
|
||||||
"colour": "#13bd2a",
|
|
||||||
"footer": "Support Bot, By Emerald Services",
|
|
||||||
"BotStatus": "Support Bot",
|
|
||||||
|
|
||||||
"staff": "Staff",
|
|
||||||
|
|
||||||
"locked_role": "@everyone",
|
|
||||||
"everyone": "@everyone",
|
|
||||||
"Auto_Role": "Member",
|
|
||||||
|
|
||||||
"Department_Role_1": "Support",
|
|
||||||
"Department_Role_2": "Security",
|
|
||||||
"Department_Role_3": "Sales",
|
|
||||||
|
|
||||||
"category": "Tickets",
|
|
||||||
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
|
|
||||||
"Ticket_Logs": "ticket-logs",
|
|
||||||
"Default_Ticket_Reason": "No Subject",
|
|
||||||
|
|
||||||
"Ticket_Colour": "#000e42",
|
|
||||||
"Transcript_Logs": "ticket-data",
|
|
||||||
"Transcript_Title": "Support Transcript",
|
|
||||||
"Ticket_Closing": "Your ticket is currently closing",
|
|
||||||
|
|
||||||
"Ticket_Department_1": "Support",
|
|
||||||
"Ticket_Department_2": "Security",
|
|
||||||
"Ticket_Department_3": "Sales",
|
|
||||||
|
|
||||||
"Ticket_Department_Emoji_1": "🎧",
|
|
||||||
"Ticket_Department_Emoji_2": "🔐",
|
|
||||||
"Ticket_Department_Emoji_3": "💵",
|
|
||||||
|
|
||||||
"General_Category": "General",
|
|
||||||
"InformationCategory": "Information",
|
|
||||||
"StaffCategory": "Staff",
|
|
||||||
|
|
||||||
"Access_Channel": "welcome",
|
|
||||||
"GeneralChannel": "general",
|
|
||||||
"BotSpam_Channel": "bot-spam",
|
|
||||||
"Tickets_Channel": "open-a-ticket",
|
|
||||||
"StaffChat": "staff-chat",
|
|
||||||
"StaffCmds": "staff-commands",
|
|
||||||
"StaffVoice": "Staff Room",
|
|
||||||
"TicketsVoice1": "Support Lounge",
|
|
||||||
"TicketsVoice2": "Support Lounge",
|
|
||||||
|
|
||||||
"Commands_Log_Title": "SupportBot Logs",
|
|
||||||
"Command_Log_Channel": "command-logs",
|
|
||||||
|
|
||||||
"Announcement_Title": "SupportBot Announcement",
|
|
||||||
"Announcement_Channel": "announcements",
|
|
||||||
"Announcement_Tag_Role": "@everyone",
|
|
||||||
|
|
||||||
"Welcome_Message": "Welcome to the server!",
|
|
||||||
"Welcome_Channel": "welcome",
|
|
||||||
|
|
||||||
"Leave_Message": "Thank you for visiting us!",
|
|
||||||
"Leave_Channel": "welcome",
|
|
||||||
|
|
||||||
"Poll_Channel": "polls",
|
|
||||||
"Poll_Title": "📊 Polls",
|
|
||||||
"Reaction_Poll_1": "✅",
|
|
||||||
"Reaction_Poll_2": "❎",
|
|
||||||
|
|
||||||
"Suggestion_Title": "SupportBot Suggestions",
|
|
||||||
"Suggestion_Channel": "suggestions",
|
|
||||||
"suggestyes": "✅",
|
|
||||||
"suggestno": "❎",
|
|
||||||
|
|
||||||
"Report_Channel": "reports",
|
|
||||||
"Report_Title": "SupportBot Report",
|
|
||||||
|
|
||||||
"LINKS_TITLE": "SupportBot Links",
|
|
||||||
|
|
||||||
"LINKS": {
|
|
||||||
"Discord": "https://discord.gg/",
|
|
||||||
"Twitter": "https://twitter.com/",
|
|
||||||
"Website": "https://example.com/",
|
|
||||||
"AddMore": "AddMoreIfYouWant"
|
|
||||||
},
|
|
||||||
|
|
||||||
"Announcement_Command": "announce",
|
|
||||||
"Say_Command": "say",
|
|
||||||
"Suggest_Command": "suggest",
|
|
||||||
"Ping_Command": "ping",
|
|
||||||
"Ticket_Command": "ticket",
|
|
||||||
"Remove_Command": "remove",
|
|
||||||
"Add_Command": "add",
|
|
||||||
"Close_Command": "close",
|
|
||||||
"Forceclose_Command": "forceclose",
|
|
||||||
"Rename_Command": "rename",
|
|
||||||
"Help_Command": "help",
|
|
||||||
"Link_Command": "links",
|
|
||||||
"Lockchat_Command": "lock",
|
|
||||||
"UnLockchat_Command": "unlock",
|
|
||||||
"Poll_Command": "poll",
|
|
||||||
"Report_Command": "report",
|
|
||||||
"Setup_Command": "setup"
|
|
||||||
}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# _________ __ __________ __
|
||||||
|
# / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
||||||
|
# \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
||||||
|
# / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
||||||
|
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||||
|
# \/ |__| |__| \/
|
||||||
|
#
|
||||||
|
# SupportBot v5.1.0
|
||||||
|
# Created by © 2020 Emerald Services
|
||||||
|
# License: MIT
|
||||||
|
|
||||||
|
#Bot Indentification
|
||||||
|
Token: "Bot_Token_Here"
|
||||||
|
Prefix: "!"
|
||||||
|
Bot_Name: "SupportBot"
|
||||||
|
|
||||||
|
BotActivity: "SupportBot v5.1"
|
||||||
|
ActivityType: "PLAYING"
|
||||||
|
|
||||||
|
EmbedColour: "#4bbf5c"
|
||||||
|
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
|
||||||
|
|
||||||
|
# Role Settings
|
||||||
|
AutoRole: "Member"
|
||||||
|
StaffRole: "Support"
|
||||||
|
|
||||||
|
locked_role: "@everyone"
|
||||||
|
everyone: "@everyone"
|
||||||
|
|
||||||
|
Department_Role_1: "Support"
|
||||||
|
Department_Role_2: "Security"
|
||||||
|
Department_Role_3: "Sales"
|
||||||
|
|
||||||
|
# Welcome & Leave
|
||||||
|
WelcomeChannel: "welcome"
|
||||||
|
WelcomeMessage: "Welcome to the server!"
|
||||||
|
|
||||||
|
LeaveChannel: "welcome"
|
||||||
|
LeaveMessage: "Thank you for visiting us!"
|
||||||
|
|
||||||
|
# Ticket Settings
|
||||||
|
category: "Tickets"
|
||||||
|
Ticket_Colour: "#000e42"
|
||||||
|
Ticket_Channel_Name: "ticket"
|
||||||
|
Ticket_Logs: "ticket-logs"
|
||||||
|
|
||||||
|
Transcript_Log: "ticket-data"
|
||||||
|
Transcript_Title: "Support Transcript"
|
||||||
|
|
||||||
|
Ticket_Closing: "⚠ Your ticket is now closing!"
|
||||||
|
Ticket_Closure: "Looks like you have come to the end of your support ticket\nPlease confirm that you want to close your ticket."
|
||||||
|
Closure_Confirm_Word: "confirm"
|
||||||
|
|
||||||
|
Ticket_Message: "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you."
|
||||||
|
Default_Ticket_Reason: "No Subject"
|
||||||
|
|
||||||
|
# Ticket Department Settings
|
||||||
|
Ticket_Department_1: "Support"
|
||||||
|
Ticket_Department_2: "Security"
|
||||||
|
Ticket_Department_3: "Sales"
|
||||||
|
|
||||||
|
Ticket_Department_Emoji_1: "🎧"
|
||||||
|
Ticket_Department_Emoji_2: "🔐"
|
||||||
|
Ticket_Department_Emoji_3: "💵"
|
||||||
|
|
||||||
|
# Announcement Settings
|
||||||
|
Announcement_Title: "SupportBot Announcement"
|
||||||
|
Announcement_Channel: "announcements"
|
||||||
|
Announcement_Tag_Role: "@everyone"
|
||||||
|
|
||||||
|
# Poll Settings
|
||||||
|
Poll_Channel": "polls"
|
||||||
|
Poll_Title": "📊 Polls"
|
||||||
|
|
||||||
|
Reaction_Poll_1": "✅"
|
||||||
|
Reaction_Poll_2": "❎"
|
||||||
|
|
||||||
|
# Suggestion Settings
|
||||||
|
Suggestion_Title: "SupportBot Suggestions"
|
||||||
|
Suggestion_Channel: "suggestions"
|
||||||
|
|
||||||
|
suggestyes: "✅"
|
||||||
|
suggestno: "❎"
|
||||||
|
|
||||||
|
# Report Settings
|
||||||
|
Report_Channel: "reports"
|
||||||
|
Report_Title: "SupportBot Report"
|
||||||
|
|
||||||
|
# Link Settings
|
||||||
|
LINKS_TITLE: "SupportBot Links"
|
||||||
|
|
||||||
|
LINKS:
|
||||||
|
"Discord": "https://discord.gg/"
|
||||||
|
"Twitter": "https://twitter.com/"
|
||||||
|
"Website": "https://example.com/"
|
||||||
|
"AddMore": "AddMoreIfYouWant"
|
||||||
|
|
||||||
|
# Bot Command Settings
|
||||||
|
Add_Command: "add"
|
||||||
|
Remove_Command: "remove"
|
||||||
|
Ticket_Command: "ticket"
|
||||||
|
Close_Command: "close"
|
||||||
|
Forceclose_Command: "forceclose"
|
||||||
|
Rename_Command: "rename"
|
||||||
|
Lockchat_Command: "lock"
|
||||||
|
UnLockchat_Command: "unlock"
|
||||||
|
Announcement_Command: "announce"
|
||||||
|
Say_Command: "say"
|
||||||
|
Suggest_Command: "suggest"
|
||||||
|
Ping_Command: "ping"
|
||||||
|
Help_Command: "help"
|
||||||
|
Link_Command: "links"
|
||||||
|
Poll_Command: "poll"
|
||||||
|
Report_Command: "report"
|
||||||
|
Setup_Command: "setup"
|
||||||
@@ -1 +0,0 @@
|
|||||||
node index.js
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node index.js
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
// SupportBot Utility
|
||||||
|
// Ticket Numbers
|
||||||
|
|
||||||
|
const discord = require("discord.js")
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
class TicketNumberID {
|
||||||
|
|
||||||
|
static pad(guildId) {
|
||||||
|
let n = this.get(guildId) + '';
|
||||||
|
let z = '0';
|
||||||
|
let width = 4;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.set(guildId, this.get(guildId) + 1);
|
||||||
|
}, 50);
|
||||||
|
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get(guildId) {
|
||||||
|
|
||||||
|
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
||||||
|
|
||||||
|
if (!ticketnumberID[guildId]) {
|
||||||
|
ticketnumberID[guildId] = {
|
||||||
|
id: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||||
|
if (err) console.log(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return ticketnumberID[guildId].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static set(guildId, value) {
|
||||||
|
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
||||||
|
|
||||||
|
ticketnumberID[guildId] = {
|
||||||
|
id: value
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||||
|
if (err) console.log(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static reset(guildId) {
|
||||||
|
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
||||||
|
|
||||||
|
ticketnumberID[guildId] = {
|
||||||
|
id: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||||
|
if (err) console.log(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = TicketNumberID;
|
||||||
Reference in new issue
Block a user