Compare commits

..
156 Commits
Author SHA1 Message Date
ItzEmerald 50258dc359 Update index.js 2020-04-21 20:20:42 +01:00
ItzEmerald d9c6b7698f Update index.js 2020-04-21 19:37:28 +01:00
ItzEmerald f042f34ae2 Update index.js 2020-04-21 19:24:15 +01:00
ItzEmerald c087edc14f Update suggest.js 2020-04-18 22:49:03 +01:00
ItzEmerald d96ccc3265 Update add.js 2020-04-17 02:59:25 +01:00
ItzEmerald 018ef19efd Update remove.js 2020-04-17 02:56:10 +01:00
ItzEmerald 159317a15a Update remove.js 2020-04-17 02:55:25 +01:00
ItzEmerald 34583c96bf Update add.js 2020-04-17 02:54:20 +01:00
ItzEmerald 887d3d3ab4 Update ticket.js 2020-04-17 02:48:38 +01:00
ItzEmerald f2de39de33 Updated 5.2 2020-04-16 16:43:16 +01:00
ItzEmerald 8173c31a60 Update supportbot-config.yml 2020-04-15 16:18:31 +01:00
ItzEmerald 80a2871741 Update ping.js 2020-04-15 15:08:13 +01:00
ItzEmerald 3b37e9c420 Updated say.js
Updated RichEmbed to MessageEmbed
2020-04-15 15:07:20 +01:00
ItzEmerald 730ba561bc Update index.js 2020-04-15 15:05:56 +01:00
ItzEmerald 4d7ddc9d6f Update ping.js 2020-04-14 22:45:51 +01:00
ItzEmerald 680f71a602 Merge pull request #15 from real2two/patch-14
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:53:50 +01:00
ItzEmerald 170a7b50b9 Merge pull request #16 from real2two/patch-13
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:53:14 +01:00
ItzEmerald 805c48c1bb Merge pull request #17 from real2two/patch-15
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:53:03 +01:00
ItzEmerald 7d92ed51bb Merge pull request #18 from real2two/patch-16
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:49 +01:00
ItzEmerald f849897f29 Merge pull request #19 from real2two/patch-10
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:32 +01:00
ItzEmerald 75e0f1ad1e Merge pull request #20 from real2two/patch-11
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:15 +01:00
ItzEmerald 2f015aff2b Merge pull request #21 from real2two/patch-12
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:52:03 +01:00
ItzEmerald bb322adb2f Merge pull request #22 from real2two/patch-7
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:51:14 +01:00
ItzEmerald 6ee0981885 Merge pull request #23 from real2two/patch-8
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:51:02 +01:00
ItzEmerald 877fb0f201 Merge pull request #24 from real2two/patch-9
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:50:39 +01:00
ItzEmerald ded4b9094a Merge pull request #25 from real2two/patch-4
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:50:07 +01:00
ItzEmerald 36ab931998 Merge pull request #26 from real2two/patch-5
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:49:54 +01:00
ItzEmerald 20baddfcca Merge pull request #27 from real2two/patch-6
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:49:36 +01:00
ItzEmerald d180c147db Merge pull request #28 from real2two/patch-1
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:49:20 +01:00
ItzEmerald 86fa91cc52 Merge pull request #29 from real2two/patch-2
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:48:53 +01:00
ItzEmerald b8c12a0307 Merge pull request #30 from real2two/patch-3
Changed all RichEmbed to MessageEmbed.
2020-04-08 17:48:24 +01:00
Two eff2f9c195 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:27 -04:00
Two 8a8597afef Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:23 -04:00
Two 067e619488 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:17 -04:00
Two f7f8bc8c55 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:07 -04:00
Two 0c71fd7e59 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:15:06 -04:00
Two 5b2bd21c06 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:57 -04:00
Two 9ac68f68e2 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:42 -04:00
Two aa32f00b0d Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:35 -04:00
Two bd5f5dffad Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:28 -04:00
Two 645ad63f4f Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:23 -04:00
Two c83c6afecc Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:18 -04:00
Two 689a191d4c Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:14:10 -04:00
Two 5767ba0de5 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:13:57 -04:00
Two cdf78f2598 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:13:51 -04:00
Two d23f46ad9e Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:11:48 -04:00
Two 8453fa5007 Changed all RichEmbed to MessageEmbed.
This is order to add discord.js v12 support.
2020-04-06 18:10:32 -04:00
ItzEmerald 0bd990a9e3 updated index.js 2020-03-31 09:57:39 +01:00
ItzEmerald 9c8ee1471b updated version number 2020-03-31 09:56:09 +01:00
ItzEmerald 87262e82a3 Update forceclose.js 2020-03-31 00:15:10 +01:00
ItzEmerald 953db88ed2 Update close.js 2020-03-31 00:14:47 +01:00
doge a44bb949eb Merge pull request #13 from 1tzemerald/version-5.2
Update README.md
2020-03-12 20:28:49 -04:00
doge 9d11369059 Update README.md 2020-03-12 20:28:02 -04:00
ItzEmerald 8c92f39349 Delete package-lock.json 2020-02-23 13:13:31 +00:00
ItzEmerald bce9d733d3 Update package.json 2020-02-23 13:13:12 +00:00
ItzEmerald 525c216401 Update suggest.js 2020-02-09 13:14:10 +00:00
ItzEmerald c145e9f11d Update README.md 2020-02-04 10:42:59 +00:00
ItzEmerald 53700003f1 Update README.md 2020-02-04 10:41:12 +00:00
ItzEmerald 03094a4c35 Update README.md 2020-02-04 10:39:09 +00:00
ItzEmerald 934ebed24f Update ticket.js 2020-02-02 12:06:04 +00:00
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
32 changed files with 976 additions and 1340 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.
+5 -135
View File
@@ -1,135 +1,5 @@
<h1 align="center">SupportBot v4.0.1</h1> <h1 align="center">SupportBot</h1>
<h4 align="center">A Self Hosted discord application</h4> <p align="center">Created by Emerald SRV</p>
<p align="center"> SupportBot is a free self-hosted discord that is developed/designed to help control and manage the support that takes place throughout your discord server(s). SupportBot has been going around since late-2018 and it's still being constantly, updated and supported today. Alongside the core features of SupportBot which is support related features such as tickets etc.. we also allow additional addons which are made by both 3rd-party and official developers. If something goes wrong with SupportBot you can simply come to our discord server and contact us. We will be happy to help. Also! if anyone ever tells you that "nothing is free" then tell them to think again. Sometimes you just have to look a little harder to find what you want.</p>
<p align="center"> Version 5.2
<a href="https://discord.gg/hmWgxdF"> <hr>
<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">
<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 |
| Premium | ❌ | Not released yet |
# 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/iJosGCS">
<img src="https://cdn.discordapp.com/avatars/199237487648833556/cdd7d976b75698b19e3c6b64e1dcdceb.png?size=32" alt="iJosGCS Profile">
<strong>@iJosGCS</strong>
</a>
</p>
<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/hmWgxdF">
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=banner1" alt="Discord Server">
</a>
</p>
+39 -62
View File
@@ -1,75 +1,52 @@
// 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()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.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});
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 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=>{});
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 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); let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
} const outsideticket = new Discord.MessageEmbed()
.setTitle("Incorrect Channel")
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
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.cache.get(args[0]));
const cantfinduser = new Discord.MessageEmbed()
.setTitle("Invalid User!")
.setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Add_Command} <user#0000>\``)
.setColor(supportbot.WarningColour);
if(!rUser) return message.channel.send({embed: cantfinduser});
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
const useradded = new Discord.MessageEmbed()
.setColor(supportbot.SuccessColour)
.setTitle("User Added")
.setDescription(`👍 ${rUser} has been added to this ticket`)
.setTimestamp();
message.channel.send({embed: useradded});
};
exports.help = { exports.help = {
name: bot.settings.Add_Command, name: supportbot.Add_Command,
} };
+36 -45
View File
@@ -1,64 +1,55 @@
// 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'));
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`) exports.run = (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.Announcement_Command}`);
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour) let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
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)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.RichEmbed() const rolerequired = new Discord.MessageEmbed()
.setTitle(`${bot.settings.Announcement_Title}`) .setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const embed = new Discord.MessageEmbed()
.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}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Announcement_Channel}**`)
ac.send("@everyone").then((msg) => { let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Announcement_Channel}`)
ac.send(embed);
const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Announcement_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(supportbot.everyone).then((msg) => {
locateChannel.send(embed);
}); });
const SuggestionSuccessEmbed = new Discord.RichEmbed()
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
.setColor(bot.settings.colour)
message.channel.send(SuggestionSuccessEmbed);
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);
const AccSuccessEmbed = new Discord.MessageEmbed()
.setTitle("Announcement Created")
.setDescription(`👍 Successfully sent your announcement to <#${locateChannel.id}>`)
.setColor(supportbot.EmbedColour)
message.channel.send({embed: AccSuccessEmbed});
} }
exports.help = { exports.help = {
name: bot.settings.Announcement_Command, name: supportbot.Announcement_Command,
} }
+101 -43
View File
@@ -1,58 +1,116 @@
// 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
*/
exports.run = (bot, message, args) => { exports.run = (bot, message, args) => {
message.delete();
const outsideticket = 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.Close_Command}`);
.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'],
}).then((collected) => { if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
message.channel.delete(); const embed = new Discord.MessageEmbed()
.setTitle("Incorrect Channel")
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
message.channel.send(embed);
return;
}
}).catch(() => { const closeRequestEmbed = new Discord.MessageEmbed()
m.edit('Close ticket request, timedout').then(m2 => { .setDescription(`**${supportbot.Ticket_Closure}**`)
m2.delete(); .addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
}, 3000); .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.cache.find(channel => channel.name === supportbot.Transcript_Log);
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.MessageEmbed()
.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.messages.fetch({ limit: 100 })
.then( msgs => {
let txt = '';
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
txt += `${message.guild.name}\n`;
txt += `#${ticketChannel.name}\n`;
txt += `${msgs.size} messages\n\n\n`;
msgs.forEach( msg => {
if ( msg.content ) {
txt += `----- ${msg.author.tag} at ${msg.createdAt}\n`;
txt += `${msg.content}\n`;
txt += `-----\n\n`;
}
} );
// 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).catch(err => {
message.reply(err)
})
logChannel.send( new Discord.MessageAttachment( Buffer.from( txt ), `${name}.txt` ) );
message.channel.delete();
// message.channel.messages.fetch( { 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}`)
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.Close_Command, name: supportbot.Close_Command,
} }
+54 -34
View File
@@ -1,50 +1,70 @@
// 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()
.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() 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: 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() let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
.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();
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Forceclose_Command}`) const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const CMDLog = new Discord.RichEmbed() const outsideticket = new Discord.MessageEmbed()
.setTitle(bot.settings.Commands_Log_Title) .setTitle("Incorrect Channel")
.addField(`User`, `<@${message.author.id}>`) .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.addField(`Command`, bot.settings.Forceclose_Command, true) .setColor(supportbot.WarningColour);
.addField(`Channel`, message.channel, true) if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
.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}`); const log = message.guild.channels.cache.find(channel => channel.name === supportbot.Transcript_Log)
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```); const uID = message.author
const reason = args.join(" ") || "No Reason Provided.";
CommandLog.send(CMDLog); const name = message.channel.name;
const c = message.channel;
message.channel.send(`Your ticket is currently closing`)
.then(() => {
const embed1 = new Discord.MessageEmbed()
.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.messages.fetch({ limit: 100 })
.then(msgs => {
message.channel.messages.fetch({ 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 = { exports.help = {
name: bot.settings.Forceclose_Command, name: supportbot.Forceclose_Command,
} }
+33 -43
View File
@@ -1,62 +1,52 @@
// 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 += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`;
const embed = new Discord.RichEmbed() const embed = new Discord.MessageEmbed()
.setTitle(bot.settings.botname) .setTitle(supportbot.Bot_Name)
.addField(":ticket: Support Commands", userCommands) .addField("🟨 User Commands", userCommands)
.addField(":pushpin: Support Commands", supportCommands, true) .addField("🎫 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,
} };
+21 -33
View File
@@ -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.MessageEmbed()
.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,
} };
+22 -37
View File
@@ -1,53 +1,38 @@
// 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}`)
const rolemissing = new Discord.RichEmbed() let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`) let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
const donothaverole = new Discord.RichEmbed() .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`) .setColor(supportbot.ErrorColour);
.setColor(bot.settings.colour) if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
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 });
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.MessageEmbed()
.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,
} };
+13 -24
View File
@@ -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();
const embed = 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.Ping_Command}`);
const embed = new Discord.MessageEmbed()
.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,
} }
+30 -40
View File
@@ -1,60 +1,50 @@
// 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}`);
const rolemissing = new Discord.RichEmbed() let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour) const rolerequired = new Discord.MessageEmbed()
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
const donothaverole = new Discord.RichEmbed() .setColor(supportbot.ErrorColour);
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`) if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.RichEmbed() const embed = new Discord.MessageEmbed()
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Poll_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Poll_Channel}**`)
const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Poll_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
ac.send(embed) locateChannel.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,
} };
+38 -59
View File
@@ -1,74 +1,53 @@
// 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}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.RichEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`) .setTitle("SupportBot Error!")
.setColor(bot.settings.colour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if (!staffGroup) return message.reply({embed: rolemissing}); .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const donothaverole = new Discord.RichEmbed() const outsideticket = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`) .setTitle("Incorrect Channel")
.setColor(bot.settings.colour) .setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole}); .setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
const outsideticket = new Discord.RichEmbed() let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
.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});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])); const cantfinduser = new Discord.MessageEmbed()
.setTitle("Invalid User!")
const cantfinduser = new Discord.RichEmbed() .setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Remove_Command} <user#0000>\``)
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`) .setColor(supportbot.WarningColour);
.setColor(bot.settings.colour) if(!rUser) return message.channel.send({embed: cantfinduser});
if(!rUser) return message.channel.send({embed: cantfinduser});
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
const cantfindchannel = new Discord.RichEmbed()
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
.setColor(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 useradded = new Discord.RichEmbed()
.setColor(bot.settings.colour)
.setDescription(`:white_check_mark: Successfully remove ${rUser} from the ticket.`)
.setTimestamp();
message.channel.send({embed: useradded});
console.log(`\x1b[36m`, `${message.author} has successfully removed ${rUser} from ${message.channel}`)
const CMDLog = new Discord.RichEmbed()
.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); message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: false, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: false });
} const useradded = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour)
.setTitle("User Removed")
.setDescription(`👍 ${rUser} has been removed from this ticket`)
.setTimestamp();
message.channel.send({embed: useradded});
};
exports.help = { exports.help = {
name: bot.settings.Remove_Command, name: supportbot.Remove_Command,
} }
+35 -45
View File
@@ -1,63 +1,53 @@
// 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) => {
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.Rename_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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour) const rolerequired = new Discord.MessageEmbed()
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole}); .setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
const outsideticket = new Discord.RichEmbed() .setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const outsideticket = new Discord.MessageEmbed()
.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.MessageEmbed()
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Ticket_Logs}**`);
logChannel.send({embed: logEmbed})
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Rename_Command}`)
const CMDLog = new Discord.RichEmbed() const errornochannel = new Discord.MessageEmbed()
.setTitle(bot.settings.Commands_Log_Title) .setTitle("SupportBot Error!")
.addField(`User`, `<@${message.author.id}>`) .setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
.addField(`Command`, bot.settings.Rename_Command, true) .setColor(supportbot.ErrorColour);
.addField(`Channel`, message.channel, true) if(!locateChannel) return message.channel.send(errornochannel);
.addField(`Executed At`, message.createdAt, true)
.setColor(bot.settings.colour) locateChannel.send(logEmbed)
.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,
} }
+29 -35
View File
@@ -1,29 +1,33 @@
// 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}`);
const rolemissing = new Discord.RichEmbed() let staffGroup = message.guild.roles.cache.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) { if(!staffGroup) {
message.reply(rolemissing).catch(err => { message.reply(rolemissing).catch(err => {
console.error(err); console.error(err);
}); });
} else { } else {
const donothaverole = new Discord.RichEmbed() const rolerequired = new Discord.MessageEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`) .setTitle("SupportBot Error!")
.setColor(bot.settings.colour) .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
if(!message.member.roles.has(staffGroup.id)) { .setColor(supportbot.ErrorColour)
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
if(!message.member.roles.cache.has(staffGroup.id)) {
message.reply(donothaverole); message.reply(donothaverole);
} else { } else {
if(!args[0]) { if(!args[0]) {
@@ -33,43 +37,33 @@ exports.run = (bot, message, args) => {
message.reply(":x: Sorry! Specify the reason of your report."); message.reply(":x: Sorry! Specify the reason of your report.");
} else { } else {
let reportDesc = args.slice(1).join(" "); let reportDesc = args.slice(1).join(" ");
const embed = new Discord.RichEmbed() const embed = new Discord.MessageEmbed()
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Report_Channel}`)
if(!rc) { if(!locateChannel) {
message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Report_Channel}**`); const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Report_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
} else { } else {
rc.send(embed); locateChannel.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
} }
+20 -34
View File
@@ -1,52 +1,38 @@
// 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}`);
const rolemissing = new Discord.RichEmbed() let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour) const rolerequired = new Discord.MessageEmbed()
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) .setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
const donothaverole = new Discord.RichEmbed() .setColor(supportbot.ErrorColour);
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`) if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
const embed = new Discord.RichEmbed() const embed = new Discord.MessageEmbed()
.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,
} }
-294
View File
@@ -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
}
+31 -35
View File
@@ -1,53 +1,49 @@
// 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.MessageEmbed()
.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) .setThumbnail(message.author.avatarURL)
.setFooter(`${supportbot.EmbedFooter}`)
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Suggestion_Channel}`)
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${bot.settings.Suggestion_Channel}**`);
const errornochannel = new Discord.MessageEmbed()
sc.send(SuggestionEmbed) .setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Suggestion_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.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.MessageEmbed()
.setDescription(`:white_check_mark: You have successfully created your suggestion. <#${sc.id}>`) .setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${locateChannel.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,
} }
+95 -115
View File
@@ -1,102 +1,87 @@
// SupportBot // SupportBot
// Created by © 2020 Emerald Services
// Command: Ticket // Command: Ticket
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}`;
// Ticket Reactions 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}`);
const reactembed = new Discord.RichEmbed()
.setColor(bot.settings.colour) // Ticket Number ID Settings
.setDescription(`${bot.settings.Ticket_React_Message}`); let ticketNumberID = TicketNumberID.pad(message.guild.id);
message.channel.send(reactembed)
.then(function(msg) { // Ticket Subject Settings
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
msg.react('✅').then(() => msg.react('❎')); // Ticket Limitiations
const alreadyopen = new Discord.MessageEmbed()
const filter = (reaction, user) => { .setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
return ['✅', '❎'].includes(reaction.emoji.name) && user.id !== msg.author.id; .setColor(supportbot.EmbedColour)
};
// Ticket Creation
msg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] }) if (message.guild.channels.cache.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
.then(collected => { message.guild.channels.create(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
const reaction = collected.first(); type: 'text',
}).then(TicketChannel => {
if (reaction.emoji.name === '❎') {
const successEmbed = new Discord.RichEmbed()
.setDescription(`:tickets: <@${message.author.id}> You have canceled your support request.`)
.setColor(bot.settings.colour);
message.channel.send(successEmbed);
}
if (reaction.emoji.name === '✅') {
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}`, {
type: 'text',
}).then(TicketChannel => {
// Roles // Roles
let staff = message.guild.roles.find(supportRole => supportRole.name === `${bot.settings.staff}`) let staff = message.guild.roles.cache.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone") let everyone = message.guild.roles.cache.find(everyoneRole => everyoneRole.name === supportbot.everyone)
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_1}`) let department = message.guild.roles.cache.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.cache.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.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`)
// Permissions // Permissions
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(everyone, { VIEW_CHANNEL: false });
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: false, READ_MESSAGES: false }) TicketChannel.updateOverwrite(department, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department2, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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.cache.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.cache.get(supportbot.category)) {
TicketChannel.setParent(message.guild.channels.get(bot.settings.category).id); TicketChannel.setParent(message.guild.channels.cache.get(supportbot.category).id);
} }
} }
const ticketopened = new Discord.RichEmbed() const ticketopened = new Discord.MessageEmbed()
.setDescription(`:white_check_mark: <@${message.author.id}> You ticket has been created <#${TicketChannel.id}>`) .setTitle(":white_check_mark: Support Ticket Created")
.setColor(bot.settings.colour) .setDescription(`<@${message.author.id}> your support ticket created successfully`)
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
.setColor(supportbot.SuccessColour)
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.MessageEmbed()
.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.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);
} }
@@ -113,24 +98,36 @@ exports.run = (bot, message, args) => {
const reaction = collected.first(); const reaction = collected.first();
if (reaction.emoji.name === `${Emoji_1}`) { if (reaction.emoji.name === `${Emoji_1}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for somone to reach out to you.")
const dept1 = new Discord.MessageEmbed()
.setDescription(`You have requested to contact ${department}. Please wait patiently for someone to reach out to you.`)
.setColor(supportbot.SuccessColour)
TicketChannel.send(dept1)
} }
if (reaction.emoji.name === `${Emoji_2}`) { if (reaction.emoji.name === `${Emoji_2}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department2, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for somone to reach out to you.") const dept2 = new Discord.MessageEmbed()
.setDescription(`You have requested to contact ${department2}. Please wait patiently for someone to reach out to you.`)
.setColor(supportbot.SuccessColour)
TicketChannel.send(dept2)
} }
if (reaction.emoji.name === `${Emoji_3}`) { if (reaction.emoji.name === `${Emoji_3}`) {
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true }) TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for somone to reach out to you.")
const dept3 = new Discord.MessageEmbed()
.setDescription(`You have requested to contact ${department3}. Please wait patiently for someone to reach out to you.`)
.setColor(supportbot.SuccessColour)
TicketChannel.send(dept3)
} }
}); });
@@ -138,49 +135,32 @@ exports.run = (bot, message, args) => {
}); });
// Ticket Logging // Ticket Logging
const logEmbed = new Discord.RichEmbed() const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Logistics of your Ticket") .setTitle(":ticket: Ticket Log")
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Ticket_Logs}**`);
const errornochannel = new Discord.MessageEmbed()
logChannel.send({embed: logEmbed}) .setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(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,
} };
+23 -37
View File
@@ -1,52 +1,38 @@
// 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}`)
const rolemissing = new Discord.RichEmbed() let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`) let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)}) const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
const donothaverole = new Discord.RichEmbed() .setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`) .setColor(supportbot.ErrorColour);
.setColor(bot.settings.colour) if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
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.MessageEmbed()
.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,
} }
+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}
+86 -48
View File
@@ -4,27 +4,28 @@
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_ // ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__| // |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
// |_| |_| // |_| |_|
// © 2020 Created by Emerald Services
// Resource: SupportBot // Licnese: MIT
// Developed by Emerald Services // SupportBot v5.2
// Version: 4.2.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,84 +37,121 @@ 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://emeraldservices.xyz/`);
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[31m`, `------------[ SupportBot ]------------`) console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
console.log(`\u001b[32m`, `Thank you for using SupportBot\n If you have any issues\n contact our team and we will\n give you furthur instructions\nContact us on discord if you require any support discord.gg/SPKDBX9`) console.log(`\u001b[37m`, `${supportbot.Bot_Name} has successfully connected to discord`)
console.log(`\u001b[31m`, `------------[ SupportBot ]------------`) console.log(`\u001b[37m`, `You can download additional features from our marketplace https://emeraldservices.xyz/`)
console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=${bot.user.id}&permissions=8&scope=bot`)
console.log(`\u001b[31m`, `\n\n------------[ SupportBot Stats ]------------`) console.log(`\u001b[37m`, `© SupportBot created by Emerald Services`)
console.log(`\u001b[32m`, `Bot Username: ${bot.user.username}\nInvite Link: https://discordapp.com/api/oauth2/authorize?client_id=${bot.user.username}&permissions=8&scope=bot`) console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
console.log(`\u001b[31m`, `------------[ SupportBot Stats ]------------`)
}); });
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); let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
if(!cmd) return; let autoGroup = message.guild.roles.cache.find(autoRole => autoRole.name === `${supportbot.AutoRole}`)
cmd.run(bot, message, args); let deptGroup1 = message.guild.roles.cache.find(deptRole1 => deptRole1.name === `${supportbot.Department_Role_1}`)
let deptGroup2 = message.guild.roles.cache.find(deptRole2 => deptRole2.name === `${supportbot.Department_Role_2}`)
let deptGroup3 = message.guild.roles.cache.find(deptRole3 => deptRole3.name === `${supportbot.Department_Role_3}`)
const rolemissing = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Staff role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
const rolemissing1 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Auto Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.AutoRole}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!autoGroup) return message.reply(rolemissing1).catch(err=>{console.error(err)})
const rolemissing2 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_1}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!deptGroup1) return message.reply(rolemissing2).catch(err=>{console.error(err)})
const rolemissing3 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_2}\`\n\nError Code: \`SB-01\``)
.setColor(supportbot.ErrorColour)
if (!deptGroup2) return message.reply(rolemissing3).catch(err=>{console.error(err)})
const rolemissing4 = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_3}\`\n\nError Code: \`SB-01\` `)
.setColor(supportbot.ErrorColour)
if (!deptGroup3) return message.reply(rolemissing4).catch(err=>{console.error(err)})
const cmd = bot.commands.get(command);
if(!cmd) return;
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.cache.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
let autorole = member.guild.roles.find(autorole => autorole.name === `${bot.settings.Auto_Role}`) let autorole = member.guild.roles.cache.find(autorole => autorole.name === `${supportbot.AutoRole}`)
const WelcomeMsg= new Discord.RichEmbed() const WelcomeMsg = new Discord.MessageEmbed()
.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.roles.add(autorole).catch(console.error);
}); });
// [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.cache.find(channel => channel.name === `${supportbot.LeaveChannel}`)
const LeaveMsg= new Discord.RichEmbed() const LeaveMsg = new Discord.MessageEmbed()
.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);
-5
View File
@@ -1,5 +0,0 @@
{
"name": "SupportBot",
"version": "4.0",
"lockfileVersion": 1
}
+9 -31
View File
@@ -1,37 +1,15 @@
{ {
"name": "SupportBot", "name": "supportbot",
"version": "4.0", "version": "5.1.0",
"description": "SupportBot", "description": "a discord dbot that can you help with your servers support",
"main": "index.js", "main": "index.js",
"private": "true",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "-help"
"start": "node index.js"
},
"engines": {
"node": "12.6.0",
"npm": "6.9.0"
}, },
"author": "Emerald SRV",
"license": "MIT",
"dependencies": { "dependencies": {
"array-sort": "^1.0.0", "discord.js": "^12.1.1",
"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",
"Emerald Services"
],
"author": "Emerald Services",
"bugs": {
"url": "https://github.com/EmeraldRusher/SupportBot/issues"
},
"homepage": "https://discord.gg/hmWgxdF",
"contributors": [
"iJosGCS",
"RedstoneGamez"
]
} }
+4 -3
View File
@@ -3,16 +3,17 @@
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();
message.channel.send(":white_check_mark: **SupportBot Addon**\nThis addon is here by default.\nWe are currently working on some super amazing addons for SupportBot\nHowever, If you would like to start creating your own support bot addon\ncontact us at EmeraldServices.\n") message.channel.send(":white_check_mark: **SupportBot Addon**\nYou can download addons from our marketplace. https://emeraldservices.xyz/")
} }
exports.help = { exports.help = {
name: 'addon', name: someaddon.settings.Addon_Example_Command,
} }
+5
View File
@@ -0,0 +1,5 @@
{
"Addon_Example_Command": "addonexample"
}
-101
View File
@@ -1,101 +0,0 @@
{
"SupportBot": "v4.2.0",
"token": "BOT_TOKEN_HERE",
"prefix": "dev-",
"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_React_Message": ":mailbox: React to create your support ticket.",
"Ticket_Department_1": "Support",
"Ticket_Department_2": "Security",
"Ticket_Department_3": "Sales",
"Ticket_Department_Emoji_1": "🎧",
"Ticket_Department_Emoji_2": "🔐",
"Ticket_Department_Emoji_3": "💵",
"General_Category": "General",
"InformationCategory": "Information",
"StaffCategory": "Staff",
"Access_Channel": "welcome",
"GeneralChannel": "general",
"BotSpam_Channel": "bot-spam",
"Tickets_Channel": "open-a-ticket",
"StaffChat": "staff-chat",
"StaffCmds": "staff-commands",
"StaffVoice": "Staff Room",
"TicketsVoice1": "Support Lounge",
"TicketsVoice2": "Support Lounge",
"Commands_Log_Title": "SupportBot Logs",
"Command_Log_Channel": "command-logs",
"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"
}
+1
View File
@@ -0,0 +1 @@
{}
+120
View File
@@ -0,0 +1,120 @@
# _________ __ __________ __
# / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
# \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
# / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
# \/ |__| |__| \/
#
# SupportBot v5.2
# Created by © 2020 Emerald Services
# License: MIT
#Bot Indentification
Token: "BOT_TOKEN_HERE"
Prefix: "!"
Bot_Name: "SupportBot"
BotActivity: "SupportBot v5.2"
ActivityType: "PLAYING"
EmbedColour: "#4bbf5c"
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
# Colour Settings
ErrorColour: "#ff3030"
SuccessColour: "#4bbf5c"
WarningColour: "#fca117"
# Role Settings
AutoRole: "Member"
StaffRole: "Support"
locked_role: "@everyone"
everyone: "@everyone"
Department_Role_1: "Support"
Department_Role_2: "Sales"
Department_Role_3: "Support"
# Ticket Department Settings
Ticket_Department_1: "Support"
Ticket_Department_2: "Sales"
Ticket_Department_3: "Other"
Ticket_Department_Emoji_1: "🟢"
Ticket_Department_Emoji_2: "🔵"
Ticket_Department_Emoji_3: "🔴"
# Ticket Settings
category: "Tickets"
Ticket_Colour: "#4bbf5c"
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"
# Welcome & Leave
WelcomeChannel: "welcome"
WelcomeMessage: "Welcome to the server!"
LeaveChannel: "welcome"
LeaveMessage: "Thank you for visiting us!"
# 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
View File
@@ -1 +0,0 @@
node index.js
-1
View File
@@ -1 +0,0 @@
node index.js
+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;