Compare commits

...
199 Commits
Author SHA1 Message Date
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
Emerald 82be317595 Updated ticket.js
Support v4.2
2019-08-17 00:00:48 +01:00
ItzEmerald a43c76529f Delete temp.js 2019-08-16 23:54:13 +01:00
Emerald 26065c2a5c Merge remote-tracking branch 'origin/master' 2019-08-16 23:52:15 +01:00
ItzEmerald 6b1dfe01cf 4.2 2019-08-16 23:51:18 +01:00
ItzEmerald 72443fb7c6 Update README.md 2019-08-10 11:52:08 +01:00
ItzEmerald 28cad23746 Update README.md 2019-08-10 11:51:02 +01:00
Joseph Gonzalo ebc0d4b137 Update settings.json 2019-08-04 20:44:02 -06:00
Joseph Gonzalo 4b198acda7 Update README.md 2019-08-04 20:43:22 -06:00
Joseph Gonzalo b84c3c75a5 Bug fixes 2019-08-04 20:42:35 -06:00
ItzEmerald de0ec97d9b Update 4.0.1
Bug Fixes:

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

Tickets not allowing users to talk
2019-08-04 00:12:49 +01:00
ItzEmerald a8302cd276 Update help.js 2019-07-25 00:25:40 +01:00
ItzEmerald 35d8d77f15 Update help.js 2019-07-25 00:25:23 +01:00
ItzEmerald f853394d9d Update settings.json 2019-07-25 00:23:47 +01:00
Joseph Gonzalo 500c01dd1f Add files via upload 2019-07-24 16:52:30 -06:00
Joseph Gonzalo 71bfccfb0c Update README.md 2019-07-24 16:51:11 -06:00
Joseph Gonzalo 71e1b64818 Update README.md 2019-07-24 16:49:51 -06:00
Joseph Gonzalo 2118a00a36 Add files via upload 2019-07-24 16:47:57 -06:00
Joseph Gonzalo 1c69c21f21 Update package.json 2019-07-24 16:47:31 -06:00
Joseph Gonzalo 31c76fc1c0 Update index.js 2019-07-24 16:45:29 -06:00
ItzEmerald d31cdf8af2 Update default-addon.js 2019-06-25 15:08:40 +01:00
ItzEmerald 29b5fd2c6f Create default-addon.js 2019-06-25 14:38:11 +01:00
ItzEmerald aa32525f8c Delete default-addon.js 2019-06-25 14:35:14 +01:00
ItzEmerald f6a67a3373 Update default-addon.js 2019-06-24 19:09:32 +01:00
Joseph Gonzalo 4f78858641 Update README.md 2019-06-19 22:56:04 -06:00
Joseph Gonzalo c7e70bdaf8 Update README.md 2019-06-19 22:37:22 -06:00
Joseph Gonzalo 5479e0957b Update README.md 2019-06-19 22:36:58 -06:00
Joseph Gonzalo 8500554cfb Update README.md 2019-06-19 22:25:27 -06:00
Joseph Gonzalo 368727cece Update settings.json 2019-06-19 22:24:51 -06:00
Joseph Gonzalo 742faf3805 Update README.md 2019-06-19 22:24:37 -06:00
Joseph Gonzalo 7d08cbed84 Update settings.json 2019-06-19 14:28:01 -06:00
Joseph Gonzalo f413bb5f3c Update suggest.js
Better look for Suggestions
2019-06-19 14:27:24 -06:00
Joseph Gonzalo 2b3edc7b45 Update README.md 2019-06-19 13:24:08 -06:00
ItzEmerald 83f982f8d2 Update help.js 2019-06-19 20:23:55 +01:00
Joseph Gonzalo 890a1d41b1 Update README.md
Help section & contributors added!
2019-06-19 13:23:37 -06:00
Joseph Gonzalo 996a2c26ca Update index.js
Replace ${bot.user.username} to ${bot.user.id} in line 44.
2019-06-19 12:58:55 -06:00
Joseph Gonzalo fadf042101 Update package.json 2019-06-19 12:57:57 -06:00
ItzEmerald a819078d7f Merge pull request #4 from iJosGCS/patch-1
Update README.md
2019-06-19 19:30:56 +01:00
ItzEmerald 2c9b4c663d Merge pull request #5 from iJosGCS/patch-2
Update index.js
2019-06-19 19:30:44 +01:00
Joseph Gonzalo 22e6803e14 Update index.js 2019-06-19 12:21:41 -06:00
Joseph Gonzalo 61cecb112f Update README.md 2019-06-19 12:19:48 -06:00
ItzEmerald 0c18aff34d Update settings.json 2019-06-18 17:25:58 +01:00
RedsoneGamez 599649a97f Update 'links' command and it's settings 2019-06-18 13:09:00 -03:00
ItzEmerald 45194b82da Update README.md 2019-06-18 17:01:19 +01:00
ItzEmerald 570d0985d3 Update README.md 2019-06-18 16:23:13 +01:00
ItzEmerald 5eae625b28 Update settings.json
Added the option to change the auto role.
2019-06-18 16:22:02 +01:00
ItzEmerald fcc5460ff2 Update index.js 2019-06-18 16:13:51 +01:00
ItzEmerald 07d45e50de Updated index.js
Added Auto Join Role
2019-06-18 16:13:38 +01:00
28 changed files with 1053 additions and 635 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 -94
View File
@@ -1,94 +1,5 @@
<h1 align="center">SupportBot v3.4</h1>
<h4 align="center">A Self Hosted discord application</h4>
<p align="center">
<a href="https://discord.gg/hmWgxdF">
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=shield" alt="Discord Server">
</a>
<img src="https://img.shields.io/badge/Made%20with-NodeJS-blue.svg" alt="Made with NodeJS">
</p>
SupportBot is a free & open source discord bot for your server that has the capability to control & manage your servers support.
| Version | Supported | Type |
| ------- | ------------------ |--------------------|
| 1.0.x | ❌ | None |
| 2.0.x | ⚠ | Community |
| 3.0.x | ✅ | Priority |
| 4.0.x | ❌ | N/A |
| Premium | ❌ | N/A |
# Getting Started
Firstly you will need to download the resource, Once you have downloaded the resource open a new tab in your browser and go to https://discordapp.com/developers/applications/. Create a new application and then open your app and select bot and then create your bot. Copy the bot token and paste it where it says ``"token": "BOT TOKEN HERE",`` in the ``settings.json`` file.
# Invite the bot
Head back to discord developers portal where your application is and head into the ``OAuth`` tab and select bot and then below select ``Administrator`` then copy the link and paste into your browser and it should as your to invite the bot to a server.
# Configurating SupportBot
Once you have setup your discord application such as invited the bot and added your bot token to the ``settings.json`` we can begin configurating your bot. Firstly open up the ``settings.json`` file and you will see loads of different things to config. You will see the following below:
```
"prefix": "!",
"botname": "SupportBot",
"colour": "#42f477",
"footer": "Support Bot, By Emerald",
"BotStatus": "Support Bot",.
"staff": "Staff",
"support": "Support Team",
"everyone": "@everyone",
"category": "Tickets",
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
"Ticket_Logs": "ticket-logs",
"Announcement_Title": "SupportBot Announcement",
"Announcement_Channel": "announcements",
"Welcome_Message": "Welcome to the server!",
"Welcome_Channel": "welcome",
"Leave_Message": "Thank you for visiting us!",
"Leave_Channel": "welcome",
"Poll_Channel": "polls",
"Poll_Title": "📊 Polls",
"Reaction_Poll_1": "✅",
"Reaction_Poll_2": "❎",
"Suggestion_Title": "SupportBot Suggestions",
"Suggestion_Channel": "suggestions",
"suggestyes": "✅",
"suggestno": "❎",
"LINK_1_NAME": "Discord",
"LINK_2_NAME": "Twitter",
"LINK_3_NAME": "Website",
"LINK_1": "https://dicord.gg/changemeinconfig",
"LINK_2": "https://twitter.com/changemeinconfig",
"LINK_3": "https://www.example.com/",
"LINKS_TITLE": "SupportBot Links",
"Ticket_Command": "ticket",
"Suggest_Command": "suggest",
"Say_Command": "say",
"Remove_Command": "remove",
"Add_Command": "add",
"Ping_Command": "ping",
"Close_Command": "close",
"Forceclose_Command": "forceclose",
"Rename_Command": "rename",
"Help_Command": "help",
"Link_Command": "links",
"Lockchat_Command": "lock",
"UnLockchat_Command": "unlock",
"Poll_Command": "poll"
```
# Contributors List
# Donators List
<h1 align="center">SupportBot</h1>
<p align="center">Created by Emerald 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>
Version 5.2
<hr>
+36 -44
View File
@@ -1,60 +1,52 @@
// SupportBot
// Command: Add User
// Created by © 2020 Emerald Services
// Command: Add
const Discord = require("discord.js");
const bot = new Discord.Client()
bot.settings = require("../settings.json");
const fs = require("fs")
const yaml = require('js-yaml');
module.exports.run = async (bot, message, args) => {
message.delete()
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
exports.run = (bot, message, args) => {
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Add_Command}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
const 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 donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const 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});
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.cache.get(args[0]));
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.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});
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});
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
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 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 = {
name: bot.settings.Add_Command,
}
name: supportbot.Add_Command,
};
+55
View File
@@ -0,0 +1,55 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Announce (including @everyone)
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs")
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Announcement_Command}`);
let staffGroup = message.guild.roles.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 embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Announcement_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Announcement_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.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 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 = {
name: supportbot.Announcement_Command,
}
+101 -28
View File
@@ -1,43 +1,116 @@
// SupportBot
// Command: Close Ticket
// Created by © 2020 Emerald Services
// Command: Close
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
/**
* @param {Discord.Message} message
*/
exports.run = (bot, message, args) => {
message.delete();
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
const close1 = new Discord.RichEmbed()
.setDescription(`Looks like you have come to the end of your support ticket\nPlease confirm that you want to close your ticket by saying ||**confirm**||`)
.setFooter("Your request will be avoided in 20 seconds")
.setColor(bot.settings.colour)
message.channel.send({embed: close1}).then(m => {
message.channel.awaitMessages(response => response.content === `confirm`, {
max: 1,
time: 10000,
errors: ['time'],
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Close_Command}`);
}).then((collected) => {
message.channel.delete();
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
const embed = new Discord.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(() => {
m.edit('Close ticket request, timedout').then(m2 => {
m2.delete();
}, 3000);
const closeRequestEmbed = new Discord.MessageEmbed()
.setDescription(`**${supportbot.Ticket_Closure}**`)
.addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
.setFooter("Your request will be avoided in 20 seconds")
.setColor(supportbot.EmbedColour)
message.channel.send(closeRequestEmbed).then( m => {
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.Closure_Confirm_Word, {
max: 1,
time: 20000,
errors: [ 'time' ],
} ).then( collected => {
let logChannel = message.guild.channels.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}`)
}
exports.help = {
name: bot.settings.Close_Command,
}
name: supportbot.Close_Command,
}
+56 -22
View File
@@ -1,36 +1,70 @@
// SupportBot
// Command: Forceclose Ticket
// Created by © 2020 Emerald Services
// Command: Forceclose
const Discord = require("discord.js");
const bot = new Discord.Client()
bot.settings = require("../settings.json");
const fs = require("fs")
const yaml = require('js-yaml');
exports.run = (bot, message, args) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.support}`)
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
exports.run = async (bot, message, args) => {
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Forceclose_Command}`);
const outsideticket = new Discord.RichEmbed()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
message.channel.delete();
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
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 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});
const log = message.guild.channels.cache.find(channel => channel.name === supportbot.Transcript_Log)
const uID = message.author
const reason = args.join(" ") || "No Reason Provided.";
const name = message.channel.name;
const c = message.channel;
message.channel.send(`Your ticket is currently closing`)
.then(() => {
const embed1 = new Discord.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 = {
name: bot.settings.Forceclose_Command,
}
name: supportbot.Forceclose_Command,
}
+33 -27
View File
@@ -1,46 +1,52 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Help
const Discord = require("discord.js");
const bot = new Discord.Client()
bot.settings = require("../settings.json");
const fs = require("fs")
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
message.delete();
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Help_Command}`);
let userCommands = "";
userCommands += `**${bot.settings.prefix}${bot.settings.Link_Command}**: Get some important links!\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Ping_Command}**: Check the bots ping. Pong!\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Ticket_Command} <reason>**: Create a support ticket\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Close_Command}**: Close your support ticket\n`;
userCommands += `**${bot.settings.prefix}${bot.settings.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Ticket_Command} <reason>**: Create a support ticket\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Close_Command}**: Close your support ticket\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Report_Command} <user> <reason>**: Report a valid user\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Link_Command}**: Get some important links!\n`;
userCommands += `**${supportbot.Prefix}${supportbot.Ping_Command}**: Check the bots ping. Pong!\n`;
let supportCommands = "";
supportCommands += `**${bot.settings.prefix}${bot.settings.Add_Command} <user>**: Adds a user to a ticket\n`;
supportCommands += `**${bot.settings.prefix}${bot.settings.Remove_Command} <user>**: Removes a user from a ticket\n`;
supportCommands += `**${bot.settings.prefix}${bot.settings.Forceclose_Command}**: Forceclose a support ticket\n`;
supportCommands += `**${bot.settings.prefix}${bot.settings.Rename_Command}**: Rename a support ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Add_Command} <user>**: Adds a user to a ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Remove_Command} <user>**: Removes a user from a ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Forceclose_Command}**: Forceclose a support ticket\n`;
supportCommands += `**${supportbot.Prefix}${supportbot.Rename_Command}**: Rename a support ticket\n`;
let staffCommands = "";
staffCommands += `**${bot.settings.prefix}${bot.settings.Say_Command} <message>**: Create a bot announcement\n`;
staffCommands += `**${bot.settings.prefix}${bot.settings.Lockchat_Command}**: Lock the chat channel\n`;
staffCommands += `**${bot.settings.prefix}${bot.settings.UnLockchat_Command}**: UnLock the chat channel\n`;
let staffCommands = "";
staffCommands += `**${supportbot.Prefix}${supportbot.Announcement_Command} <message>**: Create a bot announcement\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Say_Command} <message>**: Send a message as the bot\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Lockchat_Command}**: Lock the chat channel\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.UnLockchat_Command}**: UnLock the chat channel\n`;
staffCommands += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`;
const embed = new Discord.RichEmbed()
.setTitle(bot.settings.botname)
.addField(":ticket: Support Commands", userCommands)
.addField(":pushpin: Support Commands", supportCommands, true)
.addField(":pushpin: Staff Commands", staffCommands, true)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer, message.author.displayAvatarURL);
const embed = new Discord.MessageEmbed()
.setTitle(supportbot.Bot_Name)
.addField("🟨 User Commands", userCommands)
.addField("🎫 Support Commands", supportCommands)
.addField("🔐 Staff Commands", staffCommands)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL);
message.channel.send(embed)
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Help_Command}`)
message.channel.send(embed);
}
exports.help = {
name: bot.settings.Help_Command,
}
name: supportbot.Help_Command,
};
+25 -19
View File
@@ -1,30 +1,36 @@
// SupportBot
// Command: Help
// Created by © 2020 Emerald Services
// Command: Links
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
exports.run = (bot, message, args) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
let BotLinks = "";
BotLinks += `[${bot.settings.LINK_1_NAME}](${bot.settings.LINK_1})\n`;
BotLinks += `[${bot.settings.LINK_2_NAME}](${bot.settings.LINK_2})\n`;
BotLinks += `[${bot.settings.LINK_3_NAME}](${bot.settings.LINK_3})\n`;
exports.run = ( bot, message, args ) => {
const links = new Discord.RichEmbed()
.setTitle(`${bot.settings.LINKS_TITLE}`)
.setDescription(BotLinks)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
message.channel.send(links)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Link_Command}`);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Link_Command}`)
let botLinks = supportbot.LINKS;
}
let links = '';
for ( let name in botLinks ) {
links += `[${name}](${botLinks[ name ]})\n`;
};
let embed = new Discord.MessageEmbed()
.setTitle(supportbot.LINKS_TITLE)
.setDescription(links)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter);
message.channel.send(embed);
};
exports.help = {
name: bot.settings.Link_Command,
}
name: supportbot.Link_Command,
};
+24 -24
View File
@@ -1,38 +1,38 @@
// SupportBot
// Command: Lockchat
// Created by © 2020 Emerald Services
// Command: Close
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async(bot, message, args) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
let everyoneRole = message.guild.roles.find(everyone => everyone.name === `${bot.settings.everyone}`)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Lockchat_Command}`);
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(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)
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
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});
message.channel.overwritePermissions(everyoneRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
const lockmsg = new Discord.RichEmbed()
const lockmsg = new Discord.MessageEmbed()
.setDescription(":white_check_mark: **Chat Locked**")
.setColor(bot.settings.colour)
message.channel.send(lockmsg)
.setColor(supportbot.EmbedColour)
message.channel.send(lockmsg);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Lockchat_Command}`)
}
};
exports.help = {
name: bot.settings.Lockchat_Command,
}
name: supportbot.Lockchat_Command,
};
+13 -10
View File
@@ -1,23 +1,26 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Ping
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
message.delete();
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\` `)
.setColor(bot.settings.colour)
.setColor(supportbot.EmbedColour)
message.channel.send(embed).catch(console.error);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ping_Command}`)
}
};
exports.help = {
name: bot.settings.Ping_Command,
}
name: supportbot.Ping_Command,
}
+30 -26
View File
@@ -1,46 +1,50 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Poll
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Poll_Command}`);
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(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)
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 embed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Poll_Title}`)
const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Poll_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer, message.author.displayAvatarURL)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Poll_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Poll_Channel}**`)
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.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) {
msg.react(bot.settings.Reaction_Poll_1).then(() => msg.react(bot.settings.Reaction_Poll_2));
msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2));
});
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Poll_Command}`)
}
};
exports.help = {
name: bot.settings.Poll_Command,
}
name: supportbot.Poll_Command,
};
+37 -44
View File
@@ -1,60 +1,53 @@
// SupportBot
// Command: Remove User
// Created by © 2020 Emerald Services
// Command: Remove
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
module.exports.run = async (bot, message, args) => {
message.delete()
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
exports.run = async (bot, message, args) => {
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Remove_Command}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
const 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 donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const 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});
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.cache.get(args[0]));
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.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.Remove_Command} <user#0000>\``)
.setColor(supportbot.WarningColour);
if(!rUser) return message.channel.send({embed: cantfinduser});
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: false, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: false });
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 useradded = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour)
.setTitle("User Removed")
.setDescription(`👍 ${rUser} has been removed from this ticket`)
.setTimestamp();
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
message.channel.send({embed: useradded});
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}`)
}
};
exports.help = {
name: bot.settings.Remove_Command,
}
name: supportbot.Remove_Command,
}
+36 -32
View File
@@ -1,49 +1,53 @@
// SupportBot
// Command: Close Ticket
// Created by © 2020 Emerald Services
// Command: Rename
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
exports.run = (bot, message, args) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.support)
exports.run = async (bot, message, args) => {
const rolemissing = new Discord.RichEmbed()
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!staffGroup) return message.reply({embed: rolemissing});
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}`);
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.support}**`)
.setColor(bot.settings.colour)
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
const outsideticket = new Discord.RichEmbed()
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()
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
.setColor(bot.settings.colour)
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
.setColor(supportbot.colour)
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
const renameto = args.join(" ")
message.channel.setName(`ticket-${renameto}-${message.author.username}`)
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
// Renamed Ticket Logistic
const logEmbed = new Discord.RichEmbed()
const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Ticket Renamed")
.setDescription(`<@${message.author.id}> has renamed a ticket to ${renameto}`)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Ticket_Logs}**`);
logChannel.send({embed: logEmbed})
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Rename_Command}`)
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
}
const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(logEmbed)
};
exports.help = {
name: bot.settings.Rename_Command,
}
name: supportbot.Rename_Command,
}
+30 -21
View File
@@ -1,29 +1,33 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Report
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`);
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Report_Command}`);
const rolemissing = new Discord.RichEmbed()
.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) {
message.reply(rolemissing).catch(err => {
console.error(err);
});
} else {
const donothaverole = new Discord.RichEmbed()
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
.setColor(bot.settings.colour)
if(!message.member.roles.has(staffGroup.id)) {
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});
if(!message.member.roles.cache.has(staffGroup.id)) {
message.reply(donothaverole);
} else {
if(!args[0]) {
@@ -33,28 +37,33 @@ exports.run = (bot, message, args) => {
message.reply(":x: Sorry! Specify the reason of your report.");
} else {
let reportDesc = args.slice(1).join(" ");
const embed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Report_Title}`)
const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Report_Title}`)
.setThumbnail(message.author.avatarURL)
.addField("Report by:", `<@${message.author.id}>`, false)
.addField("Description:", `${reportDesc}`, false)
.addField("Reported User:", `${args[0]}`, false)
.setTimestamp(new Date())
.setColor(bot.settings.colour)
.setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${bot.settings.Report_Channel}`)
if(!rc) {
message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Report_Channel}**`);
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Report_Channel}`)
if(!locateChannel) {
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 {
rc.send(embed);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Report_Command}`);
locateChannel.send(embed);
}
}
}
}
}
}
};
exports.help = {
name: bot.settings.Report_Command
name: supportbot.Report_Command
}
+22 -26
View File
@@ -1,42 +1,38 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Say
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Say_Command}`);
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(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)
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 embed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Announcement_Title}`)
const embed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Announcement_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(bot.settings.colour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Announcement_Channel}`)
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Announcement_Channel}**`)
ac.send(embed)
.setColor(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Say_Command}`)
message.channel.send(embed);
}
};
exports.help = {
name: bot.settings.Say_Command,
}
name: supportbot.Say_Command,
}
+34 -19
View File
@@ -1,33 +1,48 @@
// SupportBot
// Command: Suggest
// Created by © 2020 Emerald Services
// Command: Say
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async(bot, message, args) => {
message.delete();
const SuggestionEmbed = new Discord.RichEmbed()
.setTitle(`${bot.settings.Suggestion_Title}`)
.setDescription(args.join(" "))
.setFooter(`Suggestion by ${message.author.username}`, message.author.displayAvatarURL)
.setColor(bot.settings.colour)
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${bot.settings.Suggestion_Channel}`);
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${bot.settings.Suggestion_Channel}**`);
sc.send(SuggestionEmbed)
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.MessageEmbed()
.setTitle(`${supportbot.Suggestion_Title}`)
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
.setFooter(`${supportbot.EmbedFooter}`, message.author.avatarURL)
.setTimestamp(new Date())
.setColor(supportbot.EmbedColour)
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Suggestion_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.Suggestion_Channel}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
if(!locateChannel) return message.channel.send(errornochannel);
locateChannel.send(SuggestionEmbed)
.then(async function(msg) {
msg.react(bot.settings.suggestyes).then(() => msg.react(bot.settings.suggestno));
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
});
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Suggest_Command}`)
const SuggestionSuccessEmbed = new Discord.MessageEmbed()
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${locateChannel.id}>`)
.setColor(supportbot.EmbedColour)
message.channel.send(SuggestionSuccessEmbed);
}
};
exports.help = {
name: bot.settings.Suggest_Command,
}
name: supportbot.Suggest_Command,
}
+130 -49
View File
@@ -1,85 +1,166 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Ticket
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
exports.run = async(bot, message, args) => {
message.delete();
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
const TicketNumberID = require('../utility/TicketNumber');
const ID = Math.floor(Math.random() * 10) + 2000;
const subject = args.join(" ") || "No Subject.";
exports.run = async (bot, message, args) => {
const alreadyopen = new Discord.RichEmbed()
.setDescription(`:x: Cannot create a ticket because **ticket-${message.author.username}** already exists.`)
.setColor(bot.settings.colour)
if (message.guild.channels.find(TicketChannel => TicketChannel.name === 'ticket-' + message.author.username)) return message.channel.send(alreadyopen);
message.guild.createChannel(`ticket-${message.author.username}`, 'text').then(TicketChannel => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Ticket_Command}`);
// Ticket Number ID Settings
let ticketNumberID = TicketNumberID.pad(message.guild.id);
// Ticket Subject Settings
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
// Ticket Limitiations
const alreadyopen = new Discord.MessageEmbed()
.setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
.setColor(supportbot.EmbedColour)
// Ticket Creation
if (message.guild.channels.cache.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
message.guild.channels.create(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
type: 'text',
}).then(TicketChannel => {
// Roles
let staff = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.support}`)
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === `@everyone`)
let staff = message.guild.roles.cache.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
let everyone = message.guild.roles.cache.find(everyoneRole => everyoneRole.name === supportbot.everyone)
let department = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
let department2 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
let department3 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`)
// Permissions
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
TicketChannel.updateOverwrite(everyone, { VIEW_CHANNEL: false });
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: true });
TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
TicketChannel.updateOverwrite(department, { 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 });
TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
// 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) {
TicketChannel.setParent(category.id);
} else {
if (message.guild.channels.get(bot.settings.category)) {
TicketChannel.setParent(message.guild.channels.get(bot.settings.category).id);
if (message.guild.channels.cache.get(supportbot.category)) {
TicketChannel.setParent(message.guild.channels.cache.get(supportbot.category).id);
}
}
const ticketopened = new Discord.RichEmbed()
.setDescription(`:white_check_mark: <@${message.author.id}> You ticket has been created <#${TicketChannel.id}>`)
.setColor(bot.settings.colour)
const ticketopened = new Discord.MessageEmbed()
.setTitle(":white_check_mark: Support Ticket Created")
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
.setColor(supportbot.SuccessColour)
message.channel.send({embed: ticketopened});
// Ticket Message - ( Able to edit this message via the settings.json file )
const ticketMessage = `Hi! <@${message.author.id}>\n${bot.settings.Ticket_Message}`;
const ticketMessage = `Hi! <@${message.author.id}>\n${supportbot.Ticket_Message}`;
const TicketMessage = new Discord.RichEmbed()
.setDescription(ticketMessage)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
TicketChannel.send({embed: TicketMessage});
const Department_1 = supportbot.Ticket_Department_1;
const Department_2 = supportbot.Ticket_Department_2;
const Department_3 = supportbot.Ticket_Department_3;
const Emoji_1 = supportbot.Ticket_Department_Emoji_1;
const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
const Emoji_3 = supportbot.Ticket_Department_Emoji_3;
const TicketMessage = new Discord.MessageEmbed()
.setDescription(ticketMessage, true)
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
.setColor(supportbot.Ticket_Colour)
.setFooter(supportbot.EmbedFooter)
if (subject != 'No Subject.') {
TicketMessage.addField("Reason", subject);
}
TicketChannel.send({embed: TicketMessage}).then(function(msg) {
msg.react(Emoji_1).then(() => msg.react(Emoji_2)).then(() => msg.react(Emoji_3));
const filter = (reaction, user) => {
return [Emoji_1, Emoji_2, Emoji_3].includes(reaction.emoji.name) && user.id !== msg.author.id;
};
msg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === `${Emoji_1}`) {
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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 });
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}`) {
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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 });
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}`) {
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, 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 });
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)
}
});
});
if (subject != 'No Subject.') {
TicketChannel.setTopic(subject);
}
// Ticket Logging
const logEmbed = new Discord.RichEmbed()
.setTitle(":ticket: Logistics of your Ticket")
.addField("Ticket ID", ID, true)
const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Ticket Log")
.addField("Ticket ID", ticketNumberID, true)
.addField("User", `<@${message.author.id}>`, true)
.addField("Channel", `ticket#${ID}`, true)
.setColor(bot.settings.colour)
.setFooter(bot.settings.footer)
.addField("Channel", `ticket#${ticketNumberID}`, true)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
if (subject != 'No Subject.') {
logEmbed.addField('Subject', subject, true);
}
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Ticket_Logs}**`);
logChannel.send({embed: logEmbed})
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.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)});
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ticket_Command}`)
}
};
exports.help = {
name: bot.settings.Ticket_Command,
}
name: supportbot.Ticket_Command,
};
+24 -24
View File
@@ -1,38 +1,38 @@
// SupportBot
// Command: Lockchat
// Created by © 2020 Emerald Services
// Command: Say
const Discord = require("discord.js");
const bot = new Discord.Client()
const bot = new Discord.Client();
bot.settings = require("../settings.json");
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async(bot, message, args) => {
message.delete();
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
let everyoneRole = message.guild.roles.find(everyone => everyone.name === `${bot.settings.everyone}`)
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.UnLockchat_Command}`);
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(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)
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
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});
message.channel.overwritePermissions(everyoneRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
const lockmsg = new Discord.RichEmbed()
const lockmsg = new Discord.MessageEmbed()
.setDescription(":white_check_mark: **Chat Un-Locked**")
.setColor(bot.settings.colour)
message.channel.send(lockmsg)
.setColor(supportbot.EmbedColour);
message.channel.send(lockmsg);
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.UnLockchat_Command}`)
}
};
exports.help = {
name: bot.settings.UnLockchat_Command,
}
name: supportbot.UnLockchat_Command,
}
+15
View File
@@ -0,0 +1,15 @@
cd /home/container
if [ "${GIT_CLONE}" == "true" ] || [ "${GIT_CLONE}" == "1" ]; then
if [ "$(ls -A /home/container)" ]; then
echo "Pulling Updates"
git pull
else
echo -e "/home/container is empty.\nCloning files into the directory."
git clone https://github.com/1tzemerald/SupportBot.git
fi
fi
sed -i '/s/BOT_TOKEN_HERE/${BOT_TOKEN}/g' settings.json
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
${MODIFIED_STARTUP}
+96 -41
View File
@@ -1,23 +1,31 @@
// Resource: SupportBot
// Developed by Emerald
// Version: 3.4
// ____ _ ____ _
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
// |_| |_|
// © 2020 Created by Emerald Services
// Licnese: MIT
// SupportBot v5.2
const Discord = require("discord.js");
const fs = require("fs");
const bot = new Discord.Client();
bot.commands = new Discord.Collection();
bot.settings = require("./settings.json");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
fs.readdir("./commands/", (err, files) => {
if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if(jsfile.length <= 0) return console.log(`${bot.settings.botname} No commands found. Try to Re-download the resource`);
if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No commands found. Try to Re-download the resource`);
jsfile.forEach((f, i) =>{
let props = require(`./commands/${f}`);
console.log(`[${bot.settings.botname}] > Command Loaded > ${f}`);
console.log(`[${supportbot.Bot_Name}] > Command Loaded > ${f}`);
bot.commands.set(props.help.name, props);
});
@@ -29,74 +37,121 @@ fs.readdir("./sb-addons/", (err, files) => {
if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if(jsfile.length <= 0) return console.log(`${bot.settings.botname} No addons detected nor default! Either download addons from https://itzemerald.tk/`);
if(jsfile.length <= 0) return console.log(`${supportbot.Bot_Name} No addons detected nor default! Either download addons from https://emeraldservices.xyz/`);
jsfile.forEach((f, i) =>{
let props = require(`./sb-addons/${f}`);
console.log(`[${bot.settings.botname}] > Addons Loaded > ${f}`);
console.log(`[${supportbot.Bot_Name}] > Addons Loaded > ${f}`);
bot.addons.set(props.help.name, props);
});
});
bot.on("ready", async () => {
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
console.log(`\x1b[36m`, `=== [SupportBot] ===\n\nSupportBot - Created by Emerald Services\nInvite ${bot.user.username} to your server\nhttps://discordapp.com/api/oauth2/authorize?client_id=${bot.user.username}&permissions=8&scope=bot\n\n=== [SupportBot] ===`)
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
console.log(`\u001b[37m`, `${supportbot.Bot_Name} has successfully connected to discord`)
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[37m`, `© SupportBot created by Emerald Services`)
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
});
bot.on("message", async message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
let messageArray = message.content.split(" ");
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
let messageArray = message.content.split(" ");
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
const cmd = bot.commands.get(command);
if(!cmd) return;
cmd.run(bot, message, args);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
let autoGroup = message.guild.roles.cache.find(autoRole => autoRole.name === `${supportbot.AutoRole}`)
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 => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
if(message.author.bot) return;
if(message.channel.type === "dm") return;
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
let messageArray = message.content.split(" ");
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
const addon = args.shift().toLowerCase();
let messageArray = message.content.split(" ");
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const addon = args.shift().toLowerCase();
const cmd = bot.addons.get(addon);
if(!cmd) return;
cmd.run(bot, message, args);
const cmd = bot.addons.get(addon);
if(!cmd) return;
cmd.run(bot, message, args);
message.delete();
});
// [SupportBot] Welcome Message
// [SupportBot] Welcome Message && Auto Join Role
bot.on("guildMemberAdd", (member) => {
let channel = member.guild.channels.find(channel => channel.name === `${bot.settings.Welcome_Channel}`)
const WelcomeMsg= new Discord.RichEmbed()
.setColor(bot.settings.colour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Welcome_Message}`)
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
let autorole = member.guild.roles.find(autorole => autorole.name === `${supportbot.AutoRole}`)
const WelcomeMsg= new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`)
channel.send(WelcomeMsg);
member.addRole(autorole).catch(console.error);
});
// [SupportBot] Leave Message
bot.on("guildMemberRemove", (member) => {
let channel = member.guild.channels.find(channel => channel.name === `${bot.settings.Leave_Channel}`)
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.LeaveChannel}`)
const LeaveMsg= new Discord.RichEmbed()
.setColor(bot.settings.colour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Leave_Message}`)
const LeaveMsg= new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour)
.setThumbnail(member.user.avatarURL)
.setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`)
channel.send(LeaveMsg);
});
bot.login(bot.settings.token);
bot.login(supportbot.Token);
+9 -12
View File
@@ -1,18 +1,15 @@
{
"name": "supportbot",
"version": "3.4",
"description": "SupportBot",
"version": "5.1.0",
"description": "a discord dbot that can you help with your servers support",
"main": "index.js",
"dependencies": {
"discord.js": "^11.4.2"
},
"devDependencies": {},
"scripts": {
"test": "!help"
"test": "-help"
},
"keywords": [
"SupportBot"
],
"author": "Emerald Services",
"homepage": "https://discord.gg/hmWgxdF"
"author": "Emerald SRV",
"license": "MIT",
"dependencies": {
"discord.js": "^12.1.1",
"js-yaml": "^3.13.1"
}
}
+5 -4
View File
@@ -3,16 +3,17 @@
const Discord = require("discord.js");
const bot = new Discord.Client()
const someaddon = new Discord.Client()
bot.settings = require("../settings.json");
someaddon.settings = require("./settings/someaddon.json");
exports.run = async(bot, message, args) => {
message.delete();
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 = {
name: 'addon',
}
name: someaddon.settings.Addon_Example_Command,
}
+5
View File
@@ -0,0 +1,5 @@
{
"Addon_Example_Command": "addonexample"
}
-69
View File
@@ -1,69 +0,0 @@
{
"SupportBot": "v3.4 / Download addons @ https://itzemerald.tk/",
"token": "TOKEN",
"prefix": "!",
"botname": "SupportBot",
"colour": "#42f477",
"footer": "Support Bot, By Emerald",
"BotStatus": "Support Bot",
"staff": "Staff",
"support": "Support",
"everyone": "@everyone",
"category": "Tickets",
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
"Ticket_Logs": "ticket-logs",
"Announcement_Title": "SupportBot Announcement",
"Announcement_Channel": "announcements",
"Welcome_Message": "Welcome to the server!",
"Welcome_Channel": "welcome",
"Leave_Message": "Thank you for visiting us!",
"Leave_Channel": "welcome",
"Poll_Channel": "polls",
"Poll_Title": "📊 Polls",
"Reaction_Poll_1": "✅",
"Reaction_Poll_2": "❎",
"Suggestion_Title": "SupportBot Suggestions",
"Suggestion_Channel": "suggestions",
"suggestyes": "✅",
"suggestno": "❎",
"Report_Channel": "reports",
"Report_Title": "SupportBot Report",
"LINK_1_NAME": "Discord",
"LINK_2_NAME": "Twitter",
"LINK_3_NAME": "Website",
"LINK_1": "https://dicord.gg/changemeinconfig",
"LINK_2": "https://twitter.com/changemeinconfig",
"LINK_3": "https://www.example.com/",
"LINKS_TITLE": "SupportBot Links",
"Ticket_Command": "ticket",
"Suggest_Command": "suggest",
"Say_Command": "say",
"Remove_Command": "remove",
"Add_Command": "add",
"Ping_Command": "ping",
"Close_Command": "close",
"Forceclose_Command": "forceclose",
"Rename_Command": "rename",
"Help_Command": "help",
"Link_Command": "links",
"Lockchat_Command": "lock",
"UnLockchat_Command": "unlock",
"Poll_Command": "poll",
"Report_Command": "report"
}
+1
View File
@@ -0,0 +1 @@
{}
+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"
+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;