Compare commits

...
143 Commits
Author SHA1 Message Date
ItzEmerald 9f469e1637 Update supportbot-config.yml 2020-01-30 21:03:17 +00:00
ItzEmerald 77fe39774d Update close.js 2020-01-30 21:02:35 +00:00
ItzEmerald 186d688ec8 Delete setup.js 2020-01-30 20:56:37 +00:00
ItzEmerald de3181b5c7 Update tickets.json 2020-01-29 21:43:06 +00:00
ItzEmerald 6d53234f7a Update supportbot-config.yml 2020-01-29 21:42:37 +00:00
ItzEmerald b0d3673f4b Update close.js 2020-01-29 21:41:56 +00:00
ItzEmerald e40083f585 Add files via upload 2020-01-29 21:40:44 +00:00
ItzEmerald f7b702fa29 Update ticket.js 2020-01-29 20:06:28 +00:00
ItzEmerald 5089a19a56 Update TicketNumber.js 2020-01-29 20:05:34 +00:00
ItzEmerald d77e9842aa Update TicketNumber.js 2020-01-29 19:59:44 +00:00
ItzEmerald 88ae76a25a Update ticket.js 2020-01-29 19:59:14 +00:00
ItzEmerald 9b0b0d10a1 Update ticket.js 2020-01-29 19:08:00 +00:00
ItzEmerald 68340a8b02 Create tickets.json 2020-01-29 18:59:22 +00:00
ItzEmerald d14f0966d5 Update TicketNumber.js 2020-01-29 18:58:58 +00:00
ItzEmerald e4b83f28c4 Update TicketNumber.js 2020-01-29 18:57:22 +00:00
ItzEmerald 1925deec90 Create TicketNumber.js 2020-01-29 18:55:32 +00:00
ItzEmerald e9ba960b29 Delete utils 2020-01-29 18:52:23 +00:00
ItzEmerald 821f0f5b60 Create utils 2020-01-29 18:52:13 +00:00
ItzEmerald 8fa8915673 Update README.md 2020-01-29 18:34:02 +00:00
ItzEmerald 5405aa469e Update README.md 2020-01-29 18:33:42 +00:00
ItzEmerald cfa50b4e8c Update README.md 2020-01-29 18:33:17 +00:00
ItzEmerald c5014baeb4 Update README.md 2020-01-29 18:32:09 +00:00
ItzEmerald c14f120ec2 Update README.md 2020-01-29 18:27:10 +00:00
ItzEmerald b72fcf39da Update help.js 2020-01-26 23:53:53 +00:00
ItzEmerald 6da3b0cba0 Update README.md 2020-01-26 22:47:39 +00:00
ItzEmerald 752387a02d Update README.md 2020-01-26 22:47:05 +00:00
ItzEmerald 32d3e1b957 Update README.md 2020-01-26 22:46:47 +00:00
ItzEmerald a029dff202 Update README.md 2020-01-26 22:44:45 +00:00
ItzEmerald 89e1b85a56 Delete settings.json 2020-01-26 22:38:25 +00:00
ItzEmerald 4350eb709c Delete old.json 2020-01-26 22:38:13 +00:00
ItzEmerald 2b1b6e916e Updated SupportBot
Pre-Release - 5.1.0
2020-01-26 22:35:45 +00:00
ItzEmerald 3f6f9045bd Update announce.js 2020-01-25 16:59:35 +00:00
ItzEmerald 8294496faa Update add.js 2020-01-25 16:56:56 +00:00
ItzEmerald 9f58118ecd Update supportbot-config.yml 2020-01-25 16:51:30 +00:00
ItzEmerald 3ba9d42587 Delete terminal.sh 2020-01-25 14:20:08 +00:00
ItzEmerald e496a5f3d0 Delete terminal.bat 2020-01-25 14:19:45 +00:00
ItzEmerald 04e2bb29b0 Update supportbot-config.yml 2020-01-25 14:09:40 +00:00
ItzEmerald 131a7a015c Update supportbot-config.yml 2020-01-25 14:03:20 +00:00
ItzEmerald 6f430f5f14 Create supportbot-config.yml 2020-01-25 13:57:23 +00:00
ItzEmerald 0154c106ef updated index.js 2020-01-25 13:55:33 +00:00
ItzEmerald 04de6e6fc0 Update index.js 2020-01-25 13:48:02 +00:00
ItzEmerald 2b17e5f842 Update index.js 2020-01-25 13:42:44 +00:00
ItzEmerald 0dc8c1e68a updated announce.js
cleaned up the code + updated the command executed message
2020-01-25 13:37:25 +00:00
ItzEmerald 67b291eb09 Update add.js 2020-01-25 13:30:13 +00:00
ItzEmerald d7865a5a4e Update add.js 2020-01-25 13:28:01 +00:00
ItzEmerald d1809587a8 Updated add.js
Cleaned and updated the code within the file alongside the console.log for executing the command.
2020-01-25 13:20:44 +00:00
ItzEmerald 64ec4dfd53 Update LICENSE 2020-01-22 22:44:36 +00:00
ItzEmerald 6e07d21a3d Create someaddon.json 2020-01-22 22:42:10 +00:00
ItzEmerald 018e47bd53 Update default-addon.js 2020-01-22 22:41:33 +00:00
ItzEmerald 065a2e9347 Update help.js 2020-01-05 21:37:08 +00:00
ItzEmerald b53307c7fd Update ticket.js 2020-01-05 16:33:31 +00:00
ItzEmerald e4cc0d960e Update ticket.js 2020-01-05 15:33:23 +00:00
ItzEmerald 3336824df7 Update close.js 2020-01-05 15:22:50 +00:00
TommyTran732 166173d53c Update entrypoint.sh 2020-01-03 04:40:13 -05:00
TommyTran732 45da2d7924 Create entrypoint.sh 2020-01-02 11:51:19 -05:00
TommyTran732 af14a65ef5 Create Dockerfile 2020-01-02 11:50:14 -05:00
ItzEmerald 9049a4b9ad Update rename.js 2019-12-11 18:17:00 +00:00
ItzEmerald 2f4873ab9a Update settings.json 2019-12-07 13:08:34 +00:00
ItzEmerald 0fb25d71dc Update rename.js 2019-12-03 23:24:43 +00:00
ItzEmerald 34b6901434 Update remove.js 2019-12-03 23:24:22 +00:00
ItzEmerald a90b43aba3 Update add.js 2019-12-03 23:24:01 +00:00
ItzEmerald 0ac5c2c300 Update forceclose.js 2019-12-03 23:23:33 +00:00
ItzEmerald 6290fee7bd Update close.js 2019-12-03 23:22:54 +00:00
ItzEmerald 320992f3fa Update ticket.js 2019-12-03 23:17:47 +00:00
ItzEmerald bd714f0c93 Update ticket.js 2019-12-03 23:15:52 +00:00
ItzEmerald 45d3867c1f Update ticket.js 2019-12-03 23:13:56 +00:00
ItzEmerald deafa66565 Update settings.json 2019-12-03 23:13:02 +00:00
ItzEmerald ce8fcdaa7a Update settings.json 2019-12-03 23:11:58 +00:00
ItzEmerald b83965c144 Update ticket.js 2019-12-03 23:10:41 +00:00
ItzEmerald 2505a8cab8 Created MIT License 2019-12-03 21:41:34 +00:00
ItzEmerald 21e598bb31 Delete LICENSE 2019-12-03 21:39:11 +00:00
ItzEmerald ee2f3c0dfc Created GNU License 2019-12-03 21:32:00 +00:00
ItzEmerald 197bda14b8 Update rename.js 2019-11-29 22:34:57 +00:00
ItzEmerald d416c2e421 Update README.md 2019-11-18 16:12:28 +00:00
ItzEmerald 6bc2e669e4 Update README.md 2019-11-18 16:12:13 +00:00
ItzEmerald 9accb65256 Update README.md 2019-11-18 16:11:23 +00:00
ItzEmerald d9212584ca Update README.md 2019-11-18 16:10:19 +00:00
ItzEmerald 1a7effb422 Update README.md 2019-11-18 16:09:37 +00:00
ItzEmerald 1480435f15 Update index.js 2019-11-18 15:53:02 +00:00
ItzEmerald 64c6a97657 Update index.js 2019-11-18 15:49:36 +00:00
ItzEmerald 7ae2ff9837 Update settings.json 2019-11-18 15:49:21 +00:00
ItzEmerald f19dec405d Updated settings.json 2019-11-18 15:29:33 +00:00
ItzEmerald bbd4e9d162 Update ticket.js 2019-11-17 22:24:05 +00:00
ItzEmerald 58deff0869 Updated close.js
Added ticket transcripts
2019-11-17 21:27:13 +00:00
ItzEmerald 628632f43e Update forceclose.js 2019-11-15 21:54:32 +00:00
ItzEmerald 436586117c Update close.js 2019-11-15 21:53:39 +00:00
ItzEmerald 7234ec728c Update close.js 2019-11-15 20:43:29 +00:00
ItzEmerald fc4d68be39 Update forceclose.js 2019-11-15 20:31:58 +00:00
ItzEmerald bcf2df4bff Update close.js 2019-11-15 20:27:10 +00:00
ItzEmerald 70a469a951 Update settings.json
Added settings for transcripts
2019-11-15 20:25:43 +00:00
ItzEmerald 981995cb32 Merge pull request #7 from iJosGCS/patch-1
Update close.js
2019-11-15 20:00:14 +00:00
Joseph Gonzalo 406c7d368b Update close.js 2019-11-15 13:58:24 -06:00
ItzEmerald 5c266d8b8d Update README.md 2019-11-01 20:27:24 +00:00
Joseph Gonzalo 4f5b94a491 Update README.md 2019-10-17 17:08:13 -06:00
ItzEmerald 284c83cc1d Update help.js 2019-09-28 17:30:57 +01:00
RedstoneGamez 23f06af202 Update README.md 2019-09-07 14:59:59 -03:00
Emerald 82be317595 Updated ticket.js
Support v4.2
2019-08-17 00:00:48 +01:00
ItzEmerald a43c76529f Delete temp.js 2019-08-16 23:54:13 +01:00
Emerald 26065c2a5c Merge remote-tracking branch 'origin/master' 2019-08-16 23:52:15 +01:00
ItzEmerald 6b1dfe01cf 4.2 2019-08-16 23:51:18 +01:00
ItzEmerald 72443fb7c6 Update README.md 2019-08-10 11:52:08 +01:00
ItzEmerald 28cad23746 Update README.md 2019-08-10 11:51:02 +01:00
Joseph Gonzalo ebc0d4b137 Update settings.json 2019-08-04 20:44:02 -06:00
Joseph Gonzalo 4b198acda7 Update README.md 2019-08-04 20:43:22 -06:00
Joseph Gonzalo b84c3c75a5 Bug fixes 2019-08-04 20:42:35 -06:00
ItzEmerald de0ec97d9b Update 4.0.1
Bug Fixes:

Announcements displaying “undefined” above the announcement message instead of a role.

Tickets not allowing users to talk
2019-08-04 00:12:49 +01:00
ItzEmerald a8302cd276 Update help.js 2019-07-25 00:25:40 +01:00
ItzEmerald 35d8d77f15 Update help.js 2019-07-25 00:25:23 +01:00
ItzEmerald f853394d9d Update settings.json 2019-07-25 00:23:47 +01:00
Joseph Gonzalo 500c01dd1f Add files via upload 2019-07-24 16:52:30 -06:00
Joseph Gonzalo 71bfccfb0c Update README.md 2019-07-24 16:51:11 -06:00
Joseph Gonzalo 71e1b64818 Update README.md 2019-07-24 16:49:51 -06:00
Joseph Gonzalo 2118a00a36 Add files via upload 2019-07-24 16:47:57 -06:00
Joseph Gonzalo 1c69c21f21 Update package.json 2019-07-24 16:47:31 -06:00
Joseph Gonzalo 31c76fc1c0 Update index.js 2019-07-24 16:45:29 -06:00
ItzEmerald d31cdf8af2 Update default-addon.js 2019-06-25 15:08:40 +01:00
ItzEmerald 29b5fd2c6f Create default-addon.js 2019-06-25 14:38:11 +01:00
ItzEmerald aa32525f8c Delete default-addon.js 2019-06-25 14:35:14 +01:00
ItzEmerald f6a67a3373 Update default-addon.js 2019-06-24 19:09:32 +01:00
Joseph Gonzalo 4f78858641 Update README.md 2019-06-19 22:56:04 -06:00
Joseph Gonzalo c7e70bdaf8 Update README.md 2019-06-19 22:37:22 -06:00
Joseph Gonzalo 5479e0957b Update README.md 2019-06-19 22:36:58 -06:00
Joseph Gonzalo 8500554cfb Update README.md 2019-06-19 22:25:27 -06:00
Joseph Gonzalo 368727cece Update settings.json 2019-06-19 22:24:51 -06:00
Joseph Gonzalo 742faf3805 Update README.md 2019-06-19 22:24:37 -06:00
Joseph Gonzalo 7d08cbed84 Update settings.json 2019-06-19 14:28:01 -06:00
Joseph Gonzalo f413bb5f3c Update suggest.js
Better look for Suggestions
2019-06-19 14:27:24 -06:00
Joseph Gonzalo 2b3edc7b45 Update README.md 2019-06-19 13:24:08 -06:00
ItzEmerald 83f982f8d2 Update help.js 2019-06-19 20:23:55 +01:00
Joseph Gonzalo 890a1d41b1 Update README.md
Help section & contributors added!
2019-06-19 13:23:37 -06:00
Joseph Gonzalo 996a2c26ca Update index.js
Replace ${bot.user.username} to ${bot.user.id} in line 44.
2019-06-19 12:58:55 -06:00
Joseph Gonzalo fadf042101 Update package.json 2019-06-19 12:57:57 -06:00
ItzEmerald a819078d7f Merge pull request #4 from iJosGCS/patch-1
Update README.md
2019-06-19 19:30:56 +01:00
ItzEmerald 2c9b4c663d Merge pull request #5 from iJosGCS/patch-2
Update index.js
2019-06-19 19:30:44 +01:00
Joseph Gonzalo 22e6803e14 Update index.js 2019-06-19 12:21:41 -06:00
Joseph Gonzalo 61cecb112f Update README.md 2019-06-19 12:19:48 -06:00
ItzEmerald 0c18aff34d Update settings.json 2019-06-18 17:25:58 +01:00
RedsoneGamez 599649a97f Update 'links' command and it's settings 2019-06-18 13:09:00 -03:00
ItzEmerald 45194b82da Update README.md 2019-06-18 17:01:19 +01:00
ItzEmerald 570d0985d3 Update README.md 2019-06-18 16:23:13 +01:00
ItzEmerald 5eae625b28 Update settings.json
Added the option to change the auto role.
2019-06-18 16:22:02 +01:00
ItzEmerald fcc5460ff2 Update index.js 2019-06-18 16:13:51 +01:00
ItzEmerald 07d45e50de Updated index.js
Added Auto Join Role
2019-06-18 16:13:38 +01:00
29 changed files with 1048 additions and 568 deletions

No files matched your search

+18
View File
@@ -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"]
+21
View File
@@ -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.
+3 -94
View File
@@ -1,94 +1,3 @@
<h1 align="center">SupportBot v3.4</h1>
<h4 align="center">A Self Hosted discord application</h4>
<p align="center">
<a href="https://discord.gg/hmWgxdF">
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=shield" alt="Discord Server">
</a>
<img src="https://img.shields.io/badge/Made%20with-NodeJS-blue.svg" alt="Made with NodeJS">
</p>
SupportBot is a free & open source discord bot for your server that has the capability to control & manage your servers support.
| Version | Supported | Type |
| ------- | ------------------ |--------------------|
| 1.0.x | ❌ | None |
| 2.0.x | ⚠ | Community |
| 3.0.x | ✅ | Priority |
| 4.0.x | ❌ | N/A |
| Premium | ❌ | N/A |
# 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.
# 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:
```
"prefix": "!",
"botname": "SupportBot",
"colour": "#42f477",
"footer": "Support Bot, By Emerald",
"BotStatus": "Support Bot",.
"staff": "Staff",
"support": "Support Team",
"everyone": "@everyone",
"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",
"Announcement_Title": "SupportBot Announcement",
"Announcement_Channel": "announcements",
"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": "❎",
"LINK_1_NAME": "Discord",
"LINK_2_NAME": "Twitter",
"LINK_3_NAME": "Website",
"LINK_1": "https://dicord.gg/changemeinconfig",
"LINK_2": "https://twitter.com/changemeinconfig",
"LINK_3": "https://www.example.com/",
"LINKS_TITLE": "SupportBot Links",
"Ticket_Command": "ticket",
"Suggest_Command": "suggest",
"Say_Command": "say",
"Remove_Command": "remove",
"Add_Command": "add",
"Ping_Command": "ping",
"Close_Command": "close",
"Forceclose_Command": "forceclose",
"Rename_Command": "rename",
"Help_Command": "help",
"Link_Command": "links",
"Lockchat_Command": "lock",
"UnLockchat_Command": "unlock",
"Poll_Command": "poll"
```
# Contributors List
# Donators List
<h1 align="center">SupportBot</h1>
<p align="center">Created by Emerald Services</p>
<h4 align="center">Our documentation is currently being rewritten, This will be updated once we push the next update (5.1). If you require our assitance please contact us in discord. https://discord.gg/bXjdkr8</h4>
+44 -42
View File
@@ -1,60 +1,62 @@
// SupportBot
// Command: Add User
// Created by © 2020 Emerald Services
// Command: Add
const Discord = require("discord.js");
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) => {
message.delete()
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
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.support)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Add_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour);
if (!staffGroup) return message.reply({embed: rolemissing});
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
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(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(supportbot.EmbedColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
const cantfinduser = new Discord.RichEmbed()
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
.setColor(bot.settings.colour)
if(!rUser) return message.channel.send({embed: cantfinduser});
const cantfinduser = new Discord.RichEmbed()
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
.setColor(supportbot.EmbedColour);
if(!rUser) return message.channel.send({embed: cantfinduser});
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
const cantfindchannel = new Discord.RichEmbed()
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
.setColor(bot.settings.colour)
if(!channel) return message.channel.send({embed: cantfindchannel});
message.delete().catch(O_o=>{});
const cantfindchannel = new Discord.RichEmbed()
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
.setColor(supportbot.EmbedColour);
if(!channel) return message.channel.send({embed: cantfindchannel});
// message.delete().catch(O_o=>{});
message.channel.overwritePermissions(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
const useradded = new Discord.RichEmbed()
.setColor(bot.settings.colour)
.setDescription(`:white_check_mark: Successfully Added ${rUser} to the ticket.`)
.setTimestamp();
message.channel.send({embed: useradded});
console.log(`\x1b[36m`, `${message.author} has successfully added ${rUser} to ${message.channel}`)
}
const useradded = new Discord.RichEmbed()
.setColor(supportbot.EmbedColour)
.setTitle("User Added")
.setDescription(`👍 ${rUser} has been added to this ticket`)
.setTimestamp();
message.channel.send({embed: useradded});
};
exports.help = {
name: bot.settings.Add_Command,
}
name: supportbot.Add_Command,
};
+54
View File
@@ -0,0 +1,54 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Announce (including @everyone)
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs")
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
message.delete();
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Announcement_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.RichEmbed()
.setTitle(`${supportbot.Announcement_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${supportbot.Announcement_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Announcement_Channel}**`)
ac.send("@everyone").then((msg) => {
ac.send(embed);
});
const AccSuccessEmbed = new Discord.RichEmbed()
.setTitle("Announcement Created")
.setDescription(`👍 Successfully sent your announcement to <#${ac.id}>`)
.setColor(supportbot.EmbedColour)
message.channel.send({embed: AccSuccessEmbed});
}
exports.help = {
name: supportbot.Announcement_Command,
}
+99 -28
View File
@@ -1,43 +1,114 @@
// SupportBot
// Command: Close Ticket
// Created by © 2020 Emerald Services
// Command: Close
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
*/
exports.run = (bot, message, args) => {
message.delete();
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
const close1 = 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**||`)
.setFooter("Your request will be avoided in 20 seconds")
.setColor(bot.settings.colour)
message.channel.send({embed: close1}).then(m => {
message.channel.awaitMessages(response => response.content === `confirm`, {
max: 1,
time: 10000,
errors: ['time'],
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}`);
}).then((collected) => {
message.channel.delete();
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
const embed = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(supportbot.EmbedColour);
}).catch(() => {
m.edit('Close ticket request, timedout').then(m2 => {
m2.delete();
}, 3000);
message.channel.send(embed);
return;
}
const closeRequestEmbed = new Discord.RichEmbed()
.setDescription(`**${supportbot.Ticket_Closure}**`)
.addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
.setFooter("Your request will be avoided in 20 seconds")
.setColor(supportbot.EmbedColour)
message.channel.send(closeRequestEmbed).then( m => {
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.Closure_Confirm_Word, {
max: 1,
time: 20000,
errors: [ 'time' ],
} ).then( collected => {
let logChannel = message.guild.channels.find( channel => channel.name === supportbot.Transcript_Logs );
let user = message.author;
let reason = args.join(" ") || "No reason provided.";
let name = message.channel.name;
let ticketChannel = message.channel;
message.channel.send(`**${supportbot.Ticket_Closing}**`)
.then( () => {
const logEmbed = new Discord.RichEmbed()
.setTitle(supportbot.Transcript_Title)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
.addField("Ticket Author", user)
.addField("Closed By", message.author.tag)
.addField("Reason", reason);
message.channel.fetchMessages({ limit: 100 })
.then( msgs => {
let txt = '';
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
txt += `${message.guild.name}\n`;
txt += `#${ticketChannel.name}\n`;
txt += `${msgs.size} messages\n\n\n`;
msgs.forEach( msg => {
if ( msg.content ) {
txt += `----- ${msg.author.tag} at ${msg.createdAt}\n`;
txt += `${msg.content}\n`;
txt += `-----\n\n`;
}
} );
// message.author.send( `A transcript has been generated for the ticket you closed.` );
// message.author.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
logChannel.send(logEmbed)
logChannel.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
message.channel.delete();
// message.channel.fetchMessages( { limit: 100, before: msgs.last().id } )
// .then( msg => {
// const merged = msgs.concat( msg );
// const output = merged.reduce( ( out, msg ) => {
// out += `[${message.createdAt}] ${message.author.tag}: ${message.cleanContent ? message.cleanContent.replace( /\n/g, '\r\n' ) : ''}\r\n`;
// return out;
// }, '' );
// log.send( { files: [ { attachment: Buffer.from( output, 'utf8' ), name: `${name}.txt` } ] } ).then( c.delete() ).catch( console.error ); // sends the file to logs
// return log.send( embed1 ).catch( console.error );
// } )
});
})
}).catch( () => {
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}`)
}
exports.help = {
name: bot.settings.Close_Command,
}
name: supportbot.Close_Command,
}
+59 -22
View File
@@ -1,36 +1,73 @@
// SupportBot
// Command: Forceclose Ticket
// Created by © 2020 Emerald Services
// Command: Forceclose
const Discord = require("discord.js");
const bot = new Discord.Client()
bot.settings = require("../settings.json");
const fs = require("fs")
const yaml = require('js-yaml');
exports.run = (bot, message, args) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.support}`)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
exports.run = async (bot, message, args) => {
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
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}`);
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
message.channel.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Forceclose_Command}`)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply({embed: rolemissing});
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(supportbot.EmbedColour)
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
const log = message.guild.channels.find(channel => channel.name === supportbot.Transcript_Logs)
const uID = message.author
const reason = args.join(" ") || "No Reason Provided.";
const name = message.channel.name;
const c = message.channel;
message.channel.send(`Your ticket is currently closing`)
.then(() => {
const embed1 = new Discord.RichEmbed()
.setTitle(supportbot.Transcript_Title)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
.addField("Ticket Author", uID)
.addField("Closed By", message.author.tag)
.addField("Reason", reason)
message.channel.fetchMessages({ limit: 100 })
.then(msgs => {
message.channel.fetchMessages({ limit: 100, before: msgs.last().id })
.then(msg => {
const merged = msgs.concat(msg);
const output = merged.reduce((out, msg) => {
out += `[${message.createdAt}] ${message.author.tag}: ${message.cleanContent ? message.cleanContent.replace(/\n/g, '\r\n') : ''}\r\n`;
return out;
}, '');
log.send({ files: [{ attachment: Buffer.from(output, 'utf8'), name: `${name}.txt` }] }).then(c.delete()).catch(console.error); // sends the file to logs
return log.send(embed1).catch(console.error);
})
});
});
}
exports.help = {
name: bot.settings.Forceclose_Command,
}
name: supportbot.Forceclose_Command,
}
+32 -27
View File
@@ -1,46 +1,51 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Help
const Discord = require("discord.js");
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) => {
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 = "";
userCommands += `**${bot.settings.prefix}${bot.settings.Link_Command}**: Get some important links!\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Ping_Command}**: Check the bots ping. Pong!\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Ticket_Command} <reason>**: Create a support ticket\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Close_Command}**: Close your support ticket\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Ticket_Command} <reason>**: Create a support ticket\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Close_Command}**: Close your support ticket\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Report_Command} <user> <reason>**: Report a valid user\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Link_Command}**: Get some important links!\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Ping_Command}**: Check the bots ping. Pong!\n`;
let supportCommands = "";
supportCommands += `**${bot.settings.prefix}${bot.settings.Add_Command} <user>**: Adds a user to a ticket\n`;
supportCommands += `**${bot.settings.prefix}${bot.settings.Remove_Command} <user>**: Removes a user from a ticket\n`;
supportCommands += `**${bot.settings.prefix}${bot.settings.Forceclose_Command}**: Forceclose a support ticket\n`;
supportCommands += `**${bot.settings.prefix}${bot.settings.Rename_Command}**: Rename a support ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Add_Command} <user>**: Adds a user to a ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Remove_Command} <user>**: Removes a user from a ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Forceclose_Command}**: Forceclose a support ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Rename_Command}**: Rename a support ticket\n`;
let staffCommands = "";
staffCommands += `**${bot.settings.prefix}${bot.settings.Say_Command} <message>**: Create a bot announcement\n`;
staffCommands += `**${bot.settings.prefix}${bot.settings.Lockchat_Command}**: Lock the chat channel\n`;
staffCommands += `**${bot.settings.prefix}${bot.settings.UnLockchat_Command}**: UnLock the chat channel\n`;
let staffCommands = "";
staffCommands += `**${supportbot.Prefix}${supportbot.Announcement_Command} <message>**: Create a bot announcement\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Say_Command} <message>**: Send a message as the bot\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Lockchat_Command}**: Lock the chat channel\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.UnLockchat_Command}**: UnLock the chat channel\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`;
const embed = new Discord.RichEmbed()
.setTitle(bot.settings.botname)
.addField(":ticket: Support Commands", userCommands)
.addField(":pushpin: Support Commands", supportCommands, true)
.addField(":pushpin: Staff Commands", staffCommands, true)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer, message.author.displayAvatarURL);
message.channel.send(embed)
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Help_Command}`)
.setTitle(supportbot.Bot_Name)
.addField("👨 User Commands", userCommands)
.addField(":pushpin: Support Commands", supportCommands)
.addField("🔑 Staff Commands", staffCommands)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL);
message.channel.send(embed);
}
exports.help = {
name: bot.settings.Help_Command,
}
name: supportbot.Help_Command,
};
+25 -19
View File
@@ -1,30 +1,36 @@
// SupportBot
// Command: Help
// Created by © 2020 Emerald Services
// Command: Links
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) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
let BotLinks = "";
BotLinks += `[${bot.settings.LINK_1_NAME}](${bot.settings.LINK_1})\n`;
BotLinks += `[${bot.settings.LINK_2_NAME}](${bot.settings.LINK_2})\n`;
BotLinks += `[${bot.settings.LINK_3_NAME}](${bot.settings.LINK_3})\n`;
exports.run = ( bot, message, args ) => {
const links = new Discord.RichEmbed()
.setTitle(`${bot.settings.LINKS_TITLE}`)
.setDescription(BotLinks)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
message.channel.send(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}`);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Link_Command}`)
let botLinks = supportbot.LINKS;
}
let links = '';
for ( let name in botLinks ) {
links += `[${name}](${botLinks[ name ]})\n`;
};
let embed = new Discord.RichEmbed()
.setTitle(supportbot.LINKS_TITLE)
.setDescription(links)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter);
message.channel.send(embed);
};
exports.help = {
name: bot.settings.Link_Command,
}
name: supportbot.Link_Command,
};
+22 -18
View File
@@ -1,38 +1,42 @@
// SupportBot
// Command: Lockchat
// Created by © 2020 Emerald Services
// Command: Close
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) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
let everyoneRole = message.guild.roles.find(everyone => everyone.name === `${bot.settings.everyone}`)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Lockchat_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
message.channel.overwritePermissions(everyoneRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
const lockmsg = new Discord.RichEmbed()
.setDescription(":white_check_mark: **Chat Locked**")
.setColor(bot.settings.colour)
message.channel.send(lockmsg)
.setColor(supportbot.EmbedColour)
message.channel.send(lockmsg);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Lockchat_Command}`)
}
};
exports.help = {
name: bot.settings.Lockchat_Command,
}
name: supportbot.Lockchat_Command,
};
+11 -8
View File
@@ -1,23 +1,26 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Ping
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) => {
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()
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
.setColor(bot.settings.colour)
.setColor(supportbot.EmbedColour)
message.channel.send(embed).catch(console.error);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ping_Command}`)
}
};
exports.help = {
name: bot.settings.Ping_Command,
name: supportbot.Ping_Command,
}
+22 -19
View File
@@ -1,46 +1,49 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Poll
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) => {
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()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Poll_Title}`)
.setTitle(`${supportbot.Poll_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer, message.author.displayAvatarURL)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Poll_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${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 **${supportbot.Poll_Channel}**`)
ac.send(embed)
.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}`)
}
};
exports.help = {
name: bot.settings.Poll_Command,
}
name: supportbot.Poll_Command,
};
+43 -40
View File
@@ -1,60 +1,63 @@
// SupportBot
// Command: Remove User
// Created by © 2020 Emerald Services
// Command: Remove
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) => {
message.delete()
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
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.support)
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()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole)
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply({embed: rolemissing});
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
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});
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()
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
.setColor(bot.settings.colour)
if(!rUser) return message.channel.send({embed: cantfinduser});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
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()
.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=>{});
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
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()
.setColor(bot.settings.colour)
.setDescription(`:white_check_mark: Successfully remove ${rUser} from the ticket.`)
.setTimestamp();
message.channel.overwritePermissions(rUser, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.send({embed: useradded});
console.log(`\x1b[36m`, `${message.author} has successfully removed ${rUser} from ${message.channel}`)
const useradded = new Discord.RichEmbed()
.setColor(supportbot.EmbedColour)
.setTitle("User Removed")
.setDescription(`👍 ${rUser} has been removed from this ticket`)
.setTimestamp();
}
message.channel.send({embed: useradded});
};
exports.help = {
name: bot.settings.Remove_Command,
}
name: supportbot.Remove_Command,
}
+27 -24
View File
@@ -1,49 +1,52 @@
// SupportBot
// Command: Close Ticket
// Created by © 2020 Emerald Services
// Command: Rename
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) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Rename_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
.setColor(supportbot.colour)
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
const renameto = args.join(" ")
message.channel.setName(`ticket-${renameto}-${message.author.username}`)
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
// Renamed Ticket Logistic
const logEmbed = new Discord.RichEmbed()
.setTitle(":ticket: Ticket Renamed")
.setDescription(`<@${message.author.id}> has renamed a ticket to ${renameto}`)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${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 **${supportbot.Ticket_Logs}**`);
logChannel.send({embed: logEmbed})
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Rename_Command}`)
logChannel.send({embed: logEmbed});
}
};
exports.help = {
name: bot.settings.Rename_Command,
}
name: supportbot.Rename_Command,
}
+20 -15
View File
@@ -1,19 +1,24 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Report
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) => {
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()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour);
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour);
if(!staffGroup) {
message.reply(rolemissing).catch(err => {
@@ -21,8 +26,8 @@ exports.run = (bot, message, args) => {
});
} else {
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if(!message.member.roles.has(staffGroup.id)) {
message.reply(donothaverole);
} else {
@@ -34,27 +39,27 @@ exports.run = (bot, message, args) => {
} else {
let reportDesc = args.slice(1).join(" ");
const embed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Report_Title}`)
.setTitle(`${supportbot.Report_Title}`)
.setThumbnail(message.author.avatarURL)
.addField("Report by:", `<@${message.author.id}>`, false)
.addField("Description:", `${reportDesc}`, false)
.addField("Reported User:", `${args[0]}`, false)
.setTimestamp(new Date())
.setColor(bot.settings.colour)
.setColor(supportbot.EmbedColour)
.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) {
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 {
rc.send(embed);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Report_Command}`);
}
}
}
}
}
}
};
exports.help = {
name: bot.settings.Report_Command
name: supportbot.Report_Command
}
+19 -19
View File
@@ -1,42 +1,42 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Say
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) => {
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()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Announcement_Title}`)
.setTitle(`${supportbot.Announcement_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(bot.settings.colour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Announcement_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Announcement_Channel}**`)
ac.send(embed)
.setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Say_Command}`)
message.channel.send(embed);
}
};
exports.help = {
name: bot.settings.Say_Command,
name: supportbot.Say_Command,
}
+25 -16
View File
@@ -1,33 +1,42 @@
// SupportBot
// Command: Suggest
// Created by © 2020 Emerald Services
// Command: Say
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) => {
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()
.setTitle(`${bot.settings.Suggestion_Title}`)
.setDescription(args.join(" "))
.setFooter(`Suggestion by ${message.author.username}`, message.author.displayAvatarURL)
.setColor(bot.settings.colour)
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${bot.settings.Suggestion_Channel}`);
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${bot.settings.Suggestion_Channel}**`);
.setTitle(`${supportbot.Suggestion_Title}`)
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
.setFooter(`${supportbot.footer}`, message.author.avatarURL)
.setTimestamp(new Date())
.setColor(supportbot.EmbedColour)
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${supportbot.Suggestion_Channel}`);
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${supportbot.Suggestion_Channel}**`);
sc.send(SuggestionEmbed)
.then(async function(msg) {
msg.react(bot.settings.suggestyes).then(() => msg.react(bot.settings.suggestno));
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
});
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Suggest_Command}`)
const SuggestionSuccessEmbed = new Discord.RichEmbed()
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${sc.id}>`)
.setColor(supportbot.EmbedColour)
message.channel.send(SuggestionSuccessEmbed);
}
};
exports.help = {
name: bot.settings.Suggest_Command,
}
name: supportbot.Suggest_Command,
}
+105 -40
View File
@@ -1,85 +1,150 @@
// SupportBot
// Command: Ticket
// Created by © 2020 Emerald Services
// Command: Say
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) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
const TicketNumberID = require('../utility/TicketNumber');
const ID = Math.floor(Math.random() * 10) + 2000;
const subject = args.join(" ") || "No Subject.";
exports.run = async (bot, message, args) => {
const alreadyopen = new Discord.RichEmbed()
.setDescription(`:x: Cannot create a ticket because **ticket-${message.author.username}** already exists.`)
.setColor(bot.settings.colour)
if (message.guild.channels.find(TicketChannel => TicketChannel.name === 'ticket-' + message.author.username)) return message.channel.send(alreadyopen);
message.guild.createChannel(`ticket-${message.author.username}`, 'text').then(TicketChannel => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Ticket_Command}`);
// Ticket Number ID Settings
let ticketNumberID = TicketNumberID.pad(message.guild.id);
// Ticket Subject Settings
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
// Ticket Limitiations
const alreadyopen = new Discord.RichEmbed()
.setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
.setColor(supportbot.EmbedColour)
// Ticket Creation
if (message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
message.guild.createChannel(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
type: 'text',
}).then(TicketChannel => {
// Roles
let staff = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.support}`)
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === `@everyone`)
let staff = message.guild.roles.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`)
// Permissions
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
// Category
let category = message.guild.channels.find(c => c.name === bot.settings.category);
let category = message.guild.channels.find(c => c.name === supportbot.category);
if (category) {
TicketChannel.setParent(category.id);
} else {
if (message.guild.channels.get(bot.settings.category)) {
TicketChannel.setParent(message.guild.channels.get(bot.settings.category).id);
if (message.guild.channels.get(supportbot.category)) {
TicketChannel.setParent(message.guild.channels.get(supportbot.category).id);
}
}
const ticketopened = new Discord.RichEmbed()
.setDescription(`:white_check_mark: <@${message.author.id}> You ticket has been created <#${TicketChannel.id}>`)
.setColor(bot.settings.colour)
.setTitle(":white_check_mark: Support Ticket Created")
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
.setColor(supportbot.Ticket_Colour)
message.channel.send({embed: ticketopened});
// Ticket Message - ( Able to edit this message via the settings.json file )
const ticketMessage = `Hi! <@${message.author.id}>\n${bot.settings.Ticket_Message}`;
const ticketMessage = `Hi! <@${message.author.id}>\n${supportbot.Ticket_Message}`;
const Department_1 = supportbot.Ticket_Department_1;
const Department_2 = supportbot.Ticket_Department_2;
const Department_3 = supportbot.Ticket_Department_3;
const Emoji_1 = supportbot.Ticket_Department_Emoji_1;
const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
const Emoji_3 = supportbot.Ticket_Department_Emoji_3;
const TicketMessage = new Discord.RichEmbed()
.setDescription(ticketMessage)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
TicketChannel.send({embed: TicketMessage});
.setDescription(ticketMessage, true)
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
.setColor(supportbot.Ticket_Colour)
.setFooter(supportbot.EmbedFooter)
if (subject != 'No Subject.') {
TicketMessage.addField("Reason", subject);
}
TicketChannel.send({embed: TicketMessage}).then(function(msg) {
msg.react(Emoji_1).then(() => msg.react(Emoji_2)).then(() => msg.react(Emoji_3));
const filter = (reaction, user) => {
return [Emoji_1, Emoji_2, Emoji_3].includes(reaction.emoji.name) && user.id !== msg.author.id;
};
msg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === `${Emoji_1}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true })
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for someone to reach out to you.")
}
if (reaction.emoji.name === `${Emoji_2}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true })
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for someone to reach out to you.")
}
if (reaction.emoji.name === `${Emoji_3}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true })
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for someone to reach out to you.")
}
});
});
if (subject != 'No Subject.') {
TicketChannel.setTopic(subject);
}
// Ticket Logging
const logEmbed = new Discord.RichEmbed()
.setTitle(":ticket: Logistics of your Ticket")
.addField("Ticket ID", ID, true)
.addField("Ticket ID", ticketNumberID, true)
.addField("User", `<@${message.author.id}>`, true)
.addField("Channel", `ticket#${ID}`, true)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
.addField("Channel", `ticket#${ticketNumberID}`, true)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
if (subject != 'No Subject.') {
logEmbed.addField('Subject', subject, true);
}
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${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 **${supportbot.Ticket_Logs}**`);
logChannel.send({embed: logEmbed})
}).catch(err=>{console.error(err)});
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ticket_Command}`)
}
};
exports.help = {
name: bot.settings.Ticket_Command,
}
name: supportbot.Ticket_Command,
};
+21 -17
View File
@@ -1,38 +1,42 @@
// SupportBot
// Command: Lockchat
// Created by © 2020 Emerald Services
// Command: Say
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) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
let everyoneRole = message.guild.roles.find(everyone => everyone.name === `${bot.settings.everyone}`)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.UnLockchat_Command}`);
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
.setColor(supportbot.EmbedColour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
message.channel.overwritePermissions(everyoneRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
const lockmsg = new Discord.RichEmbed()
.setDescription(":white_check_mark: **Chat Un-Locked**")
.setColor(bot.settings.colour)
message.channel.send(lockmsg)
.setColor(supportbot.EmbedColour);
message.channel.send(lockmsg);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.UnLockchat_Command}`)
}
};
exports.help = {
name: bot.settings.UnLockchat_Command,
name: supportbot.UnLockchat_Command,
}
+15
View File
@@ -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}
+57 -39
View File
@@ -1,23 +1,31 @@
// Resource: SupportBot
// Developed by Emerald
// Version: 3.4
// ____ _ ____ _
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
// |_| |_|
// © 2020 Created by Emerald Services
// Licnese: MIT
// SupportBot v5.1.0
const Discord = require("discord.js");
const fs = require("fs");
const bot = new Discord.Client();
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) => {
if(err) console.log(err);
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) =>{
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);
});
@@ -29,74 +37,84 @@ fs.readdir("./sb-addons/", (err, files) => {
if(err) console.log(err);
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) =>{
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.on("ready", async () => {
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
console.log(`\x1b[36m`, `=== [SupportBot] ===\n\nSupportBot - Created by Emerald Services\nInvite ${bot.user.username} to your server\nhttps://discordapp.com/api/oauth2/authorize?client_id=${bot.user.username}&permissions=8&scope=bot\n\n=== [SupportBot] ===`)
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
console.log(`\u001b[37m`, `Emerald Services has successfully connected to discord`)
console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=516372960110444574&permissions=8&scope=bot`)
console.log(`\u001b[37m`, `© ️SupportBot created by Emerald Services`)
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
});
bot.on("message", async message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
let messageArray = message.content.split(" ");
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
let messageArray = message.content.split(" ");
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
const cmd = bot.commands.get(command);
if(!cmd) return;
cmd.run(bot, message, args);
const cmd = bot.commands.get(command);
if(!cmd) return;
cmd.run(bot, message, args);
message.delete();
});
bot.on("message", async message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
let messageArray = message.content.split(" ");
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
const addon = args.shift().toLowerCase();
let messageArray = message.content.split(" ");
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const addon = args.shift().toLowerCase();
const cmd = bot.addons.get(addon);
if(!cmd) return;
cmd.run(bot, message, args);
const cmd = bot.addons.get(addon);
if(!cmd) return;
cmd.run(bot, message, args);
message.delete();
});
// [SupportBot] Welcome Message
// [SupportBot] Welcome Message && Auto Join Role
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 === `${supportbot.AutoRole}`)
const WelcomeMsg= new Discord.RichEmbed()
.setColor(bot.settings.colour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Welcome_Message}`)
.setColor(supportbot.EmbedColour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`)
channel.send(WelcomeMsg);
member.addRole(autorole).catch(console.error);
});
// [SupportBot] Leave Message
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()
.setColor(bot.settings.colour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Leave_Message}`)
.setColor(supportbot.EmbedColour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`)
channel.send(LeaveMsg);
});
bot.login(bot.settings.token);
bot.login(supportbot.Token);
+80
View File
@@ -0,0 +1,80 @@
{
"name": "SupportBot",
"version": "4.0",
"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"
}
}
}
}
+29 -9
View File
@@ -1,18 +1,38 @@
{
"name": "supportbot",
"version": "3.4",
"name": "SupportBot",
"version": "4.0",
"description": "SupportBot",
"main": "index.js",
"dependencies": {
"discord.js": "^11.4.2"
},
"devDependencies": {},
"private": "true",
"scripts": {
"test": "!help"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"engines": {
"node": "12.6.0",
"npm": "6.9.0"
},
"dependencies": {
"array-sort": "^1.0.0",
"discord.js": "^11.5.1",
"js-yaml": "^3.13.1",
"table": "^5.4.4"
},
"repository": {
"type": "git",
"url": "https://github.com/EmeraldRusher/SupportBot.git"
},
"keywords": [
"SupportBot"
"SupportBot",
"Emerald Services"
],
"author": "Emerald Services",
"homepage": "https://discord.gg/hmWgxdF"
"bugs": {
"url": "https://github.com/EmeraldRusher/SupportBot/issues"
},
"homepage": "https://discord.gg/hmWgxdF",
"contributors": [
"iJosGCS",
"RedstoneGamez"
]
}
+4 -3
View File
@@ -3,8 +3,9 @@
const Discord = require("discord.js");
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) => {
message.delete();
@@ -14,5 +15,5 @@ exports.run = async(bot, message, args) => {
}
exports.help = {
name: 'addon',
}
name: someaddon.settings.Addon_Example_Command,
}
+5
View File
@@ -0,0 +1,5 @@
{
"Addon_Example_Command": "addonexample"
}
-69
View File
@@ -1,69 +0,0 @@
{
"SupportBot": "v3.4 / Download addons @ https://itzemerald.tk/",
"token": "TOKEN",
"prefix": "!",
"botname": "SupportBot",
"colour": "#42f477",
"footer": "Support Bot, By Emerald",
"BotStatus": "Support Bot",
"staff": "Staff",
"support": "Support",
"everyone": "@everyone",
"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",
"Announcement_Title": "SupportBot Announcement",
"Announcement_Channel": "announcements",
"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",
"LINK_1_NAME": "Discord",
"LINK_2_NAME": "Twitter",
"LINK_3_NAME": "Website",
"LINK_1": "https://dicord.gg/changemeinconfig",
"LINK_2": "https://twitter.com/changemeinconfig",
"LINK_3": "https://www.example.com/",
"LINKS_TITLE": "SupportBot Links",
"Ticket_Command": "ticket",
"Suggest_Command": "suggest",
"Say_Command": "say",
"Remove_Command": "remove",
"Add_Command": "add",
"Ping_Command": "ping",
"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"
}
+1
View File
@@ -0,0 +1 @@
{}
+115
View File
@@ -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"
+72
View File
@@ -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;