Compare commits

...
275 Commits
Author SHA1 Message Date
ItzEmerald 37c870c7ab SupportBot Pre-7.2
SupportBot Build for DiscordJS 13
2021-10-04 20:41:05 +01:00
ItzEmerald 09f0873f27 SupportBot 7.3 2021-10-04 13:54:30 +01:00
ItzEmerald 19a12f6c8f SupportBot 7.2 2021-09-11 15:29:21 +01:00
Xiled Emerald 79a498d1d6 Update transcript.js 2021-08-07 16:19:13 +01:00
ItzEmerald 12a03c36f3 SupportBot 7.1 Release
Features all-new ticket system with new reaction technology enabling you to delete & lock tickets with one-click!
2021-08-06 16:34:15 +01:00
ItzEmerald ddc8bcab9b Pre-2 2021-08-05 13:40:19 +01:00
ItzEmerald 35dacfd48a Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-08-05 13:39:48 +01:00
ItzEmerald 611cef34ab 7.1-Pre-2 2021-08-05 13:39:44 +01:00
Xiled Emerald 8a8f9fe890 Update SupportTickets.json 2021-08-05 01:07:16 +01:00
Xiled Emerald 5a65b70c80 Update ticketreaction.yml 2021-08-05 01:07:04 +01:00
Xiled Emerald 8bea3faa1f Update TicketID.json 2021-08-05 01:06:53 +01:00
ItzEmerald 4125954d53 7.1 Pre-1
Revamp of ticket system
2021-08-05 01:03:58 +01:00
Xiled Emerald 3d9c5a729e Create SupportBot_ENG.yml 2021-08-01 16:21:47 +01:00
Xiled Emerald 51d775ea6d Delete supportbot-config_GER.yml 2021-08-01 16:20:25 +01:00
Xiled Emerald e461c47c4b Delete supportbot-config_FR.yml 2021-08-01 16:20:19 +01:00
Xiled Emerald bbdb38e45a Delete supportbot-config_ES.yml 2021-07-31 15:33:37 +01:00
Xiled Emerald 083e047aec Delete supportbot-config_ENG.yml 2021-07-31 15:33:30 +01:00
Xiled Emerald 84e0b504ab Delete .DS_Store 2021-06-30 21:33:35 +01:00
Xiled Emerald bedff6832c Update supportbot-config.yml 2021-06-30 21:33:16 +01:00
ItzEmerald 6c29e04de2 7.0 2021-06-30 21:30:41 +01:00
ItzEmerald ba674323e1 Update help.js 2021-06-15 21:05:38 +01:00
ItzEmerald 6d756a161e Update help.js 2021-06-15 21:04:32 +01:00
ItzEmerald 66a5cd95ec Update README.md 2021-06-15 19:56:39 +01:00
ItzEmerald 9f70648264 Update suggest.js 2021-06-15 19:10:17 +01:00
ItzEmerald b975b79691 Update removeUser.js 2021-06-15 19:10:07 +01:00
ItzEmerald 3cab896954 Update purge.js 2021-06-15 19:09:58 +01:00
ItzEmerald b9680e5b35 Update ping.js 2021-06-15 19:09:46 +01:00
ItzEmerald 43a003ca7d Update newticket.js 2021-06-15 19:09:35 +01:00
ItzEmerald fbe1cf2009 Update links.js 2021-06-15 19:09:23 +01:00
ItzEmerald fdee61cc11 Update kick.js 2021-06-15 19:09:06 +01:00
ItzEmerald 8b51200d9c Update help.js 2021-06-15 19:08:56 +01:00
ItzEmerald 0631ab536a Update close.js 2021-06-15 19:08:46 +01:00
ItzEmerald 0d76e76519 Update botSay.js 2021-06-15 19:07:42 +01:00
ItzEmerald 9e9f83d211 Update blacklistUser.js 2021-06-15 19:07:26 +01:00
ItzEmerald 0829d477d9 Update ban.js 2021-06-15 19:07:10 +01:00
ItzEmerald 1b7109fa23 Update announce.js 2021-06-15 19:06:58 +01:00
ItzEmerald 366669ccd8 Update addUser.js 2021-06-15 19:06:40 +01:00
ItzEmerald e05edd89fa Update ready.js 2021-06-15 18:09:24 +01:00
ItzEmerald a405df66c9 Update message.js 2021-06-15 18:09:06 +01:00
ItzEmerald 28a57ead9f Update index.js 2021-06-15 18:08:32 +01:00
ItzEmerald 72bfacae75 Merge pull request #68 from DuAnti7423/master
Boolean Changes, help menu fix, raw Event, ID Support added
2021-05-24 12:48:25 +01:00
DuAnti7423 10f8821b3b Random Stuff
idk why github thinks i changed something
2021-05-23 10:45:00 +02:00
DuAnti7423 92a3745ce1 Update supportbot-config.yml
Added HelpMenu_WithKey Option.
Boolean Changes
2021-05-23 10:44:00 +02:00
DuAnti7423 aff7ff1451 Update ready.js
ID Support, Boolean Changes
2021-05-23 10:41:15 +02:00
DuAnti7423 9e63e0ff09 Create raw.js
Added Raw-Event, probably fixxed the ticketreaction isnt 100% workin
2021-05-23 10:41:05 +02:00
DuAnti7423 2c5ebd8620 Update messageReactionAdd.js
ID Support, Boolean Changes
2021-05-23 10:40:37 +02:00
DuAnti7423 e6d63db3a9 Update guildMemberRemove.js
ID Support, Boolean Changes
2021-05-23 10:40:32 +02:00
DuAnti7423 2cc316aafb Update guildMemberAdd.js
ID Support, Boolean Changes
2021-05-23 10:40:28 +02:00
DuAnti7423 4f25cfa0dd Update suggest.js
ID Support, Boolean Changes
2021-05-23 10:40:20 +02:00
DuAnti7423 0385de3882 Update removeUser.js
ID Support, Boolean Changes
2021-05-23 10:40:16 +02:00
DuAnti7423 2e1253c54e Update purge.js
ID Support, Boolean Changes
2021-05-23 10:40:10 +02:00
DuAnti7423 14df15caeb Update ping.js
ID Support, Boolean Changes
2021-05-23 10:40:03 +02:00
DuAnti7423 af481a2ec8 Update newticket.js
ID Support, Boolean Changes

Fixxed everyone permissions on ticket creation
2021-05-23 10:39:58 +02:00
DuAnti7423 96c1d80844 Update links.js
ID Support, Boolean Changes
2021-05-23 10:39:42 +02:00
DuAnti7423 57ea2e25bd Update kick.js
ID Support, Boolean Changes
2021-05-23 10:39:36 +02:00
DuAnti7423 cd17b0a6d7 Update help.js
ID Support, Boolean Changes
2021-05-23 10:39:31 +02:00
DuAnti7423 c5dd8823f6 Update close.js
ID Support, Boolean Changes
2021-05-23 10:39:24 +02:00
DuAnti7423 c27f16f753 Update botSay.js
ID Support, Boolean Changes
2021-05-23 10:39:18 +02:00
DuAnti7423 4842610229 Update blacklistUser.js
ID Support, Boolean Changes
2021-05-23 10:39:13 +02:00
DuAnti7423 bd33669dba Update ban.js
ID Support, Boolean Changes
2021-05-23 10:39:08 +02:00
DuAnti7423 e81684d322 Update announce.js
ID Support, Boolean Changes
2021-05-23 10:39:03 +02:00
DuAnti7423 8209dfa26c Update addUser.js
ID Support, Boolean Changes
2021-05-23 10:38:55 +02:00
DuAnti7423 0a82c62a4e boolean changes
workin on suggestion #67  from pat2381
2021-05-22 23:41:39 +02:00
DuAnti7423 4399dfe6b8 Fixxed a copy error
replaced reactionUser with user cause reactionUser was defined in the ticket command
2021-05-22 23:38:32 +02:00
DuAnti7423 defd0cc78c Merge branch 'master' of https://github.com/DuAnti7423/SupportBot 2021-05-22 23:13:25 +02:00
DuAnti7423 fd5fc8294c update help.js
Fixxed a bug with staffcommands show
2021-05-22 23:13:16 +02:00
ItzEmerald 10823b416c Update package.json 2021-05-14 15:46:23 +01:00
ItzEmerald 4490920ac6 Update index.js 2021-05-14 15:46:08 +01:00
ItzEmerald e0b8ad4a32 Update supportbot-config.yml 2021-05-14 15:45:49 +01:00
ItzEmerald e11063832b Merge pull request #65 from DuAnti7423/master
Blacklist Command
2021-05-12 15:35:56 +01:00
DuAnti7423 d598fdd753 updated help.js 2021-05-09 00:25:30 +02:00
DuAnti7423 157b93239a Added Logging to Blacklist 2021-05-08 23:55:57 +02:00
DuAnti7423 3d7058dccd Merge branch 'master' of https://github.com/DuAnti7423/SupportBot 2021-05-08 23:44:12 +02:00
DuAnti7423 1ec654d1ea Blacklist Command
Added Blacklist Command
Added configoption
2021-05-08 23:42:35 +02:00
ItzEmerald 8ce2d4269d Merge pull request #62 from DuAnti7423/master
Blacklist Role
2021-05-07 15:09:46 +01:00
DuAnti7423 49e8aa7869 Blacklist Role
Added Blacklist Role, via ID or Name
2021-04-17 22:15:59 +02:00
ItzEmerald 0827f55d43 Update guildMemberAdd.js 2021-03-31 01:21:34 +01:00
ItzEmerald ba6ff8c342 Update node.js.yml 2021-03-31 00:28:35 +01:00
ItzEmerald c0b7dc2737 Create node.js.yml 2021-03-31 00:27:10 +01:00
ItzEmerald ab6abd453b Delete node_modules directory 2021-03-30 20:20:33 +01:00
ItzEmerald 77921aca75 Update ready.js 2021-03-30 20:18:37 +01:00
ItzEmerald a8f91c4814 Update messageReactionAdd.js 2021-03-30 20:12:29 +01:00
ItzEmerald 7780fa792c Updated 2021-03-27 16:58:27 +00:00
ItzEmerald 41e4c376ec Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-03-27 16:22:37 +00:00
ItzEmerald 09aad61cfe SB-6.3-BETA 2
Added Moderation
Added Node Modules
2021-03-27 16:22:19 +00:00
ItzEmerald 31ac81428f Update ready.js 2021-03-24 20:56:57 +00:00
ItzEmerald 60daab82d2 Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-03-24 16:26:21 +00:00
ItzEmerald e7a0544004 Added Image to ReactionPanel 2021-03-24 16:25:16 +00:00
ItzEmerald ff0364bba8 Update supportbot-config_FR.yml 2021-03-17 16:04:41 +00:00
ItzEmerald a3b64be351 Update supportbot-config_ES.yml 2021-03-17 16:03:52 +00:00
ItzEmerald eae370e346 Update README.md 2021-03-17 14:36:11 +00:00
ItzEmerald 0d86b50a83 Update supportbot-config_ENG.yml 2021-03-17 14:35:45 +00:00
ItzEmerald 543b9028a3 Update supportbot-config_ES.yml 2021-03-17 14:35:15 +00:00
ItzEmerald 867f12d11f Update supportbot-config_FR.yml 2021-03-17 14:33:13 +00:00
ItzEmerald 462781ea6a Update supportbot-config_GER.yml 2021-03-17 14:31:37 +00:00
ItzEmerald c300ab6459 Update supportbot-config.yml 2021-03-11 18:57:27 +00:00
ItzEmerald 448d8f3007 Update ready.js 2021-03-11 18:55:33 +00:00
ItzEmerald faa53b0af1 Create supportbot-config_ENG.yml 2021-03-03 19:42:29 +00:00
ItzEmerald 8e53b8d9a6 Rename supportbot-config_GN.yml to supportbot-config_GER.yml 2021-03-03 19:41:36 +00:00
ItzEmerald 5678567baa Create supportbot-config_GN.yml 2021-03-03 19:37:39 +00:00
ItzEmerald 1c30f73bb1 Create supportbot-config_FR.yml 2021-03-03 18:36:02 +00:00
ItzEmerald bd3dbc3033 Rename supportbot-config.y_ES.yml to supportbot-config_ES.yml 2021-03-03 00:39:41 +00:00
ItzEmerald 3c312ab8d3 Create supportbot-config.y_ES.yml
Spanish
2021-03-03 00:39:20 +00:00
ItzEmerald 7284785db0 Delete eyeroe.md 2021-02-13 16:25:53 +00:00
ItzEmerald 4e543ea490 Update messageReactionAdd.js 2021-02-13 16:25:28 +00:00
ItzEmerald 4d3540126f Update eyeroe.md 2021-02-08 15:34:02 +00:00
ItzEmerald 6c29f0d792 Create eyeroe.md 2021-02-08 15:33:44 +00:00
wxip c85df7c40f Update ready.js 2021-02-05 21:39:16 +02:00
wxip 4f6ff575ce Quick Fix
Hopefully fixes `INVALID_TYPE` error on GuildMemberAdd event.
2021-02-05 21:26:21 +02:00
ItzEmerald aaf3890f71 Update guildMemberAdd.js 2021-02-05 16:15:51 +00:00
ItzEmerald 4f9837d991 Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-02-04 12:54:29 +00:00
ItzEmerald 2e2eb008c6 Language PRE-01 2021-02-04 12:54:19 +00:00
ItzEmerald fa7074bb59 Update messageReactionAdd.js 2021-02-02 17:56:13 +00:00
ItzEmerald 18a7def050 Delete package-lock.json 2021-02-02 17:55:00 +00:00
ItzEmerald 40e9cf5fe5 Update messageReactionAdd.js 2021-02-02 17:52:07 +00:00
ItzEmerald 6ce049a57e Update supportbot-config.yml 2021-02-02 17:26:31 +00:00
ItzEmerald d4c4eac710 Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-02-02 17:15:36 +00:00
ItzEmerald 28ec96e5e8 SB-6.1-PRE 2021-02-02 17:15:24 +00:00
ItzEmerald a20fe8eb06 Update ticketreaction.yml 2021-02-02 17:02:35 +00:00
ItzEmerald 7d1d9b881d Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-02-02 17:02:03 +00:00
ItzEmerald c116e6cbb0 SB-6.1-PRE 2021-02-02 17:01:58 +00:00
ItzEmerald a3ebf0a33b Delete .DS_Store 2021-02-02 16:19:13 +00:00
ItzEmerald ea6ef022e7 Delete .DS_Store 2021-02-02 16:19:02 +00:00
ItzEmerald 683e29196a Update README.md 2021-02-02 16:18:34 +00:00
ItzEmerald 71694d7082 Update README.md 2021-02-02 16:18:14 +00:00
ItzEmerald c5d5656fb6 Update supportbot-config.yml 2021-02-02 16:09:23 +00:00
ItzEmerald b1fdbee5f8 Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-02-02 16:08:10 +00:00
ItzEmerald 70405a1cd0 SB-6.1-PRE
Ticket Reaction Create
2021-02-02 16:07:28 +00:00
ItzEmerald 3d7e81169f Delete node_modules directory 2021-02-02 15:54:24 +00:00
ItzEmerald fa7c8c7219 Update supportbot-config.yml 2021-02-02 13:51:48 +00:00
ItzEmerald 358a25f522 SB-6.1-PRE 2021-02-02 13:50:53 +00:00
ItzEmerald 690169a409 Update LICENSE 2021-02-02 09:44:58 +00:00
ItzEmerald 0ec4cc5a51 Merge pull request #49 from 1tzemerald/add-license-1
Create LICENSE
2021-02-02 00:27:27 +00:00
ItzEmerald 0b7dbaf368 Create LICENSE 2021-02-02 00:27:04 +00:00
ItzEmerald 940c445182 Delete LICENSE 2021-02-01 23:19:47 +00:00
ItzEmerald d8a90c9aa5 Update LICENSE 2021-01-28 14:41:17 +00:00
ItzEmerald 89ee8fceca Merge pull request #47 from 1tzemerald/SupportBot
Support bot
2020-12-30 18:59:41 +00:00
ItzEmerald 68b55a2d33 Delete jo 2020-12-30 18:59:23 +00:00
ItzEmerald 8cc2e7747f Delete supportbot-crowdin.yml 2020-12-30 18:59:11 +00:00
ItzEmerald 4e6ac3a294 Update Crowdin configuration file 2020-12-30 18:57:19 +00:00
ItzEmerald 732e22ea7b Create jo 2020-12-30 18:55:57 +00:00
ItzEmerald ac0d9981f8 Delete supportbot-crowdin.yml 2020-12-30 18:49:11 +00:00
ItzEmerald 23f7310760 Create supportbot-crowdin.yml 2020-12-30 18:48:56 +00:00
ItzEmerald 02a9ce6bac Update messageReactionAdd.js 2020-12-24 16:35:33 +00:00
ItzEmerald 069665358f Update README.md 2020-12-24 15:32:42 +00:00
ItzEmerald 2cf6d69127 Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2020-12-24 15:19:50 +00:00
ItzEmerald 870435061d Updated 2020-12-24 15:19:02 +00:00
Kieran Davies 53ad906491 Create .gitignore 2020-12-18 14:26:16 +00:00
Kieran Davies 01399e343b Update messageReactionAdd.js 2020-12-18 13:59:36 +00:00
Kieran Davies a0bdec4c42 Update messageReactionAdd.js 2020-12-18 13:51:51 +00:00
Kieran Davies 914f2057d8 Update messageReactionAdd.js 2020-12-18 13:51:03 +00:00
Kieran Davies ed9b9dca79 Update messageReactionAdd.js 2020-12-18 13:46:16 +00:00
ItzEmerald f6d4383ff6 6.1 PRE-0.2 2020-12-18 13:37:56 +00:00
ItzEmerald b6ccf30ae4 Update supportbot-config.yml 2020-12-11 22:12:21 +00:00
ItzEmerald 48e44a0d38 Update supportbot-config.yml 2020-12-11 22:12:02 +00:00
ItzEmerald 735998b48c Delete messageReactionRemove.js 2020-12-11 22:11:25 +00:00
ItzEmerald d94eefddb7 Delete messageReactionAdd.js 2020-12-11 22:11:07 +00:00
ItzEmerald 5a65b4df17 Update ready.js 2020-12-11 21:45:10 +00:00
ItzEmerald 15a839a310 Update message.js 2020-12-11 21:44:56 +00:00
ItzEmerald 9730c61962 Update guildMemberRemove.js 2020-12-11 21:44:31 +00:00
ItzEmerald 1805c041a6 Update guildMemberRemove.js 2020-12-11 21:44:20 +00:00
ItzEmerald f0bde93d5f Update guildMemberAdd.js 2020-12-11 21:43:58 +00:00
ItzEmerald 1ed7412f92 Update index.js 2020-12-11 21:43:36 +00:00
ItzEmerald 1f5ea2d25b Update suggest.js 2020-12-11 21:42:34 +00:00
ItzEmerald ff4c8f0e85 Update removeUser.js 2020-12-11 21:42:20 +00:00
ItzEmerald 5c3dd878b8 Update ping.js 2020-12-11 21:42:04 +00:00
ItzEmerald 20f0d91c75 Update newticket.js 2020-12-11 21:41:36 +00:00
ItzEmerald 894e48756f Update links.js 2020-12-11 21:41:13 +00:00
ItzEmerald aef199b292 Update help.js 2020-12-11 21:39:23 +00:00
ItzEmerald 9b884cd941 Update close.js 2020-12-11 21:39:09 +00:00
ItzEmerald b22d813cee Update botSay.js 2020-12-11 21:38:45 +00:00
ItzEmerald 0981566cbe Update announce.js 2020-12-11 21:38:31 +00:00
ItzEmerald 0647aa435a Update addUser.js 2020-12-11 21:38:13 +00:00
ItzEmerald 58179f98e9 Update index.js 2020-12-11 13:45:00 +00:00
ItzEmerald 05fe62536b Update supportbot-config.yml 2020-12-11 13:44:46 +00:00
ItzEmerald 241d41e220 Update supportbot-config.yml 2020-12-11 13:43:53 +00:00
ItzEmerald 34d6134c24 Update supportbot-config.yml 2020-12-11 13:43:17 +00:00
ItzEmerald 702d1d1998 Add files via upload 2020-12-11 13:42:27 +00:00
ItzEmerald e43a5fd5a3 Delete unhandledRejection.js 2020-12-10 11:34:01 +00:00
ItzEmerald 4ed9a7b7f5 Create README.md 2020-12-10 11:33:38 +00:00
ItzEmerald d8ba76e395 Delete README.md 2020-12-10 11:32:00 +00:00
ItzEmerald 448004abca Delete SUMMARY.md 2020-12-10 11:31:50 +00:00
ItzEmerald 7b0db34fb1 Delete image.png 2020-12-10 11:30:46 +00:00
ItzEmerald a7e7d5b372 Delete mit-license.md 2020-12-10 11:30:19 +00:00
ItzEmerald 9768628e8b Delete terms-and-conditions.md 2020-12-10 11:30:10 +00:00
ItzEmerald 6c0328b2fd Delete README.md 2020-12-09 11:11:59 +00:00
ItzEmerald 6bf7d879e2 Delete hosting-provider.md 2020-12-09 11:11:50 +00:00
ItzEmerald f25490f1ad Delete ubuntu-installation.md 2020-12-09 11:11:43 +00:00
ItzEmerald 31eee78535 Delete README.md 2020-12-09 11:11:30 +00:00
ItzEmerald 4ed2aff1b7 Create unhandledRejection.js 2020-12-09 11:10:06 +00:00
ItzEmerald 6f05545be6 Delete changelog.md 2020-12-09 11:06:55 +00:00
ItzEmerald dfec8a0e4f Delete download.md 2020-12-09 11:06:33 +00:00
ItzEmerald 47b730111b Delete untitled.md 2020-12-09 11:06:26 +00:00
ItzEmerald 59ba27c36f Delete creating-your-own-addon.md 2020-12-09 11:06:17 +00:00
ItzEmerald b501164c38 Delete README.md 2020-12-09 11:06:08 +00:00
Itz Emerald 1b795087bf GitBook: [master] one page modified 2020-12-07 15:50:30 +00:00
Itz Emerald 7063edc10f GitBook: [master] one page modified 2020-12-07 15:50:11 +00:00
Itz Emerald c02abcb760 GitBook: [master] one page modified 2020-12-07 15:48:42 +00:00
Itz Emerald 2d1a20dcc6 GitBook: [master] one page modified 2020-12-07 15:48:27 +00:00
Itz Emerald 65156d4b20 GitBook: [master] 14 pages and one asset modified 2020-11-28 20:03:35 +00:00
ItzEmerald 951cedb190 Update LICENSE 2020-09-27 01:18:01 +01:00
ItzEmerald 11442f320d Update index.js 2020-09-27 01:14:37 +01:00
ItzEmerald 33df21f656 Update supportbot-config.yml 2020-09-27 01:13:56 +01:00
ItzEmerald 19ab208678 Merge pull request #40 from real2two/patch-1
Add "Delete Messages" options on the configuration file.
2020-09-27 01:06:29 +01:00
ItzEmerald 59b9651575 Merge pull request #42 from real2two/patch-3
Fix prefix on playing status.
2020-09-27 01:06:06 +01:00
ItzEmerald c1c1f1767a Merge pull request #44 from 1tzemerald/dependabot/npm_and_yarn/node-fetch-2.6.1
Bump node-fetch from 2.6.0 to 2.6.1
2020-09-27 01:05:42 +01:00
dependabot[bot] dda8a5180c Bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-27 00:04:16 +00:00
ItzEmerald 34d558412f Update package.json 2020-09-27 01:02:51 +01:00
ItzEmerald be77ee1903 Update newticket.js 2020-09-27 01:00:54 +01:00
ItzEmerald fc571d6c73 Update README.md 2020-09-09 14:04:46 +01:00
Two 7ca5a97535 Update supportbot-config.yml 2020-08-02 10:25:12 -04:00
ItzEmerald 730239ba8d Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2020-08-02 13:53:17 +01:00
ItzEmerald 9069e23188 GuildMemberRemove Fix 2020-08-02 13:53:14 +01:00
Two 366203fe21 Update addon-example.js 2020-07-27 10:45:25 -04:00
Two f23f15c972 Update announce.js 2020-07-27 10:44:06 -04:00
Two 8432290a70 Update botSay.js 2020-07-27 10:43:59 -04:00
Two ceddd503f8 Update close.js 2020-07-27 10:43:51 -04:00
Two 51ad35f72b Update help.js 2020-07-27 10:43:45 -04:00
Two 5631b24a14 Update links.js 2020-07-27 10:43:36 -04:00
Two f9da25643d Update newticket.js 2020-07-27 10:43:30 -04:00
Two 75bed3f5dd Update ping.js 2020-07-27 10:43:25 -04:00
Two d4576dfc21 Update removeUser.js 2020-07-27 10:43:17 -04:00
Two 31bad3c2e5 Update suggest.js 2020-07-27 10:43:11 -04:00
Two a3c0e81e04 Update addUser.js 2020-07-27 10:42:53 -04:00
Two b5cf721efb Update supportbot-config.yml 2020-07-27 10:42:39 -04:00
Two 95063398aa Update message.js 2020-07-27 10:39:25 -04:00
ItzEmerald 2da25c5566 Update README.md 2020-07-26 12:57:08 +01:00
ItzEmerald a72c1ab380 Merge pull request #39 from 1tzemerald/SupportBot-6.0
Support bot 6.0
2020-07-23 20:20:32 +01:00
ItzEmerald 87b9301e20 Update help.js 2020-07-23 20:16:32 +01:00
ItzEmerald d0a6bed727 Delete BotSay.js 2020-07-23 17:40:31 +01:00
ItzEmerald 29881fbf28 Merge branch 'SupportBot-6.0' of https://github.com/1tzemerald/SupportBot into SupportBot-6.0 2020-07-15 18:42:13 +01:00
ItzEmerald 4f05ad6546 SupportBot 6.0 BETA 1 2020-07-15 18:42:07 +01:00
doge 36fc9aae6c Update removeUser.js 2020-07-15 12:05:39 -04:00
doge fb3f87c685 Update addUser.js 2020-07-15 12:05:24 -04:00
doge a4c0eeb9b3 Update addUser.js 2020-07-15 11:57:32 -04:00
doge c64f249fd0 Update removeUser.js 2020-07-15 11:57:14 -04:00
doge 48b542293f Update addUser.js 2020-07-15 11:56:52 -04:00
doge 95e92970c9 Update removeUser.js 2020-07-15 11:44:17 -04:00
doge afdb16da07 Update addUser.js 2020-07-15 11:44:01 -04:00
doge 0a230cfab9 fix remove 2020-07-15 11:37:58 -04:00
doge c752a07ad0 fix adduser 2020-07-15 11:37:17 -04:00
ItzEmerald cc5a6b7317 Update BotSay.js 2020-07-15 02:20:05 +01:00
ItzEmerald d93991ad86 Merge branch 'SupportBot-6.0' of https://github.com/1tzemerald/SupportBot into SupportBot-6.0 2020-07-15 02:20:03 +01:00
ItzEmerald 5c98376a8c RolePerms Update 2020-07-15 02:16:15 +01:00
ItzEmerald 28699f0ff0 Updated 2020-07-14 19:42:46 +01:00
ItzEmerald e3576b17b1 Updated 2020-07-14 19:17:40 +01:00
ItzEmerald 17c49b2b03 Merge branch 'SupportBot-6.0' of https://github.com/1tzemerald/SupportBot into SupportBot-6.0 2020-07-11 13:19:19 +01:00
ItzEmerald dcc00d8d1f Update 2020-07-11 13:17:57 +01:00
ItzEmerald 05a772eee2 Create removeUser.js 2020-07-10 20:56:40 +01:00
ItzEmerald 59dd291dc6 Update addUser.js 2020-07-10 20:55:02 +01:00
ItzEmerald f0a791e354 Update README.md 2020-07-10 20:48:41 +01:00
ItzEmerald 94db6cff7b Create addUser.js 2020-07-10 18:55:03 +01:00
ItzEmerald 72a02bf6d2 Close.js updated 2020-07-04 00:54:34 +01:00
ItzEmerald cf99209887 Close Ticket 2020-06-24 09:50:14 +01:00
ItzEmerald ff7ed49905 guildMemberRemove added 2020-06-21 15:56:16 +01:00
ItzEmerald ecd17a51df guildMemberAdd Updated 2020-06-21 12:36:48 +01:00
ItzEmerald 63b08f8c12 guildMemberAdd Updated 2020-06-20 16:10:27 +01:00
ItzEmerald 3077772aff Merge branch 'SupportBot-6.0' of https://github.com/1tzemerald/SupportBot into SupportBot-6.0 2020-06-20 15:46:18 +01:00
ItzEmerald f40aa9ed14 push 2020-06-20 13:02:46 +01:00
ItzEmerald 4ae6dc3a69 Update guildMemberAdd.js 2020-06-20 00:18:17 +01:00
ItzEmerald bdb8389d8d Merge branch 'SupportBot-6.0' of https://github.com/1tzemerald/SupportBot into SupportBot-6.0 2020-06-20 00:11:02 +01:00
ItzEmerald f7254c7ec7 Push 2020-06-20 00:10:38 +01:00
ItzEmerald 3701156362 Merge pull request #35 from real2two/patch-20
Update newticket.js
2020-06-19 23:42:03 +01:00
Two 575d25f5ad Update newticket.js 2020-06-16 21:54:40 -04:00
Two 698b82c7d3 Update newticket.js 2020-06-15 21:29:31 -04:00
ItzEmerald eaa9da6d2e 6.0-Dev Edition 2020-06-15 23:58:37 +01:00
ItzEmerald ca7294a0e3 Delete supportbot-config.yml 2020-06-15 23:47:10 +01:00
ItzEmerald 5281ffce60 overwrite Permissions to updateOverwrite 2020-06-12 23:30:34 +01:00
ItzEmerald 2f84fd3b33 overwritePermissions to updateOverwrite 2020-06-12 23:30:01 +01:00
ItzEmerald bef270da74 Update LICENSE 2020-05-19 00:40:47 +01:00
ItzEmerald bdf839ffca Merge pull request #31 from 1tzemerald/add-license-1
Create LICENSE
2020-05-10 00:42:44 +01:00
ItzEmerald b1b2ead0d8 Create LICENSE 2020-05-10 00:42:31 +01:00
ItzEmerald 0b74473c64 Delete LICENSE 2020-05-10 00:40:43 +01:00
lynxgian 2fb189cf5c updated Readme.md 2020-05-07 19:32:16 -04:00
lynxgian 24a29639e9 Update README.md 2020-05-07 19:30:53 -04:00
1286 changed files with 162084 additions and 1458 deletions

No files matched your search

Vendored
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
-23
View File
@@ -1,23 +0,0 @@
---
name: Bug report
about: Create a bug report to help us improve SupportBot.
title: "[BUG]"
labels: bug
assignees: EmeraldRusher
---
**Describe the bug**
A clear and concise description of the bug you found and how you found it.
**How did you find it**
Please could explain what you did to find the bug?
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Feel free to notify with us with anything else about the problem here.
+32
View File
@@ -0,0 +1,32 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm install discord.js --save
- run: npm install js-yaml
- run: npm run build --if-present
- run: node index.js
-76
View File
@@ -1,76 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# FuseBox cache
.fusebox/
+173
View File
@@ -0,0 +1,173 @@
// SupportBot | Emerald Services
// Close Ticket Command
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const Command = require("../Structures/Command.js");
const TicketNumberID = require('../Structures/TicketID.js');
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
module.exports = new Command({
name: "close",
description: "Close a support ticket",
type: "BOTH",
slashCommandOptions: [],
permission: "SEND_MESSAGES",
async run(message, args, client) {
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
const Exists = new Discord.MessageEmbed()
.setTitle("No Ticket Found!")
.setDescription(`${supportbot.NoValidTicket}`)
.setColor(supportbot.WarningColour);
message.channel.send({ embed: Exists });
return;
}
if (supportbot.CloseConfirmation) {
const CloseTicketRequest = new Discord.MessageEmbed()
.setTitle(`**${supportbot.ClosingTicket}**`)
.setDescription(`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `)
.setColor(supportbot.EmbedColour);
message.channel.send(CloseTicketRequest).then(m => {
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.ClosingConfirmation_Word, {
max: 1,
time: 20000,
errors: [ 'time' ],
}).then( collected => {
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog) || message.guild.channels.cache.find(channel => channel.id === supportbot.TranscriptLog)
let user = message.author;
let reason = args.join(" ") || "No Reason Provided.";
let name = message.channel.name;
let ticketChannel = message.channel;
message.channel.send(`**${supportbot.ClosingTicket}**`)
.then(() => {
const logEmbed = new Discord.MessageEmbed()
.setTitle(supportbot.TranscriptTitle)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
.addField("Closed By", message.author.tag)
.addField("Reason", reason);
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
let html = '';
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
html += `<strong>Server Name:</strong> ${message.guild.name}<br>`;
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
msgs.forEach( msg => {
if ( msg.content ) {
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
html += `<strong>Message:</strong> ${msg.content}<br>`;
html += `-----<br><br>`;
}
});
logChannel.send({embeds: [logEmbed]}).catch(err => {
message.reply(err)
})
let file = new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` )
logChannel.send({embeds: [logEmbed], files: [file]}).catch(err => {
message.reply(err)
})
message.channel.delete().catch(error => {
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
console.error('Failed to delete the message:', error);
}
});
})
})
})
}).catch( () => {
interaction.m.edit({content: 'The request to close the ticket has timed out.'}).then(m2 => setTimeout(() => channel.delete(3000)) );
});
}
if (!supportbot.CloseConfirmation) {
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog) || message.guild.channels.cache.find(channel => channel.id === supportbot.TranscriptLog)
let user = message.author;
let reason = args.join(" ") || "No Reason Provided.";
let name = message.channel.name;
let ticketChannel = message.channel;
message.channel.send(`**${supportbot.ClosingTicket}**`)
.then(() => {
const logEmbed = new Discord.MessageEmbed()
.setTitle(supportbot.TranscriptTitle)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
.addField("Closed By", message.author.tag)
.addField("Reason", reason);
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
let html = '';
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
html += `<strong>Server Name:</strong> ${message.guild.name}<br>`;
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
msgs.forEach( msg => {
if ( msg.content ) {
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
html += `<strong>Message:</strong> ${msg.content}<br>`;
html += `-----<br><br>`;
}
});
logChannel.send({embeds: [logEmbed]}).catch(err => {
message.reply(err)
})
let file = new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` )
logChannel.send({embeds: [logEmbed], files: [file]}).catch(err => {
message.reply(err)
})
message.channel.delete().catch(error => {
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
console.error('Failed to delete the message:', error);
}
});
})
}).catch( () => {
interaction.m.edit({content: 'The request to close the ticket has timed out.'}).then(m2 => setTimeout(() => channel.delete(3000)) );
});
}
}
});
+41
View File
@@ -0,0 +1,41 @@
// SupportBot | Emerald Services
// Info Command
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const Command = require("../Structures/Command.js");
module.exports = new Command({
name: "info",
description: "Displays information about your server!",
type: "BOTH",
slashCommandOptions: [],
permission: "SEND_MESSAGES",
async run(message, args, client) {
const InfoButton = new Discord.MessageButton()
.setLabel(supportbot.InfoButtonText)
.setURL(supportbot.InfoURL)
.setStyle('LINK')
const inforow = new Discord.MessageActionRow()
.addComponents(InfoButton)
const InfoEmbed = new Discord.MessageEmbed()
.setURL(supportbot.InfoURL)
.setTitle(supportbot.InfoTitle)
.setDescription(supportbot.AboutMe)
.setColor(supportbot.InfoColour)
message.channel.send({
embeds: [InfoEmbed], components: [inforow]
})
}
});
+5
View File
@@ -0,0 +1,5 @@
{
"854057237495676938": {
"id": 8
}
}
+189
View File
@@ -0,0 +1,189 @@
# ___ _ ___ _
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
# |_| |_|
#
# SupportBot created by Emerald Services
# Installed with MIT License
#
# Discord Support: https:#emeraldsrv.dev/discord
# Community Resources: https:#emeraldsrv.dev/resources
# -------------------------
# General Configuration
# -------------------------
Name: "SupportBot"
Prefix: "!"
Token: "BOT_TOKEN"
# -------------------------
# Activity Configuration
# -------------------------
BotActivity: "Need Help? -ticket"
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
# Set The ActivityType to "STREAMING" for a streaming status!
ActivityType: "PLAYING"
# Activity status can either be PLAYING, WATCHING, LISTENING or STREAMING.
# -------------------------
# Embed Configuration
# -------------------------
EmbedColour: "#f74343"
EmbedFooter: "SupportBot | An Advanced Ticket System"
ErrorColour: "#d12519"
SuccessColour: "#04b545"
WarningColour: "#fca117"
# -------------------------
# Information Configuration
# -------------------------
InfoTitle: "Information"
AboutMe: "Hi, I'm SupportBot an advanced discord ticket bot with 100% customisation! [Download](https://emeraldsrv.dev/download)"
InfoButtonText: "Visit Site"
InfoURL: "https://emeraldsrv.dev"
InfoColour: "#f74343"
# -------------------------
# Role Configuration
# -------------------------
AutoRole: true
AutoRole_Role: "Member"
LockdownRole: "@everyone"
Staff: "Support Team"
Admin: "Project Developer"
TicketBlackListRole: "Blacklisted"
# -------------------------
# Tickets Configuration
# -------------------------
TicketCategory: "▬▬ TICKETS ▬▬"
TicketChannel: "ticket"
TicketLog: "ticket-log"
TranscriptLog: "ticket-data"
TranscriptTitle: "Ticket Transcript"
TicketLog_Title: "Ticket Log"
TicketBlackListMessage: "You are not allowed to open a ticket"
TicketSubject: "description"
# "description" will displays the ticket reason within the channel description
# "embed" will displays the ticket reason within the ticket embed
AllowTicketMentions: true
# Set to true to allow the ticket to mention the author and the support team.
# Set to false to dis-allow mentions within tickets.
# --- Panel Config ---
# --- Start ---
ReactionChannel: "create-ticket"
ReactionEmoji: "📩"
# For cusomt emojis: <:emoji_name:EMOJI_ID>
ReactionTickets: true
ReactionMessage: "React with %reaction_emoji% to create a Support Ticket!"
ReactionPanel_Description: true
ReactionDescription: "Create a support ticket to contact a member of staff."
ReactionPanel_Thumbnail: true
ReactionThumbnail: "https://hotemoji.com/images/dl/5/ticket-emoji-by-twitter.png"
ReactionPanel_Image: true
ReactionImage: "https://wallpapercave.com/wp/wp4462546.jpg"
# --- Creation Config ---
# --- Start ---
# Available Placeholders:
# %ticketusername% - User who created the ticket.
# <@%ticketauthor%> - Tags the user who created the ticket.
# <#%ticketid%> - Mentions the ticket channel.
Ticket_Title: "Server Support | %ticketusername%"
TicketMessage: "Hello <@%ticketauthor%>, Thank you for creating a support ticket\nPlease wait patiently whilst a member of our team reaches out to you."
Ticket_Thumbnail: "https://images.emojiterra.com/google/android-pie/512px/1f39f.png"
NoTicketSubject: "No Reason Provided!"
TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%>"
AddedUser: "👍 <@%user%> has been added to this ticket"
RemovedUser: "👍 <@%user%> has been removed from this ticket"
# --- Buttons Config ---
# --- Start ---
# Discord Button Colour Selection
# PRIMARY - Blurple
# DANGER - Red
# SUCCESS - Green
# Secondary - Grey
TicketLockReaction: "🔒"
TicketDeleteReaction: "⛔"
LockTicketCategory: "Archive"
TicketCloseEmoji: "❌"
TicketDeleteEmoji: "⛔"
TicketLockEmoji: "🔒"
TicketCloseColour: "DANGER"
TicketDeleteColour: "DANGER"
TicketLockColour: "PRIMARY"
TicketDept1Colour: "PRIMARY"
TicketDept2Colour: "PRIMARY"
TicketDept3Colour: "PRIMARY"
TicketDept1Emoji: "1️⃣"
TicketDept2Emoji: "2️⃣"
TicketDept3Emoji: "3️⃣"
TranscriptSavedMessage: "📝 **Transcript Saved!**"
TicketLockMessage: "❌ **Ticket Locked!**"
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
TicketDeleteTime: 5000 # Time must be set in miliseconds.
# --- Departments Config ---
# --- Start ---
TicketDepartments: true
AllowStaff: true
# If set to false users with the "Staff" role will not be able to view tickets
# without a valid department role set below.
# Set to false to allow "Staff" to see tickets whether its a department for them or not.
DepartmentTitle_1: "General Support"
DepartmentTitle_2: "Billing Support"
DepartmentTitle_3: "Admin Team"
# Ticket department title, This is the title for a ticket department to help users know what is available.
DepartmentRole_1: "Support Team"
DepartmentRole_2: "Support Team"
DepartmentRole_3: "Project Developer"
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been choosen.
# --- Closing Config ---
# --- Start ---
ClosingTicket: ":warning: You have requested to close your support ticket."
ClosingConfirmation_Word: "confirm"
CloseConfirmation: false
View File
Whitespace-only changes.
-18
View File
@@ -1,18 +0,0 @@
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"]
-5
View File
@@ -1,5 +0,0 @@
<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>
+67
View File
@@ -0,0 +1,67 @@
// SupportBot | Emerald Services
// Client Structure
const fs = require("fs");
const Discord = require("discord.js");
const Command = require("./Command.js");
const Event = require("./Event.js");
const intents = new Discord.Intents(32767);
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
class Client extends Discord.Client {
constructor() {
super({ intents });
this.commands = new Discord.Collection();
this.prefix = supportbot.Prefix;
}
start(token) {
const commandFiles = fs.readdirSync("./Commands")
.filter(file => file.endsWith(".js"));
const commands = commandFiles.map(file => require(`../Commands/${file}`));
commands.forEach(cmd => {
console.log(`Command ${cmd.name} loaded`);
this.commands.set(cmd.name, cmd);
});
const slashCommands = commands
.filter(cmd => ["BOTH", "SLASH"].includes(cmd.type))
.map(cmd => ({
name: cmd.name.toLowerCase(),
description: cmd.description,
permissions: [],
options: cmd.slashCommandOptions,
defaultPermission: true
}));
this.removeAllListeners();
this.on("ready", async () => {
const cmds = await this.application.commands.set(slashCommands);
cmds.forEach(cmd => console.log(`Slash Command ${cmd.name} registered`));
})
fs.readdirSync("./Events")
.filter(file => file.endsWith(".js"))
.forEach(file => {
/**
* @type {Event}
*/
const event = require(`../Events/${file}`);
console.log(`Event ${event.event} loaded`);
this.on(event.event, event.run.bind(null, this));
});
this.login(token);
}
}
module.exports = Client;
+24
View File
@@ -0,0 +1,24 @@
// SupportBot | Emerald Services
// Command Structure
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
function RunFunction(message, args, client) {}
class Command {
constructor(options) {
this.name = options.name;
this.description = options.description;
this.permission = options.permission;
this.type = ["BOTH", "SLASH", "TEXT"].includes(options.type) ? options.type : "TEXT";
this.slashCommandOptions = options.slashCommandOptions || [];
this.run = options.run;
}
}
module.exports = Command;
+21
View File
@@ -0,0 +1,21 @@
// SupportBot | Emerald Services
// Event Structure
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
function RunFunction(client, ...eventArgs) {}
class Event {
constructor(event, runFunction) {
this.event = event;
this.run = runFunction;
}
}
module.exports = Event;
+76
View File
@@ -0,0 +1,76 @@
// SupportBot | Emerald Services
// Ticket ID Structure
const fs = require("fs");
const Discord = require("discord.js");
const Command = require("./Command.js");
const Client = require("./Client.js");
const Event = require("./Event.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.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("./Data/TicketData.json", "utf8"));
if (!ticketnumberID[guildId]) {
ticketnumberID[guildId] = {
id: 0
}
fs.writeFileSync("./Data/TicketData.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("./Data/TicketData.json", "utf8"));
ticketnumberID[guildId] = {
id: value
}
fs.writeFileSync("./Data/TicketData.json", JSON.stringify(ticketnumberID, null, 4), err => {
if (err) console.log(err);
});
return value;
}
static reset(guildId) {
let ticketnumberID = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
ticketnumberID[guildId] = {
id: 0
}
fs.writeFileSync("./Data/TicketData.json", JSON.stringify(ticketnumberID, null, 4), err => {
if (err) console.log(err);
});
return 0;
}
}
module.exports = TicketNumberID;
-1
View File
@@ -1 +0,0 @@
theme: jekyll-theme-cayman
-52
View File
@@ -1,52 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Add
const Discord = require("discord.js");
const bot = new Discord.Client()
const fs = require("fs")
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Add_Command}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const outsideticket = new Discord.MessageEmbed()
.setTitle("Incorrect Channel")
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
const cantfinduser = new Discord.MessageEmbed()
.setTitle("Invalid User!")
.setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Add_Command} <user#0000>\``)
.setColor(supportbot.WarningColour);
if(!rUser) return message.channel.send({embed: cantfinduser});
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
const useradded = new Discord.MessageEmbed()
.setColor(supportbot.SuccessColour)
.setTitle("User Added")
.setDescription(`👍 ${rUser} has been added to this ticket`)
.setTimestamp();
message.channel.send({embed: useradded});
};
exports.help = {
name: supportbot.Add_Command,
};
-55
View File
@@ -1,55 +0,0 @@
// 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,
}
-116
View File
@@ -1,116 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Close
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
/**
* @param {Discord.Message} message
*/
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.Close_Command}`);
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;
}
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 ) );
});
});
}
exports.help = {
name: supportbot.Close_Command,
}
-70
View File
@@ -1,70 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Forceclose
const Discord = require("discord.js");
const bot = new Discord.Client()
const fs = require("fs")
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Forceclose_Command}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const outsideticket = new Discord.MessageEmbed()
.setTitle("Incorrect Channel")
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
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: supportbot.Forceclose_Command,
}
-52
View File
@@ -1,52 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Help
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.Help_Command}`);
let userCommands = "";
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 += `**${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 += `**${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.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);
}
exports.help = {
name: supportbot.Help_Command,
};
-36
View File
@@ -1,36 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Links
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.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: supportbot.Link_Command,
};
-38
View File
@@ -1,38 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Close
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async(bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Lockchat_Command}`);
let staffGroup = message.guild.roles.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(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
const lockmsg = new Discord.MessageEmbed()
.setDescription(":white_check_mark: **Chat Locked**")
.setColor(supportbot.EmbedColour)
message.channel.send(lockmsg);
};
exports.help = {
name: supportbot.Lockchat_Command,
};
+21 -18
View File
@@ -1,26 +1,29 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Ping
const Discord = require("discord.js");
const bot = new Discord.Client();
// SupportBot | Emerald Services
// Ping Command
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
const Command = require("../Structures/Command.js");
exports.run = (bot, message, args) => {
module.exports = new Command({
name: "ping",
description: "Shows the ping of the bot!",
type: "BOTH",
slashCommandOptions: [],
permission: "SEND_MESSAGES",
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}`);
async run(message, args, client) {
const embed = new Discord.MessageEmbed()
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
.setColor(supportbot.EmbedColour)
message.channel.send(embed).catch(console.error);
const PingEmbed = new Discord.MessageEmbed()
.setDescription(`:ping_pong: **Ping:** \`${client.ws.ping} ms\``)
.setColor(supportbot.EmbedColour)
};
exports.help = {
name: supportbot.Ping_Command,
}
message.channel.send({
embeds: [PingEmbed]
});
}
});
-50
View File
@@ -1,50 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Poll
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Poll_Command}`);
let staffGroup = message.guild.roles.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.Poll_Title}`)
.setDescription(args.join(" "))
.setTimestamp()
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
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);
locateChannel.send(embed)
.then(async function(msg) {
msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2));
});
};
exports.help = {
name: supportbot.Poll_Command,
};
-53
View File
@@ -1,53 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Remove
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Remove_Command}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
const rolerequired = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
.setColor(supportbot.ErrorColour);
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
const outsideticket = new Discord.MessageEmbed()
.setTitle("Incorrect Channel")
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
.setColor(supportbot.WarningColour);
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
const cantfinduser = new Discord.MessageEmbed()
.setTitle("Invalid User!")
.setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.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 useradded = new Discord.MessageEmbed()
.setColor(supportbot.EmbedColour)
.setTitle("User Removed")
.setDescription(`👍 ${rUser} has been removed from this ticket`)
.setTimestamp();
message.channel.send({embed: useradded});
};
exports.help = {
name: supportbot.Remove_Command,
}
-53
View File
@@ -1,53 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Rename
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Rename_Command}`);
let staffGroup = message.guild.roles.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(supportbot.colour)
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
const renameto = args.join(" ")
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
// Renamed Ticket Logistic
const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Ticket Renamed")
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
let 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: supportbot.Rename_Command,
}
-69
View File
@@ -1,69 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Report
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Report_Command}`);
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`);
if(!staffGroup) {
message.reply(rolemissing).catch(err => {
console.error(err);
});
} else {
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]) {
message.reply(":x: Sorry! Please specify the user to report.");
} else {
if(!args[1]) {
message.reply(":x: Sorry! Specify the reason of your report.");
} else {
let reportDesc = args.slice(1).join(" ");
const embed = new Discord.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(supportbot.EmbedColour)
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
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 {
locateChannel.send(embed);
}
}
}
}
}
};
exports.help = {
name: supportbot.Report_Command
}
-38
View File
@@ -1,38 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Say
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Say_Command}`);
let staffGroup = message.guild.roles.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)
message.channel.send(embed);
};
exports.help = {
name: supportbot.Say_Command,
}
-49
View File
@@ -1,49 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Say
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async(bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Suggest_Command}`);
const SuggestionEmbed = new Discord.MessageEmbed()
.setTitle(`${supportbot.Suggestion_Title}`)
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
.setThumbnail(message.author.avatarURL)
.setFooter(`${supportbot.EmbedFooter}`)
.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(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
});
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: supportbot.Suggest_Command,
}
+234 -156
View File
@@ -1,166 +1,244 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Ticket
const Discord = require("discord.js");
const bot = new Discord.Client();
// SupportBot | Emerald Services
// Ticket Command
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
const TicketNumberID = require('../utility/TicketNumber');
const Command = require("../Structures/Command.js");
const TicketNumberID = require('../Structures/TicketID.js');
exports.run = async (bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Ticket_Command}`);
// Ticket Number ID Settings
let ticketNumberID = TicketNumberID.pad(message.guild.id);
// Ticket Subject Settings
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
// Ticket Limitiations
const alreadyopen = new Discord.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.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.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.cache.find(c => c.name === supportbot.category);
if (category) {
TicketChannel.setParent(category.id);
} else {
if (message.guild.channels.cache.get(supportbot.category)) {
TicketChannel.setParent(message.guild.channels.cache.get(supportbot.category).id);
}
}
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${supportbot.Ticket_Message}`;
const Department_1 = supportbot.Ticket_Department_1;
const Department_2 = supportbot.Ticket_Department_2;
const Department_3 = supportbot.Ticket_Department_3;
const Emoji_1 = supportbot.Ticket_Department_Emoji_1;
const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
const Emoji_3 = supportbot.Ticket_Department_Emoji_3;
const TicketMessage = new Discord.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)
}
});
});
// Ticket Logging
const logEmbed = new Discord.MessageEmbed()
.setTitle(":ticket: Ticket Log")
.addField("Ticket ID", ticketNumberID, true)
.addField("User", `<@${message.author.id}>`, true)
.addField("Channel", `ticket#${ticketNumberID}`, true)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
if (subject != 'No Subject.') {
logEmbed.addField('Subject', subject, true);
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
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)
module.exports = new Command({
name: "ticket",
description: "Creates a support ticket",
type: "BOTH",
slashCommandOptions: [],
permission: "SEND_MESSAGES",
}).catch(err=>{console.error(err)});
async run(message, args, client) {
};
let reactionUser = message.guild.members.cache.get(message.author.id)
if (reactionUser.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || reactionUser.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)) {
return message.channel.send({content:`<@${message.author.id}> ${supportbot.TicketBlackListMessage}`}).then(msg => {
setTimeout(() => msg.delete(), 3500)
})
}
// Ticket ID
let ticketNumberID = TicketNumberID.pad(message.guild.id);
// Ticket Subject
const TicketSubject = args || supportbot.NoTicketSubject;
const TicketExists = new Discord.MessageEmbed()
.setTitle("Ticket Exists!")
.setDescription(`${supportbot.TicketExists}`)
.setColor(supportbot.WarningColour)
if (message.guild.channels.cache.find(ticketChannel => ticketChannel.name === `${supportbot.TicketChannel}-${ticketNumberID}`)) {
return message.channel.send({ embeds: [TicketExists] });
}
const Staff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) || message.guild.roles.cache.find(SupportTeam => SupportTeam.id === supportbot.Staff)
const Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin) || message.guild.roles.cache.find(AdminUser => AdminUser.id === supportbot.Admin)
const DeptRole1 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.DepartmentRole_1}`) || message.guild.roles.cache.find(DepartmentRole => DepartmentRole.id === `${supportbot.DepartmentRole_1}`)
const DeptRole2 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.DepartmentRole_2}`) || message.guild.roles.cache.find(DepartmentRole => DepartmentRole.id === `${supportbot.DepartmentRole_2}`)
const DeptRole3 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.DepartmentRole_3}`) || message.guild.roles.cache.find(DepartmentRole => DepartmentRole.id === `${supportbot.DepartmentRole_3}`)
const Author = message.author
const Everyone = message.guild.id
const ticketChannel = await message.guild.channels.create(`${supportbot.TicketChannel}-${ticketNumberID}`, {
type: "GUILD_TEXT",
})
if (message.channel.name === supportbot.ReactionChannel || message.channel.id === supportbot.ReactionChannel) {
const CreatedTicket = new Discord.MessageEmbed()
.setDescription(supportbot.TicketCreatedAlert.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, ticketChannel.id).replace(/%ticketusername%/g, message.author.username))
.setColor(supportbot.EmbedColour)
message.channel.send({embeds: [CreatedTicket]}).then(msg => {
setTimeout(() => msg.delete(), 5000)
})
} else {
const CreatedTicket = new Discord.MessageEmbed()
.setDescription(supportbot.TicketCreatedAlert.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, ticketChannel.id).replace(/%ticketusername%/g, message.author.username))
.setColor(supportbot.EmbedColour)
message.channel.send({embeds: [CreatedTicket]}).then(msg => setTimeout(() => msg.delete(), 5000));
}
let AllowArr = [Staff, Staff, Admins, Author]
await asyncForEach(AllowArr, (index) => {
ticketChannel.permissionOverwrites.create(index, {VIEW_CHANNEL: true})
})
let DenyArr = [Everyone]
await asyncForEach(DenyArr, (index) => {
ticketChannel.permissionOverwrites.create(index, {VIEW_CHANNEL: false})
})
let TicketCategory = message.guild.channels.cache.find(category => category.name === supportbot.TicketCategory) || message.guild.channels.cache.find(category => category.id === supportbot.TicketCategory)
if(TicketCategory) {
ticketChannel.setParent(TicketCategory.id)
}
if (supportbot.AllowTicketMentions) {
ticketChannel.send({content:`${message.author}`})
}
const TicketMessage = new Discord.MessageEmbed()
.setTitle(supportbot.Ticket_Title.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, ticketChannel.id).replace(/%ticketusername%/g, message.author.username))
.setDescription(supportbot.TicketMessage.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, ticketChannel.id).replace(/%ticketusername%/g, message.author.username))
.setColor(supportbot.EmbedColour)
if (supportbot.TicketSubject === "embed") {
if (TicketSubject != 'No Reason Provided.') {
TicketMessage.addFields({ name: 'Reason', value: TicketSubject })
}
}
if (supportbot.TicketSubject === "description") {
if (TicketSubject != 'No Reason Provided.') {
ticketChannel.setTopic(`Reason: ${TicketSubject} - User ID: ${message.author.id} - Ticket: ${ticketChannel.name}`)
}
}
if (supportbot.TicketDepartments) {
TicketMessage.addFields({ name: 'Departments', value: ` **${supportbot.DepartmentTitle_1}**\n **${supportbot.DepartmentTitle_2}**\n **${supportbot.DepartmentTitle_3}**` })
}
const CloseButton = new Discord.MessageButton()
.setCustomId('ticketclose')
.setLabel('Close')
.setStyle(supportbot.TicketCloseColour)
.setEmoji(supportbot.TicketCloseEmoji)
const LockButton = new Discord.MessageButton()
.setCustomId('ticketlock')
.setLabel('Lock')
.setStyle(supportbot.TicketLockColour)
.setEmoji(supportbot.TicketLockEmoji)
const row2 = new Discord.MessageActionRow()
.addComponents(CloseButton, LockButton)
if(supportbot.TicketDepartments) {
let DenyArr = [DeptRole1, DeptRole2, DeptRole3]
await asyncForEach(DenyArr, (index) => {
ticketChannel.permissionOverwrites.create(index, {VIEW_CHANNEL: false})
})
const Department1Button = new Discord.MessageButton()
.setCustomId('Department1')
.setLabel(`${supportbot.DepartmentTitle_1}`)
.setStyle(supportbot.TicketDept1Colour)
.setEmoji(supportbot.TicketDept1Emoji)
const Department2Button = new Discord.MessageButton()
.setCustomId('Department2')
.setLabel(`${supportbot.DepartmentTitle_2}`)
.setStyle(supportbot.TicketDept2Colour)
.setEmoji(supportbot.TicketDept2Emoji)
const Department3Button = new Discord.MessageButton()
.setCustomId('Department3')
.setLabel(`${supportbot.DepartmentTitle_3}`)
.setStyle(supportbot.TicketDept3Colour)
.setEmoji(supportbot.TicketDept3Emoji)
const row = new Discord.MessageActionRow()
.addComponents(Department1Button, Department2Button, Department3Button)
const m = await ticketChannel.send({embeds: [TicketMessage], components: [row]})
const filter = i => {
i.deferUpdate();
return i.user.id === message.author.id;
};
const collector = m.createMessageComponentCollector({ filter, max: 1, componentType: 'BUTTON', time: 60000 });
collector.on('collect',async (i) => {
if(i.customId === 'Department1') {
ticketChannel.permissionOverwrites.edit(DeptRole1, {
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true,
SEND_MESSAGES: true,
})
if(!supportbot.AllowStaff) {
ticketChannel.permissionOverwrites.edit(Staff, { VIEW_CHANNEL: false, READ_MESSAGE_HISTORY: false, SEND_MESSAGES: false })
}
const Department1 = new Discord.MessageEmbed()
.setDescription(`> Thank for reaching out to the **${supportbot.DepartmentTitle_1} Department**. Please provide us information regarding your query.`)
.setColor(supportbot.EmbedColour)
ticketChannel.send({ embeds: [Department1] });
if (supportbot.AllowTicketMentions) {
ticketChannel.send({content: `@here`})
}
}
i.message.edit({embeds: [TicketMessage], components: [row2]})
if(i.customId === 'Department2') {
ticketChannel.permissionOverwrites.edit(DeptRole2, {
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true,
SEND_MESSAGES: true,
})
if(!supportbot.AllowStaff) {
ticketChannel.permissionOverwrites.edit(Staff, { VIEW_CHANNEL: false, READ_MESSAGE_HISTORY: false, SEND_MESSAGES: false })
}
const Department2 = new Discord.MessageEmbed()
.setDescription(`> Thank for reaching out to the **${supportbot.DepartmentTitle_2} Department**. Please provide us information regarding your query.`)
.setColor(supportbot.EmbedColour)
ticketChannel.send({ embeds: [Department2] });
if (supportbot.AllowTicketMentions) {
ticketChannel.send({content: `@here`})
}
i.message.edit({embeds: [TicketMessage], components: [row2]})
}
if(i.customId === 'Department3') {
ticketChannel.permissionOverwrites.edit(DeptRole3, {
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true,
SEND_MESSAGES: true,
})
if(!supportbot.AllowStaff) {
ticketChannel.permissionOverwrites.edit(Staff, { VIEW_CHANNEL: false, READ_MESSAGE_HISTORY: false, SEND_MESSAGES: false })
}
const Department3 = new Discord.MessageEmbed()
.setDescription(`> Thank for reaching out to the **${supportbot.DepartmentTitle_3} Department**. Please provide us information regarding your query.`)
.setColor(supportbot.EmbedColour)
ticketChannel.send({ embeds: [Department3] });
if (supportbot.AllowTicketMentions) {
ticketChannel.send({content: `@here`})
}
i.message.edit({embeds: [TicketMessage], components: [row2]})
}
})
} else {
ticketChannel.send({embeds: [TicketMessage], components: [row2]})
}
exports.help = {
name: supportbot.Ticket_Command,
};
}
});
-38
View File
@@ -1,38 +0,0 @@
// SupportBot
// Created by © 2020 Emerald Services
// Command: Say
const Discord = require("discord.js");
const bot = new Discord.Client();
const fs = require("fs");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
exports.run = async(bot, message, args) => {
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.UnLockchat_Command}`);
let staffGroup = message.guild.roles.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(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
const lockmsg = new Discord.MessageEmbed()
.setDescription(":white_check_mark: **Chat Un-Locked**")
.setColor(supportbot.EmbedColour);
message.channel.send(lockmsg);
};
exports.help = {
name: supportbot.UnLockchat_Command,
}
-15
View File
@@ -1,15 +0,0 @@
cd /home/container
if [ "${GIT_CLONE}" == "true" ] || [ "${GIT_CLONE}" == "1" ]; then
if [ "$(ls -A /home/container)" ]; then
echo "Pulling Updates"
git pull
else
echo -e "/home/container is empty.\nCloning files into the directory."
git clone https://github.com/1tzemerald/SupportBot.git
fi
fi
sed -i '/s/BOT_TOKEN_HERE/${BOT_TOKEN}/g' settings.json
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
${MODIFIED_STARTUP}
+45
View File
@@ -0,0 +1,45 @@
// SupportBot | Emerald Services
// Interaction Create Event
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const Event = require("../Structures/Event.js");
module.exports = new Event("interactionCreate", (client, interaction) => {
if (interaction.user.bot || !interaction.isCommand() || !interaction.guild)
return;
const args = [
interaction.commandName,
...client.commands
.find(cmd => cmd.name.toLowerCase() == interaction.commandName)
.slashCommandOptions.map(v => `${interaction.options.get(v.name).value}`)
];
const command = client.commands.find(cmd => cmd.name.toLowerCase() == interaction.commandName);
const NotValid = new Discord.MessageEmbed()
.setDescription(`:x: \`Invalid Command\` `)
.setColor(supportbot.ErrorColour)
if (!command) return interaction.reply({
embeds: [NotValid]
});
const permission = interaction.member.permissions.has(command.permission);
const ValidPerms = new Discord.MessageEmbed()
.setDescription(":x: \`Invalid Permissions\` Do you have the correct permissions to execute this command?")
.setColor(supportbot.ErrorColour)
if (!permission)
return interaction.reply({
embeds: [ValidPerms]
});
command.run(interaction, args, client);
});
+50
View File
@@ -0,0 +1,50 @@
// SupportBot | Emerald Services
// Message Create Event
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const Event = require("../Structures/Event.js");
module.exports = new Event("messageCreate", (client, message) => {
if (message.author.bot) return;
if (!message.content.startsWith(client.prefix)) return;
const args = message.content.substring(client.prefix.length).split(/ +/);
const command = client.commands.find(cmd => cmd.name == args[0]);
const NotValid = new Discord.MessageEmbed()
.setDescription(`:x: \`${args[0]}\` is an Invalid Command `)
.setColor(supportbot.ErrorColour)
if (!command) return message.reply({
embeds: [NotValid]
});
const OnlySlashCmd = new Discord.MessageEmbed()
.setDescription(`:warning: That command is only useable as a \`Slash Command\` `)
.setColor(supportbot.WarnColour)
if (!["BOTH", "TEXT"].includes(command.type))
return message.reply({
embeds: [OnlySlashCmd]
})
const permission = message.member.permissions.has(command.permission, true);
const ValidPerms = new Discord.MessageEmbed()
.setDescription(":x: Do you have the \`${command.permission}\` permissions to execute this command?")
.setColor(supportbot.ErrorColour)
if (!permission)
return message.reply(
`You do not have the permission \`${command.permission}\` to run this command!`
);
command.run(message, args, client);
});
+32
View File
@@ -0,0 +1,32 @@
// SupportBot | Emerald Services
// Ready Event
const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const Event = require("../Structures/Event.js");
module.exports = new Event("ready", client => {
console.log(`\u001b[32m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`)
console.log(`\u001b[32m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`)
console.log(`\u001b[32m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`)
console.log(`\u001b[32m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`)
console.log(`\u001b[32m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`)
console.log(`\u001b[32m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`)
console.log(`\u001b[32m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`)
console.log(`\u001b[32m`, `╋╋╋╋╋╋╋┗┛╋┗┛`)
console.log(` `)
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`)
console.log(` `)
console.log(`\u001b[33m`, `${supportbot.Bot_Name} v${supportbot.SupportBot_Version}`, `\u001b[36m`, `Connected to Discord`)
console.log(`\u001b[33m`, `Documentation:`, `\u001b[36m`, `https://supportbot.emeraldsrv.dev`)
console.log(`\u001b[33m`, `Discord:`, `\u001b[36m`, `https://emeraldsrv.dev/discord`)
console.log(`\u001b[33m`, `Hosting:`, `\u001b[36m`, `https://emeraldsrv.dev/hosting`)
console.log(` `)
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`)
console.log(` `)
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`)
});
+17 -150
View File
@@ -1,157 +1,24 @@
// ____ _ ____ _
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
// |_| |_|
// © 2020 Created by Emerald Services
// Licnese: MIT
// SupportBot v5.2
// ___ _ ___ _
// / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
// \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
// <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
// |_| |_|
//
// SupportBot created by Emerald Services
// Installed with MIT License
//
// Discord Support: https://emeraldsrv.dev/discord
// Community Resources: https://emeraldsrv.dev/resources
const fs = require("fs");
const Discord = require("discord.js");
const fs = require("fs");
const bot = new Discord.Client();
bot.commands = new Discord.Collection();
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.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(`${supportbot.Bot_Name} No commands found. Try to Re-download the resource`);
jsfile.forEach((f, i) =>{
let props = require(`./commands/${f}`);
console.log(`[${supportbot.Bot_Name}] > Command Loaded > ${f}`);
bot.commands.set(props.help.name, props);
});
});
const Client = require("./Structures/Client.js");
const client = new Client({});
bot.addons = new Discord.Collection();
client.start(supportbot.Token);
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(`${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(`[${supportbot.Bot_Name}] > Addons Loaded > ${f}`);
bot.addons.set(props.help.name, props);
});
});
bot.on("ready", async () => {
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
console.log(`\u001b[37m`, `${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(supportbot.Prefix) !== 0) return;
let messageArray = message.content.split(" ");
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
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(supportbot.Prefix) !== 0) return;
let messageArray = message.content.split(" ");
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
const addon = args.shift().toLowerCase();
const cmd = bot.addons.get(addon);
if(!cmd) return;
cmd.run(bot, message, args);
message.delete();
});
// [SupportBot] Welcome Message && Auto Join Role
bot.on("guildMemberAdd", (member) => {
let channel = member.guild.channels.cache.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
let autorole = member.guild.roles.cache.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.roles.add(autorole).catch(console.error);
});
// [SupportBot] Leave Message
bot.on("guildMemberRemove", (member) => {
let channel = member.guild.channels.cache.find(channel => channel.name === `${supportbot.LeaveChannel}`)
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(supportbot.Token);
Generated Vendored Symlink
+1
View File
@@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js
+297
View File
@@ -0,0 +1,297 @@
{
"name": "supportbot",
"version": "7.2.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/@discordjs/builders": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.0"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/collection": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@discordjs/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@sapphire/async-queue": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz",
"integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA==",
"engines": {
"node": ">=14",
"npm": ">=6"
}
},
"node_modules/@sindresorhus/is": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@types/node": {
"version": "16.10.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.2.tgz",
"integrity": "sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ=="
},
"node_modules/@types/ws": {
"version": "7.4.7",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/discord.js": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz",
"integrity": "sha512-gxO4CXKdHpqA+WKG+f5RNnd3srTDj5uFJHgOathksDE90YNq/Qijkd2WlMgTTMS6AJoEnHxI7G9eDQHCuZ+xDA==",
"dependencies": {
"@discordjs/builders": "^0.5.0",
"@discordjs/collection": "^0.2.1",
"@discordjs/form-data": "^3.0.1",
"@sapphire/async-queue": "^1.1.4",
"@types/ws": "^7.4.7",
"discord-api-types": "^0.22.0",
"node-fetch": "^2.6.1",
"ws": "^7.5.1"
},
"engines": {
"node": ">=16.6.0",
"npm": ">=7.0.0"
}
},
"node_modules/dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"dependencies": {
"is-obj": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
"engines": {
"node": ">=8"
}
},
"node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"node_modules/mime-db": {
"version": "1.50.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.33",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
"dependencies": {
"mime-db": "1.50.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/ow": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"type-fest": "^1.2.1",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"node_modules/ts-mixer": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
},
"node_modules/tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"node_modules/type-fest": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/ws": {
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
"engines": {
"node": ">=8.3.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
}
}
}
+190
View File
@@ -0,0 +1,190 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2021 Vlad Frangu
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+33
View File
@@ -0,0 +1,33 @@
<div align="center">
<br />
<p>
<a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
</p>
<br />
<p>
<a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://github.com/discordjs/builders/actions"><img src="https://github.com/discordjs/builders/workflows/Tests/badge.svg" alt="Test status" /></a>
<a href="https://github.com/discordjs/builders/actions"><img src="https://github.com/discordjs/builders/workflows/Lint/badge.svg" alt="Lint status" /></a>
<a href="https://codecov.io/gh/discordjs/builders"><img src="https://codecov.io/gh/discordjs/builders/branch/main/graph/badge.svg" alt="Code coverage" /></a>
</p>
</div>
## Installation
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
```sh
npm install @discordjs/builders
yarn add @discordjs/builders
pnpm add @discordjs/builders
```
## Contribution
See [Contributing Guide](https://github.com/discordjs/builders/blob/main/.github/CONTRIBUTING.md).
## Examples
Here are some examples for the builders and utilities you can find in this package:
- [Slash Command Builders](./docs/examples/Slash%20Command%20Builders.md)
+12
View File
@@ -0,0 +1,12 @@
export * from './messages/formatters';
export * as SlashCommandAssertions from './interactions/slashCommands/Assertions';
export * from './interactions/slashCommands/SlashCommandBuilder';
export * from './interactions/slashCommands/SlashCommandSubcommands';
export * from './interactions/slashCommands/options/boolean';
export * from './interactions/slashCommands/options/channel';
export * from './interactions/slashCommands/options/integer';
export * from './interactions/slashCommands/options/mentionable';
export * from './interactions/slashCommands/options/role';
export * from './interactions/slashCommands/options/string';
export * from './interactions/slashCommands/options/user';
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,OAAO,KAAK,sBAAsB,MAAM,yCAAyC,CAAC;AAClF,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC"}
+16
View File
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandAssertions = void 0;
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./messages/formatters"), exports);
exports.SlashCommandAssertions = tslib_1.__importStar(require("./interactions/slashCommands/Assertions"));
tslib_1.__exportStar(require("./interactions/slashCommands/SlashCommandBuilder"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/SlashCommandSubcommands"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/boolean"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/channel"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/integer"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/mentionable"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/role"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/string"), exports);
tslib_1.__exportStar(require("./interactions/slashCommands/options/user"), exports);
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,gEAAsC;AAEtC,0GAAkF;AAClF,2FAAiE;AACjE,+FAAqE;AACrE,uFAA6D;AAC7D,uFAA6D;AAC7D,uFAA6D;AAC7D,2FAAiE;AACjE,oFAA0D;AAC1D,sFAA4D;AAC5D,oFAA0D","sourcesContent":["export * from './messages/formatters';\n\nexport * as SlashCommandAssertions from './interactions/slashCommands/Assertions';\nexport * from './interactions/slashCommands/SlashCommandBuilder';\nexport * from './interactions/slashCommands/SlashCommandSubcommands';\nexport * from './interactions/slashCommands/options/boolean';\nexport * from './interactions/slashCommands/options/channel';\nexport * from './interactions/slashCommands/options/integer';\nexport * from './interactions/slashCommands/options/mentionable';\nexport * from './interactions/slashCommands/options/role';\nexport * from './interactions/slashCommands/options/string';\nexport * from './interactions/slashCommands/options/user';\n"]}
+33
View File
@@ -0,0 +1,33 @@
import mod from "./index.js";
export default mod;
export const Faces = mod.Faces;
export const SlashCommandAssertions = mod.SlashCommandAssertions;
export const SlashCommandBooleanOption = mod.SlashCommandBooleanOption;
export const SlashCommandBuilder = mod.SlashCommandBuilder;
export const SlashCommandChannelOption = mod.SlashCommandChannelOption;
export const SlashCommandIntegerOption = mod.SlashCommandIntegerOption;
export const SlashCommandMentionableOption = mod.SlashCommandMentionableOption;
export const SlashCommandRoleOption = mod.SlashCommandRoleOption;
export const SlashCommandStringOption = mod.SlashCommandStringOption;
export const SlashCommandSubcommandBuilder = mod.SlashCommandSubcommandBuilder;
export const SlashCommandSubcommandGroupBuilder = mod.SlashCommandSubcommandGroupBuilder;
export const SlashCommandUserOption = mod.SlashCommandUserOption;
export const TimestampStyles = mod.TimestampStyles;
export const blockQuote = mod.blockQuote;
export const bold = mod.bold;
export const channelMention = mod.channelMention;
export const codeBlock = mod.codeBlock;
export const formatEmoji = mod.formatEmoji;
export const hideLinkEmbed = mod.hideLinkEmbed;
export const hyperlink = mod.hyperlink;
export const inlineCode = mod.inlineCode;
export const italic = mod.italic;
export const memberNicknameMention = mod.memberNicknameMention;
export const quote = mod.quote;
export const roleMention = mod.roleMention;
export const spoiler = mod.spoiler;
export const strikethrough = mod.strikethrough;
export const time = mod.time;
export const underscore = mod.underscore;
export const userMention = mod.userMention;
@@ -0,0 +1,11 @@
import type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';
import type { SlashCommandOptionBase } from './mixins/CommandOptionBase';
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
import type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
export declare function validateRequiredParameters(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
export declare function validateName(name: unknown): asserts name is string;
export declare function validateDescription(description: unknown): asserts description is string;
export declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
export declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;
export declare function assertReturnOfBuilder<T extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
//# sourceMappingURL=Assertions.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"Assertions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/Assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,8BAA8B,EAAE,QAUzC;AAUD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAElE;AAID,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,IAAI,MAAM,CAEvF;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,8BAA8B,EAAE,CAE9G;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iCAAiC,EAAE,QAEpF;AAED,wBAAgB,qBAAqB,CACpC,CAAC,SAAS,sBAAsB,GAAG,6BAA6B,GAAG,kCAAkC,EACpG,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAuBrE"}
@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertReturnOfBuilder = exports.validateMaxChoicesLength = exports.validateMaxOptionsLength = exports.validateDescription = exports.validateName = exports.validateRequiredParameters = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const ow_1 = tslib_1.__importDefault(require("ow"));
function validateRequiredParameters(name, description, options) {
// Assert name matches all conditions
validateName(name);
// Assert description conditions
validateDescription(description);
// Assert options conditions
validateMaxOptionsLength(options);
}
exports.validateRequiredParameters = validateRequiredParameters;
const namePredicate = ow_1.default.string.lowercase
.minLength(1)
.maxLength(32)
.addValidator({
message: (value, label) => `Expected ${label} to match "^[\\p{L}\\p{N}_-]+$", got ${value} instead`,
validator: (value) => /^[\p{L}\p{N}_-]+$/u.test(value),
});
function validateName(name) {
ow_1.default(name, 'name', namePredicate);
}
exports.validateName = validateName;
const descriptionPredicate = ow_1.default.string.minLength(1).maxLength(100);
function validateDescription(description) {
ow_1.default(description, 'description', descriptionPredicate);
}
exports.validateDescription = validateDescription;
const maxArrayLengthPredicate = ow_1.default.array.maxLength(25);
function validateMaxOptionsLength(options) {
ow_1.default(options, 'options', maxArrayLengthPredicate);
}
exports.validateMaxOptionsLength = validateMaxOptionsLength;
function validateMaxChoicesLength(choices) {
ow_1.default(choices, 'choices', maxArrayLengthPredicate);
}
exports.validateMaxChoicesLength = validateMaxChoicesLength;
function assertReturnOfBuilder(input, ExpectedInstanceOf) {
const instanceName = ExpectedInstanceOf.name;
if (is_1.default.nullOrUndefined(input)) {
throw new TypeError(`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`);
}
if (is_1.default.primitive(input)) {
throw new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);
}
if (!(input instanceof ExpectedInstanceOf)) {
const casted = input;
const constructorName = is_1.default.function_(input) ? input.name : casted.constructor.name;
const stringTag = Reflect.get(casted, Symbol.toStringTag);
const fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;
throw new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);
}
}
exports.assertReturnOfBuilder = assertReturnOfBuilder;
//# sourceMappingURL=Assertions.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Assertions.js","sourceRoot":"/","sources":["interactions/slashCommands/Assertions.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,oDAAoB;AAKpB,SAAgB,0BAA0B,CACzC,IAAY,EACZ,WAAmB,EACnB,OAAyC;IAEzC,qCAAqC;IACrC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEnB,gCAAgC;IAChC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAEjC,4BAA4B;IAC5B,wBAAwB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAbD,gEAaC;AAED,MAAM,aAAa,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS;KACvC,SAAS,CAAC,CAAC,CAAC;KACZ,SAAS,CAAC,EAAE,CAAC;KACb,YAAY,CAAC;IACb,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,KAAM,wCAAwC,KAAK,UAAU;IACpG,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC;CACtD,CAAC,CAAC;AAEJ,SAAgB,YAAY,CAAC,IAAa;IACzC,YAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;AACjC,CAAC;AAFD,oCAEC;AAED,MAAM,oBAAoB,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAEnE,SAAgB,mBAAmB,CAAC,WAAoB;IACvD,YAAE,CAAC,WAAW,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;AACtD,CAAC;AAFD,kDAEC;AAED,MAAM,uBAAuB,GAAG,YAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAEvD,SAAgB,wBAAwB,CAAC,OAAgB;IACxD,YAAE,CAAC,OAAO,EAAE,SAAS,EAAE,uBAAuB,CAAC,CAAC;AACjD,CAAC;AAFD,4DAEC;AAED,SAAgB,wBAAwB,CAAC,OAA4C;IACpF,YAAE,CAAC,OAAO,EAAE,SAAS,EAAE,uBAAuB,CAAC,CAAC;AACjD,CAAC;AAFD,4DAEC;AAED,SAAgB,qBAAqB,CAEnC,KAAc,EAAE,kBAA+B;IAChD,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAE7C,IAAI,YAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,IAAI,SAAS,CAClB,yBAAyB,YAAY,iBAAiB,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,WAAW,CACtG,CAAC;KACF;IAED,IAAI,YAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QACxB,MAAM,IAAI,SAAS,CAAC,yBAAyB,YAAY,8BAA8B,OAAO,KAAK,YAAY,CAAC,CAAC;KACjH;IAED,IAAI,CAAC,CAAC,KAAK,YAAY,kBAAkB,CAAC,EAAE;QAC3C,MAAM,MAAM,GAAG,KAAqC,CAAC;QAErD,MAAM,eAAe,GAAG,YAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACnF,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAuB,CAAC;QAEhF,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,KAAK,SAAS,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC;QAEzF,MAAM,IAAI,SAAS,CAAC,yBAAyB,YAAY,iBAAiB,cAAc,WAAW,CAAC,CAAC;KACrG;AACF,CAAC;AAzBD,sDAyBC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport ow from 'ow';\nimport type { SlashCommandOptionBase } from './mixins/CommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst namePredicate = ow.string.lowercase\n\t.minLength(1)\n\t.maxLength(32)\n\t.addValidator({\n\t\tmessage: (value, label) => `Expected ${label!} to match \"^[\\\\p{L}\\\\p{N}_-]+$\", got ${value} instead`,\n\t\tvalidator: (value) => /^[\\p{L}\\p{N}_-]+$/u.test(value),\n\t});\n\nexport function validateName(name: unknown): asserts name is string {\n\tow(name, 'name', namePredicate);\n}\n\nconst descriptionPredicate = ow.string.minLength(1).maxLength(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tow(description, 'description', descriptionPredicate);\n}\n\nconst maxArrayLengthPredicate = ow.array.maxLength(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tow(options, 'options', maxArrayLengthPredicate);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tow(choices, 'choices', maxArrayLengthPredicate);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record<PropertyKey, unknown>;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n"]}
@@ -0,0 +1,50 @@
import type { APIApplicationCommandOption } from 'discord-api-types/v9';
import { SharedNameAndDescription } from './mixins/NameAndDescription';
import { SharedSlashCommandOptions } from './mixins/CommandOptions';
import { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
export declare class SlashCommandBuilder {
/**
* The name of this slash command
*/
readonly name: string;
/**
* The description of this slash command
*/
readonly description: string;
/**
* The options of this slash command
*/
readonly options: ToAPIApplicationCommandOptions[];
/**
* Returns the final data that should be sent to Discord.
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
toJSON(): {
name: string;
description: string;
options: APIApplicationCommandOption[];
};
/**
* Adds a new subcommand group to this command
* @param input A function that returns a subcommand group builder, or an already built builder
*/
addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandGroupsOnlyBuilder;
/**
* Adds a new subcommand to this command
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
}
export interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {
}
export interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, Pick<SlashCommandBuilder, 'toJSON' | 'addSubcommand'> {
}
export interface SlashCommandSubcommandGroupsOnlyBuilder extends SharedNameAndDescription, Pick<SlashCommandBuilder, 'toJSON' | 'addSubcommandGroup'> {
}
export interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick<SlashCommandBuilder, 'toJSON'> {
}
export interface ToAPIApplicationCommandOptions {
toJSON(): APIApplicationCommandOption;
}
//# sourceMappingURL=SlashCommandBuilder.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"SlashCommandBuilder.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAE9G,qBACa,mBAAmB;IAC/B;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAE/D;;;;OAIG;IACI,MAAM;;;;;IASb;;;OAGG;IACI,kBAAkB,CACxB,KAAK,EACF,kCAAkC,GAClC,CAAC,CAAC,eAAe,EAAE,kCAAkC,KAAK,kCAAkC,CAAC,GAC9F,uCAAuC;IAqB1C;;;OAGG;IACI,aAAa,CACnB,KAAK,EACF,6BAA6B,GAC7B,CAAC,CAAC,eAAe,EAAE,6BAA6B,KAAK,6BAA6B,CAAC,GACpF,kCAAkC;CAqBrC;AAED,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB,EAAE,yBAAyB;CAAG;AAEnG,MAAM,WAAW,kCAChB,SAAQ,wBAAwB,EAC/B,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,eAAe,CAAC;CAAG;AAE1D,MAAM,WAAW,uCAChB,SAAQ,wBAAwB,EAC/B,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,oBAAoB,CAAC;CAAG;AAE/D,MAAM,WAAW,8BAChB,SAAQ,wBAAwB,EAC/B,yBAAyB,EACzB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;CAAG;AAExC,MAAM,WAAW,8BAA8B;IAC9C,MAAM,IAAI,2BAA2B,CAAC;CACtC"}
@@ -0,0 +1,96 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandBuilder = void 0;
const tslib_1 = require("tslib");
const ts_mixer_1 = require("ts-mixer");
const Assertions_1 = require("./Assertions");
const NameAndDescription_1 = require("./mixins/NameAndDescription");
const CommandOptions_1 = require("./mixins/CommandOptions");
const SlashCommandSubcommands_1 = require("./SlashCommandSubcommands");
let SlashCommandBuilder = class SlashCommandBuilder {
constructor() {
/**
* The name of this slash command
*/
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The description of this slash command
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The options of this slash command
*/
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
}
/**
* Returns the final data that should be sent to Discord.
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, this.options);
return {
name: this.name,
description: this.description,
options: this.options.map((option) => option.toJSON()),
};
}
/**
* Adds a new subcommand group to this command
* @param input A function that returns a subcommand group builder, or an already built builder
*/
addSubcommandGroup(input) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Make sure there is no subcommand at the root level - if there is, throw
const hasSubcommands = options.some((item) => item instanceof SlashCommandSubcommands_1.SlashCommandSubcommandBuilder);
if (hasSubcommands)
throw new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`);
// Get the final result
const result = typeof input === 'function' ? input(new SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder()) : input;
Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder);
// Push it
options.push(result);
return this;
}
/**
* Adds a new subcommand to this command
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Make sure there is no subcommand at the root level - if there is, throw
const hasSubcommandGroups = options.some((item) => item instanceof SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder);
if (hasSubcommandGroups)
throw new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`);
// Get the final result
const result = typeof input === 'function' ? input(new SlashCommandSubcommands_1.SlashCommandSubcommandBuilder()) : input;
Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommands_1.SlashCommandSubcommandBuilder);
// Push it
options.push(result);
return this;
}
};
SlashCommandBuilder = tslib_1.__decorate([
ts_mixer_1.mix(CommandOptions_1.SharedSlashCommandOptions, NameAndDescription_1.SharedNameAndDescription)
], SlashCommandBuilder);
exports.SlashCommandBuilder = SlashCommandBuilder;
//# sourceMappingURL=SlashCommandBuilder.js.map
@@ -0,0 +1 @@
{"version":3,"file":"SlashCommandBuilder.js","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandBuilder.ts"],"names":[],"mappings":";;;;AACA,uCAA+B;AAC/B,6CAA2G;AAC3G,oEAAuE;AACvE,4DAAoE;AACpE,uEAA8G;AAG9G,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAAhC;QACC;;WAEG;QACH;;;;mBAA+B,SAAU;WAAC;QAE1C;;WAEG;QACH;;;;mBAAsC,SAAU;WAAC;QAEjD;;WAEG;QACH;;;;mBAA4D,EAAE;WAAC;IA0EhE,CAAC;IAxEA;;;;OAIG;IACI,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SACtD,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,kBAAkB,CACxB,KAEgG;QAEhG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,0EAA0E;QAC1E,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,YAAY,uDAA6B,CAAC,CAAC;QAC7F,IAAI,cAAc;YAAE,MAAM,IAAI,UAAU,CAAC,qEAAqE,CAAC,CAAC;QAEhH,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,4DAAkC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAErG,kCAAqB,CAAC,MAAM,EAAE,4DAAkC,CAAC,CAAC;QAElE,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,aAAa,CACnB,KAEsF;QAEtF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,0EAA0E;QAC1E,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,YAAY,4DAAkC,CAAC,CAAC;QACvG,IAAI,mBAAmB;YACtB,MAAM,IAAI,UAAU,CAAC,qEAAqE,CAAC,CAAC;QAE7F,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,uDAA6B,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhG,kCAAqB,CAAC,MAAM,EAAE,uDAA6B,CAAC,CAAC;QAE7D,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AAxFY,mBAAmB;IAD/B,cAAG,CAAC,0CAAyB,EAAE,6CAAwB,CAAC;GAC5C,mBAAmB,CAwF/B;AAxFY,kDAAmB","sourcesContent":["import type { APIApplicationCommandOption } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/CommandOptions';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandGroupsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Make sure there is no subcommand at the root level - if there is, throw\n\t\tconst hasSubcommands = options.some((item) => item instanceof SlashCommandSubcommandBuilder);\n\t\tif (hasSubcommands) throw new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Make sure there is no subcommand at the root level - if there is, throw\n\t\tconst hasSubcommandGroups = options.some((item) => itLine truncated
@@ -0,0 +1,64 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SharedSlashCommandOptions } from './mixins/CommandOptions';
import { SharedNameAndDescription } from './mixins/NameAndDescription';
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
/**
* Represents a folder for subcommands
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
export declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {
/**
* The name of this subcommand group
*/
readonly name: string;
/**
* The description of this subcommand group
*/
readonly description: string;
/**
* The subcommands part of this subcommand group
*/
readonly options: ToAPIApplicationCommandOptions[];
/**
* Adds a new subcommand to this group
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
toJSON(): {
type: ApplicationCommandOptionType;
name: string;
description: string;
options: import("discord-api-types/v9").APIApplicationCommandOption[];
};
}
export interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {
}
/**
* Represents a subcommand
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
export declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {
/**
* The name of this subcommand
*/
readonly name: string;
/**
* The description of this subcommand
*/
readonly description: string;
/**
* The options of this subcommand
*/
readonly options: ToAPIApplicationCommandOptions[];
toJSON(): {
type: ApplicationCommandOptionType;
name: string;
description: string;
options: import("discord-api-types/v9").APIApplicationCommandOption[];
};
}
export interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {
}
//# sourceMappingURL=SlashCommandSubcommands.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"SlashCommandSubcommands.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandSubcommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5E;;;;GAIG;AACH,qBACa,kCAAmC,YAAW,8BAA8B;IACxF;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAE/D;;;OAGG;IACI,aAAa,CACnB,KAAK,EACF,6BAA6B,GAC7B,CAAC,CAAC,eAAe,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAkBhF,MAAM;;;;;;CASb;AAED,MAAM,WAAW,kCAAmC,SAAQ,wBAAwB;CAAG;AAEvF;;;;GAIG;AACH,qBACa,6BAA8B,YAAW,8BAA8B;IACnF;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAExD,MAAM;;;;;;CASb;AAED,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,yBAAyB,CAAC,KAAK,CAAC;CAAG"}
@@ -0,0 +1,123 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandSubcommandBuilder = exports.SlashCommandSubcommandGroupBuilder = void 0;
const tslib_1 = require("tslib");
require("discord-api-types/v9");
const ts_mixer_1 = require("ts-mixer");
const Assertions_1 = require("./Assertions");
const CommandOptions_1 = require("./mixins/CommandOptions");
const NameAndDescription_1 = require("./mixins/NameAndDescription");
/**
* Represents a folder for subcommands
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
let SlashCommandSubcommandGroupBuilder = class SlashCommandSubcommandGroupBuilder {
constructor() {
/**
* The name of this subcommand group
*/
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The description of this subcommand group
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The subcommands part of this subcommand group
*/
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
}
/**
* Adds a new subcommand to this group
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Get the final result
const result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;
Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommandBuilder);
// Push it
options.push(result);
return this;
}
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, this.options);
return {
type: 2 /* SubcommandGroup */,
name: this.name,
description: this.description,
options: this.options.map((option) => option.toJSON()),
};
}
};
SlashCommandSubcommandGroupBuilder = tslib_1.__decorate([
ts_mixer_1.mix(NameAndDescription_1.SharedNameAndDescription)
], SlashCommandSubcommandGroupBuilder);
exports.SlashCommandSubcommandGroupBuilder = SlashCommandSubcommandGroupBuilder;
/**
* Represents a subcommand
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
let SlashCommandSubcommandBuilder = class SlashCommandSubcommandBuilder {
constructor() {
/**
* The name of this subcommand
*/
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The description of this subcommand
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The options of this subcommand
*/
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
}
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, this.options);
return {
type: 1 /* Subcommand */,
name: this.name,
description: this.description,
options: this.options.map((option) => option.toJSON()),
};
}
};
SlashCommandSubcommandBuilder = tslib_1.__decorate([
ts_mixer_1.mix(NameAndDescription_1.SharedNameAndDescription, CommandOptions_1.SharedSlashCommandOptions)
], SlashCommandSubcommandBuilder);
exports.SlashCommandSubcommandBuilder = SlashCommandSubcommandBuilder;
//# sourceMappingURL=SlashCommandSubcommands.js.map
@@ -0,0 +1 @@
{"version":3,"file":"SlashCommandSubcommands.js","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandSubcommands.ts"],"names":[],"mappings":";;;;AAAA,gCAAoE;AACpE,uCAA+B;AAC/B,6CAA2G;AAC3G,4DAAoE;AACpE,oEAAuE;AAGvE;;;;GAIG;AAEH,IAAa,kCAAkC,GAA/C,MAAa,kCAAkC;IAA/C;QACC;;WAEG;QACH;;;;mBAA+B,SAAU;WAAC;QAE1C;;WAEG;QACH;;;;mBAAsC,SAAU;WAAC;QAEjD;;WAEG;QACH;;;;mBAA4D,EAAE;WAAC;IAoChE,CAAC;IAlCA;;;OAGG;IACI,aAAa,CACnB,KAEsF;QAEtF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,6BAA6B,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhG,kCAAqB,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;QAE7D,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,OAAO;YACN,IAAI,yBAA8C;YAClD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SACtD,CAAC;IACH,CAAC;CACD,CAAA;AAlDY,kCAAkC;IAD9C,cAAG,CAAC,6CAAwB,CAAC;GACjB,kCAAkC,CAkD9C;AAlDY,gFAAkC;AAsD/C;;;;GAIG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IAA1C;QACC;;WAEG;QACH;;;;mBAA+B,SAAU;WAAC;QAE1C;;WAEG;QACH;;;;mBAAsC,SAAU;WAAC;QAEjD;;WAEG;QACH;;;;mBAA4D,EAAE;WAAC;IAWhE,CAAC;IATO,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,OAAO;YACN,IAAI,oBAAyC;YAC7C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SACtD,CAAC;IACH,CAAC;CACD,CAAA;AAzBY,6BAA6B;IADzC,cAAG,CAAC,6CAAwB,EAAE,0CAAyB,CAAC;GAC5C,6BAA6B,CAyBzC;AAzBY,sEAA6B","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/CommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilLine truncated
@@ -0,0 +1,20 @@
import type { ApplicationCommandOptionType } from 'discord-api-types/v9';
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
import { SharedNameAndDescription } from './NameAndDescription';
export declare class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {
required: boolean;
readonly type: ApplicationCommandOptionType;
constructor(type: ApplicationCommandOptionType);
/**
* Marks the option as required
* @param required If this option should be required
*/
setRequired(required: boolean): this;
toJSON(): {
type: ApplicationCommandOptionType;
name: string;
description: string;
required: boolean;
};
}
//# sourceMappingURL=CommandOptionBase.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandOptionBase.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,sBAAuB,SAAQ,wBAAyB,YAAW,8BAA8B;IACtG,QAAQ,UAAS;IACxB,SAAgB,IAAI,EAAE,4BAA4B,CAAC;gBAEhC,IAAI,EAAE,4BAA4B;IAKrD;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,OAAO;IAS7B,MAAM;;;;;;CAab"}
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandOptionBase = void 0;
const tslib_1 = require("tslib");
const ow_1 = tslib_1.__importDefault(require("ow"));
const Assertions_1 = require("../Assertions");
const NameAndDescription_1 = require("./NameAndDescription");
class SlashCommandOptionBase extends NameAndDescription_1.SharedNameAndDescription {
constructor(type) {
super();
Object.defineProperty(this, "required", {
enumerable: true,
configurable: true,
writable: true,
value: false
});
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.type = type;
}
/**
* Marks the option as required
* @param required If this option should be required
*/
setRequired(required) {
// Assert that you actually passed a boolean
ow_1.default(required, 'required', ow_1.default.boolean);
this.required = required;
return this;
}
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, []);
// Assert that you actually passed a boolean
ow_1.default(this.required, 'required', ow_1.default.boolean);
return {
type: this.type,
name: this.name,
description: this.description,
required: this.required,
};
}
}
exports.SlashCommandOptionBase = SlashCommandOptionBase;
//# sourceMappingURL=CommandOptionBase.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandOptionBase.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionBase.ts"],"names":[],"mappings":";;;;AACA,oDAAoB;AACpB,8CAA2D;AAE3D,6DAAgE;AAEhE,MAAa,sBAAuB,SAAQ,6CAAwB;IAInE,YAAmB,IAAkC;QACpD,KAAK,EAAE,CAAC;QAJT;;;;mBAAkB,KAAK;WAAC;QACxB;;;;;WAAmD;QAIlD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAiB;QACnC,4CAA4C;QAC5C,YAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAE,CAAC,OAAO,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAE5D,4CAA4C;QAC5C,YAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAE,CAAC,OAAO,CAAC,CAAC;QAE1C,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC;IACH,CAAC;CACD;AAnCD,wDAmCC","sourcesContent":["import type { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport ow from 'ow';\nimport { validateRequiredParameters } from '../Assertions';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {\n\tpublic required = false;\n\tpublic readonly type: ApplicationCommandOptionType;\n\n\tpublic constructor(type: ApplicationCommandOptionType) {\n\t\tsuper();\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Marks the option as required\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tow(required, 'required', ow.boolean);\n\n\t\tthis.required = required;\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tow(this.required, 'required', ow.boolean);\n\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\trequired: this.required,\n\t\t};\n\t}\n}\n"]}
@@ -0,0 +1,25 @@
import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
import { SlashCommandOptionBase } from './CommandOptionBase';
export declare abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number> extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions {
choices?: APIApplicationCommandOptionChoice[];
/**
* Adds a choice for this option
* @param name The name of the choice
* @param value The value of the choice
*/
addChoice(name: string, value: T): this;
/**
* Adds multiple choices for this option
* @param choices The choices to add
*/
addChoices(choices: [name: string, value: T][]): this;
toJSON(): {
choices: APIApplicationCommandOptionChoice[] | undefined;
type: ApplicationCommandOptionType;
name: string;
description: string;
required: boolean;
};
}
//# sourceMappingURL=CommandOptionWithChoices.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandOptionWithChoices.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionWithChoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGvG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAU7D,8BAAsB,uCAAuC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CACtF,SAAQ,sBACR,YAAW,8BAA8B;IAElC,OAAO,CAAC,EAAE,iCAAiC,EAAE,CAAC;IAErD;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAqBvC;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE;IAWrC,MAAM;;;;;;;CAMtB"}
@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationCommandOptionWithChoicesBase = void 0;
const tslib_1 = require("tslib");
require("discord-api-types/v9");
const ow_1 = tslib_1.__importDefault(require("ow"));
const Assertions_1 = require("../Assertions");
const CommandOptionBase_1 = require("./CommandOptionBase");
const stringPredicate = ow_1.default.string.minLength(1).maxLength(100);
const integerPredicate = ow_1.default.number.finite;
// TODO: See resolution for sindresorhus/ow#217 in relation to this cast
const choicesPredicate = ow_1.default.array.ofType(ow_1.default.array.exactShape([stringPredicate, ow_1.default.any(ow_1.default.string, integerPredicate)]));
class ApplicationCommandOptionWithChoicesBase extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(...arguments);
Object.defineProperty(this, "choices", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
/**
* Adds a choice for this option
* @param name The name of the choice
* @param value The value of the choice
*/
addChoice(name, value) {
this.choices ?? (this.choices = []);
Assertions_1.validateMaxChoicesLength(this.choices);
// Validate name
ow_1.default(name, `${this.type === 3 /* String */ ? 'string' : 'integer'} choice name`, stringPredicate);
// Validate the value
if (this.type === 3 /* String */)
ow_1.default(value, 'string choice value', stringPredicate);
else
ow_1.default(value, 'integer choice value', integerPredicate);
this.choices.push({ name, value });
return this;
}
/**
* Adds multiple choices for this option
* @param choices The choices to add
*/
addChoices(choices) {
ow_1.default(choices, `${this.type === 3 /* String */ ? 'string' : 'integer'} choices`, choicesPredicate);
for (const [label, value] of choices)
this.addChoice(label, value);
return this;
}
toJSON() {
return {
...super.toJSON(),
choices: this.choices,
};
}
}
exports.ApplicationCommandOptionWithChoicesBase = ApplicationCommandOptionWithChoicesBase;
//# sourceMappingURL=CommandOptionWithChoices.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandOptionWithChoices.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionWithChoices.ts"],"names":[],"mappings":";;;;AAAA,gCAAuG;AACvG,oDAAmC;AACnC,8CAAyD;AAEzD,2DAA6D;AAE7D,MAAM,eAAe,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC9D,MAAM,gBAAgB,GAAG,YAAE,CAAC,MAAM,CAAC,MAAM,CAAC;AAE1C,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,YAAE,CAAC,KAAK,CAAC,MAAM,CACvC,YAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,EAAE,gBAAgB,CAA0C,CAAC,CAAC,CACpH,CAAC;AAEF,MAAsB,uCACrB,SAAQ,0CAAsB;IAD/B;;QAIC;;;;;WAAqD;IAiDtD,CAAC;IA/CA;;;;OAIG;IACI,SAAS,CAAC,IAAY,EAAE,KAAQ;QACtC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;QAEpB,qCAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEvC,gBAAgB;QAChB,YAAE,CACD,IAAI,EACJ,GAAG,IAAI,CAAC,IAAI,mBAAwC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,cAAc,EACzF,eAAe,CACf,CAAC;QAEF,qBAAqB;QACrB,IAAI,IAAI,CAAC,IAAI,mBAAwC;YAAE,YAAE,CAAC,KAAK,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;;YACpG,YAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,CAAC,CAAC;QAEzD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,OAAmC;QACpD,YAAE,CACD,OAAO,EACP,GAAG,IAAI,CAAC,IAAI,mBAAwC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,UAAU,EACrF,gBAAgB,CAChB,CAAC;QAEF,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,OAAO;YAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACb,CAAC;IAEe,MAAM;QACrB,OAAO;YACN,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AArDD,0FAqDC","sourcesContent":["import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport ow, { Predicate } from 'ow';\nimport { validateMaxChoicesLength } from '../Assertions';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\nimport { SlashCommandOptionBase } from './CommandOptionBase';\n\nconst stringPredicate = ow.string.minLength(1).maxLength(100);\nconst integerPredicate = ow.number.finite;\n\n// TODO: See resolution for sindresorhus/ow#217 in relation to this cast\nconst choicesPredicate = ow.array.ofType<[string, string | number]>(\n\tow.array.exactShape([stringPredicate, ow.any(ow.string, integerPredicate) as unknown as Predicate<string | number>]),\n);\n\nexport abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number>\n\textends SlashCommandOptionBase\n\timplements ToAPIApplicationCommandOptions\n{\n\tpublic choices?: APIApplicationCommandOptionChoice[];\n\n\t/**\n\t * Adds a choice for this option\n\t * @param name The name of the choice\n\t * @param value The value of the choice\n\t */\n\tpublic addChoice(name: string, value: T) {\n\t\tthis.choices ??= [];\n\n\t\tvalidateMaxChoicesLength(this.choices);\n\n\t\t// Validate name\n\t\tow(\n\t\t\tname,\n\t\t\t`${this.type === ApplicationCommandOptionType.String ? 'string' : 'integer'} choice name`,\n\t\t\tstringPredicate,\n\t\t);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) ow(value, 'string choice value', stringPredicate);\n\t\telse ow(value, 'integer choice value', integerPredicate);\n\n\t\tthis.choices.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(choices: [name: string, value: T][]) {\n\t\tow(\n\t\t\tchoices,\n\t\t\t`${this.type === ApplicationCommandOptionType.String ? 'string' : 'integer'} choices`,\n\t\t\tchoicesPredicate,\n\t\t);\n\n\t\tfor (const [label, value] of choices) this.addChoice(label, value);\n\t\treturn this;\n\t}\n\n\tpublic override toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\tchoices: this.choices,\n\t\t};\n\t}\n}\n"]}
@@ -0,0 +1,48 @@
import { SlashCommandBooleanOption } from '../options/boolean';
import { SlashCommandChannelOption } from '../options/channel';
import { SlashCommandIntegerOption } from '../options/integer';
import { SlashCommandMentionableOption } from '../options/mentionable';
import { SlashCommandRoleOption } from '../options/role';
import { SlashCommandStringOption } from '../options/string';
import { SlashCommandUserOption } from '../options/user';
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
export declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
readonly options: ToAPIApplicationCommandOptions[];
/**
* Adds a boolean option
* @param input A function that returns an option builder, or an already built builder
*/
addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a user option
* @param input A function that returns an option builder, or an already built builder
*/
addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a channel option
* @param input A function that returns an option builder, or an already built builder
*/
addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a role option
* @param input A function that returns an option builder, or an already built builder
*/
addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a mentionable option
* @param input A function that returns an option builder, or an already built builder
*/
addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a string option
* @param input A function that returns an option builder, or an already built builder
*/
addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds an integer option
* @param input A function that returns an option builder, or an already built builder
*/
addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
private _sharedAddOptionMethod;
}
//# sourceMappingURL=CommandOptions.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandOptions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAE7E,qBAAa,yBAAyB,CAAC,6BAA6B,GAAG,IAAI;IAC1E,SAAgB,OAAO,EAAG,8BAA8B,EAAE,CAAC;IAE3D;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,oBAAoB,CAC1B,KAAK,EAAE,6BAA6B,GAAG,CAAC,CAAC,OAAO,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAKnH;;;OAGG;IACI,eAAe,CACrB,KAAK,EAAE,wBAAwB,GAAG,CAAC,CAAC,OAAO,EAAE,wBAAwB,KAAK,wBAAwB,CAAC;IAKpG;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG,OAAO,CAAC,sBAAsB;CAmB9B"}
@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedSlashCommandOptions = void 0;
const Assertions_1 = require("../Assertions");
const boolean_1 = require("../options/boolean");
const channel_1 = require("../options/channel");
const integer_1 = require("../options/integer");
const mentionable_1 = require("../options/mentionable");
const role_1 = require("../options/role");
const string_1 = require("../options/string");
const user_1 = require("../options/user");
class SharedSlashCommandOptions {
constructor() {
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
/**
* Adds a boolean option
* @param input A function that returns an option builder, or an already built builder
*/
addBooleanOption(input) {
return this._sharedAddOptionMethod(input, boolean_1.SlashCommandBooleanOption);
}
/**
* Adds a user option
* @param input A function that returns an option builder, or an already built builder
*/
addUserOption(input) {
return this._sharedAddOptionMethod(input, user_1.SlashCommandUserOption);
}
/**
* Adds a channel option
* @param input A function that returns an option builder, or an already built builder
*/
addChannelOption(input) {
return this._sharedAddOptionMethod(input, channel_1.SlashCommandChannelOption);
}
/**
* Adds a role option
* @param input A function that returns an option builder, or an already built builder
*/
addRoleOption(input) {
return this._sharedAddOptionMethod(input, role_1.SlashCommandRoleOption);
}
/**
* Adds a mentionable option
* @param input A function that returns an option builder, or an already built builder
*/
addMentionableOption(input) {
return this._sharedAddOptionMethod(input, mentionable_1.SlashCommandMentionableOption);
}
/**
* Adds a string option
* @param input A function that returns an option builder, or an already built builder
*/
addStringOption(input) {
return this._sharedAddOptionMethod(input, string_1.SlashCommandStringOption);
}
/**
* Adds an integer option
* @param input A function that returns an option builder, or an already built builder
*/
addIntegerOption(input) {
return this._sharedAddOptionMethod(input, integer_1.SlashCommandIntegerOption);
}
_sharedAddOptionMethod(input, Instance) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Get the final result
const result = typeof input === 'function' ? input(new Instance()) : input;
Assertions_1.assertReturnOfBuilder(result, Instance);
// Push it
options.push(result);
return this;
}
}
exports.SharedSlashCommandOptions = SharedSlashCommandOptions;
//# sourceMappingURL=CommandOptions.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandOptions.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":";;;AAAA,8CAAgF;AAEhF,gDAA+D;AAC/D,gDAA+D;AAC/D,gDAA+D;AAC/D,wDAAuE;AACvE,0CAAyD;AACzD,8CAA6D;AAC7D,0CAAyD;AAGzD,MAAa,yBAAyB;IAAtC;QACC;;;;;WAA2D;IAuF5D,CAAC;IArFA;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,mCAAyB,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,KAA6F;QACjH,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,6BAAsB,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,mCAAyB,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,KAA6F;QACjH,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,6BAAsB,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,oBAAoB,CAC1B,KAAkH;QAElH,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,2CAA6B,CAAC,CAAC;IAC1E,CAAC;IAED;;;OAGG;IACI,eAAe,CACrB,KAAmG;QAEnG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,iCAAwB,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,mCAAyB,CAAC,CAAC;IACtE,CAAC;IAEO,sBAAsB,CAC7B,KAA8B,EAC9B,QAAqB;QAErB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAE3E,kCAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAExC,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAxFD,8DAwFC","sourcesContent":["import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { SlashCommandOptionBase } from './CommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\tprivate _sharedAddOptionMethod<T extends SlashCommandOptionBase>(\n\t\tinput: T | ((builder: T) => T),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit<this, 'addSubcommand' | 'addSubcommandGroup'> : this {\n\t\tconLine truncated
@@ -0,0 +1,15 @@
export declare class SharedNameAndDescription {
readonly name: string;
readonly description: string;
/**
* Sets the name
* @param name The name
*/
setName(name: string): this;
/**
* Sets the description
* @param description The description
*/
setDescription(description: string): this;
}
//# sourceMappingURL=NameAndDescription.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"NameAndDescription.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":"AAEA,qBAAa,wBAAwB;IACpC,SAAgB,IAAI,EAAG,MAAM,CAAC;IAC9B,SAAgB,WAAW,EAAG,MAAM,CAAC;IAErC;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,MAAM;IAS3B;;;OAGG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM;CAQzC"}
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedNameAndDescription = void 0;
const Assertions_1 = require("../Assertions");
class SharedNameAndDescription {
constructor() {
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
/**
* Sets the name
* @param name The name
*/
setName(name) {
// Assert the name matches the conditions
Assertions_1.validateName(name);
Reflect.set(this, 'name', name);
return this;
}
/**
* Sets the description
* @param description The description
*/
setDescription(description) {
// Assert the description matches the conditions
Assertions_1.validateDescription(description);
Reflect.set(this, 'description', description);
return this;
}
}
exports.SharedNameAndDescription = SharedNameAndDescription;
//# sourceMappingURL=NameAndDescription.js.map
@@ -0,0 +1 @@
{"version":3,"file":"NameAndDescription.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":";;;AAAA,8CAAkE;AAElE,MAAa,wBAAwB;IAArC;QACC;;;;;WAA8B;QAC9B;;;;;WAAqC;IA2BtC,CAAC;IAzBA;;;OAGG;IACI,OAAO,CAAC,IAAY;QAC1B,yCAAyC;QACzC,yBAAY,CAAC,IAAI,CAAC,CAAC;QAEnB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,WAAmB;QACxC,gDAAgD;QAChD,gCAAmB,CAAC,WAAW,CAAC,CAAC;QAEjC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA7BD,4DA6BC","sourcesContent":["import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandBooleanOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Boolean;
constructor();
}
//# sourceMappingURL=boolean.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"boolean.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandBooleanOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandBooleanOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(5 /* Boolean */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 5 /* Boolean */
});
}
}
exports.SlashCommandBooleanOption = SlashCommandBooleanOption;
//# sourceMappingURL=boolean.js.map
@@ -0,0 +1 @@
{"version":3,"file":"boolean.js","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandBooleanOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Boolean);\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandChannelOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Channel;
constructor();
}
//# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"channel.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandChannelOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandChannelOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(7 /* Channel */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 7 /* Channel */
});
}
}
exports.SlashCommandChannelOption = SlashCommandChannelOption;
//# sourceMappingURL=channel.js.map
@@ -0,0 +1 @@
{"version":3,"file":"channel.js","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandChannelOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Channel);\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
export declare class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {
readonly type: ApplicationCommandOptionType.Integer;
constructor();
}
//# sourceMappingURL=integer.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"integer.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,yBAA0B,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC7F,SAAyB,IAAI,uCAAiD;;CAK9E"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandIntegerOption = void 0;
require("discord-api-types/v9");
const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
class SlashCommandIntegerOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
constructor() {
super(4 /* Integer */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 4 /* Integer */
});
}
}
exports.SlashCommandIntegerOption = SlashCommandIntegerOption;
//# sourceMappingURL=integer.js.map
@@ -0,0 +1 @@
{"version":3,"file":"integer.js","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,yBAA0B,SAAQ,kEAA+C;IAG7F;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {\n\tpublic override readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Integer);\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandMentionableOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Mentionable;
constructor();
}
//# sourceMappingURL=mentionable.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"mentionable.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,6BAA8B,SAAQ,sBAAsB;IACxE,SAAyB,IAAI,2CAAqD;;CAKlF"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandMentionableOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandMentionableOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(9 /* Mentionable */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 9 /* Mentionable */
});
}
}
exports.SlashCommandMentionableOption = SlashCommandMentionableOption;
//# sourceMappingURL=mentionable.js.map
@@ -0,0 +1 @@
{"version":3,"file":"mentionable.js","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,6BAA8B,SAAQ,0CAAsB;IAGxE;QACC,KAAK,qBAA0C,CAAC;QAHjD;;;;mBAAgC,mBAAiD;WAAC;IAIlF,CAAC;CACD;AAND,sEAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandMentionableOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Mentionable);\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandRoleOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Role;
constructor();
}
//# sourceMappingURL=role.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"role.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandRoleOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandRoleOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(8 /* Role */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 8 /* Role */
});
}
}
exports.SlashCommandRoleOption = SlashCommandRoleOption;
//# sourceMappingURL=role.js.map
@@ -0,0 +1 @@
{"version":3,"file":"role.js","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandRoleOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Role);\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
export declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {
readonly type: ApplicationCommandOptionType.String;
constructor();
}
//# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"string.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,wBAAyB,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC5F,SAAyB,IAAI,sCAAgD;;CAK7E"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandStringOption = void 0;
require("discord-api-types/v9");
const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
class SlashCommandStringOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
constructor() {
super(3 /* String */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 3 /* String */
});
}
}
exports.SlashCommandStringOption = SlashCommandStringOption;
//# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
{"version":3,"file":"string.js","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,wBAAyB,SAAQ,kEAA+C;IAG5F;QACC,KAAK,gBAAqC,CAAC;QAH5C;;;;mBAAgC,cAA4C;WAAC;IAI7E,CAAC;CACD;AAND,4DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {\n\tpublic override readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.String);\n\t}\n}\n"]}
@@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandUserOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.User;
constructor();
}
//# sourceMappingURL=user.d.ts.map
Loaded 100 of 1286 files, more files were not shown because too many files have changed in this diff. Show more