.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..add080b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,142 @@
+> ### 🎥 Content Creators 🎥
+> Hey there! We're searching for content creators that would want to create a tutorial or setup guide for Open Ticket!
+> [📌 More Information](.github/CONTENT_CREATORS.md)
+---
+
+
+
+ Powered By
+
+
+
+
+
+
+
+
+
+Open Ticket is the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts
, Advanced Plugins
, Custom Embeds
, Questions/Modals
, Stats
& more!
+You're also able to customise every little aspect of the bot! From embeds to transcripts. Open Ticket is also translated in more than 32 Languages
! If you need any help, feel free to join our discord server !
+
+
+⭐️ Help us grow by giving a star! ⭐️
+
+> [!WARNING]
+> Open Ticket v4 is still in beta! Please report all bugs in our [discord server](https://discord.dj-dj.be)!
+> The translation count may not be accurate!
+
+### 📌 Features
+- **📄 html transcripts** - Make use of the most customisable, beautiful and easy-to-use HTML Transcripts!
+- **✅ ticket actions** - Close, Reopen, Delete, Rename & Move all your tickets!
+- **🇬🇧 translation** - Open Ticket has been translated in more than **32 languages** by our community!
+- **🎨 customisation** - Open Ticket has been created around customisation, everything can be customised!
+- **🖥️ interactions** - The bot has full support for Buttons, Dropdowns, Slash Commands and Modals!
+- **∞ unlimited everywhere** - Create an infinite amount of tickets & panels!
+- **📝 advanced plugins** - Create the most advanced plugins that you want or use premade ones by our community!
+- **👥 user management** - Add & Remove users from all tickets!
+- **📊 detailed stats** - Open Ticket has ticket, user & global staticstics available for everyone!
+- **🚫 blacklist** - Blacklist users to prevent them from creating a ticket!
+- **❓ questions** - Let users answer questions in a modal before the ticket is created!
+- **📦 commands** - Open Ticket supports both slash & text commands!
+- **📥 extra types** - The bot also supports Reaction Roles & Url Buttons, because why not ¯\\_(ツ)_/¯
+- **🎛️ dependencies** - We try to use as little external dependencies as needed!
+
+> ### 📦 Resources
+> Resources might not be accurate yet! *(because v4 is still in beta)*
+>
+>
+>
+
+## 📸 Preview
+*Previews are not available yet in the beta release!*
+
+## 🧩 Plugins
+View all available Open Ticket plugins in our [Official Plugin Repository](https://github.com/DJj123dj/open-discord-plugins)!
+
+### 📦 Official *(made by us)*
+|Name |Description |
+|----------------------|-------------------------|
+|`nothing yet :)` |Lorem Ipsum Beta 4.0 🙃 |
+
+### ✅ Verified *(made by community)*
+|Name |Description |
+|----------------------|-------------------------|
+|`nothing yet :)` |Lorem Ipsum Beta 4.0 🙃 |
+
+## 🛠️ Contributors
+### 🖥️ Team
+The team behind Open Ticket!
+
+
+### ❤️ Sponsors
+A big thanks to all our sponsors! Without them, it wouldn't be possible to create this project!
+
+| | | |
+|----|-|-|
+|**[SpyEye](https://github.com/SpyEye2)**|**[DOSEV5](https://github.com/DOSEV5)**|**[Mods HD](https://github.com/mods-hd)**|
+
+### 💬 Translators
+|Language |Maintainer (discord name) |Status |
+|---------------------|--------------------------|---------------|
+|🇬🇧 English |djj123dj |🟢 Up To Date |
+|🇳🇱 Dutch |djj123dj |🟢 Up To Date |
+|🇵🇹 Portuguese |quiradon |🟢 Up To Date |
+|🇨🇿 Czech |spyeye_ |🟢 Up To Date |
+|🇫🇷 French |sankedev & tostam |🟠 Temporary Outdated (beta) |
+|🇷🇴 Romanian |sankedev |🟠 Temporary Outdated (beta) |
+|🇪🇸 Spanish |redactado & josuens |🟠 Temporary Outdated (beta) |
+|🇩🇪 German |david.3 |🟠 Temporary Outdated (beta) |
+|🇮🇹 Italian |maurizio26 |🟠 Temporary Outdated (beta) |
+|🇦🇪 Arabic |deqressing |🟠 Temporary Outdated (beta) |
+|🇩🇰 Danish |.the_gamer |🟠 Temporary Outdated (beta) |
+|🇷🇺 Russian |apexo & ander |🟠 Temporary Outdated (beta) |
+|🇺🇦 Ukrainian |ander |🟠 Temporary Outdated (beta) |
+|🇹🇷 Turkish |0x15d3 |🟠 Temporary Outdated (beta) |
+|🇵🇱 Polish |mkevas |🟠 Temporary Outdated (beta) |
+|🇸🇮 Slovenian |n1kkec |🔴 Outdated |
+|🇹🇭 Thai |modshd |🟠 Temporary Outdated (beta) |
+|🇳🇴 Norwegian |noonenook |🟠 Temporary Outdated (beta) |
+|🇬🇷 Greek |stefanos__. |🔴 Outdated |
+|🇮🇩 Indonesian |erxg |🟠 Temporary Outdated (beta) |
+|❓ Kurdish |raze.hama |🟠 Temporary Outdated (beta) |
+|🇭🇺 Hungarian |kornel0706 |🟠 Temporary Outdated (beta) |
+|❓ Persian |sasanwm |🟠 Temporary Outdated (beta) |
+|🇱🇻 Latvian |ronalds1398 |🟠 Temporary Outdated (beta) |
+|🇪🇪 Estonian |iamnotmega |🟠 Temporary Outdated (beta) |
+|🇯🇵 Japanese |iamnotmega |🟠 Temporary Outdated (beta) |
+|🇰🇷 Korean |iamnotmega |🟠 Temporary Outdated (beta) |
+|🇨🇳 Simplified Chinese |iamnotmega |🟠 Temporary Outdated (beta) |
+|🇨🇳 Traditional Chinese|iamnotmega |🟠 Temporary Outdated (beta) |
+|🇫🇮 Finnish |iamnotmega |🟠 Temporary Outdated (beta) |
+|🇸🇪 Swedish |iamnotmega |🟠 Temporary Outdated (beta) |
+|🇻🇳 Vietnamese |iamnotmega |🟠 Temporary Outdated (beta) |
+
+
+
+## ⭐️ Star History
+Please help us grow by giving a star! It would help us a lot!
+
+
+
+
+
+
+
+
+
+---
+
+
+**README.md**
+[changelog](https://otgithub.dj-dj.be/releases) - [documentation](https://otdocs.dj-dj.be) - [tutorial](https://www.youtube.com/watch?v=2jK9kAf6ASU) - [website](https://openticket.dj-dj.be) - [discord](https://discord.dj-dj.be)
+
+© 2024 - [DJdj Development](https://www.dj-dj.be) - [Terms](https://www.dj-dj.be/terms#terms) - [Privacy Policy](https://www.dj-dj.be/terms#privacy)
\ No newline at end of file
diff --git a/config/general.json b/config/general.json
new file mode 100644
index 0000000..b45ca8f
--- /dev/null
+++ b/config/general.json
@@ -0,0 +1,95 @@
+{
+ "_INFO":{
+ "support":"https://otdocs.dj-dj.be",
+ "discord":"https://discord.dj-dj.be",
+ "version":"open-ticket-v4.0.0"
+ },
+
+ "token":"your bot token here! Or leave empty when you use tokenFromENV",
+ "tokenFromENV":false,
+
+ "mainColor":"#f8ba00",
+ "language":"english",
+ "prefix":"!ticket ",
+ "serverId":"discord server id",
+ "globalAdmins":["discord role id"],
+
+ "slashCommands":true,
+ "textCommands":true,
+
+ "status":{
+ "enabled":true,
+ "type":"listening OR watching OR playing OR custom",
+ "text":"/help",
+ "status":"online OR invisible OR idle OR dnd"
+ },
+
+ "system":{
+ "removeParticipantsOnClose":false,
+ "replyOnTicketCreation":true,
+ "replyOnReactionRole":true,
+ "useTranslatedConfigChecker":true,
+ "preferSlashOverText":true,
+ "sendErrorOnUnknownCommand":true,
+ "questionFieldsInCodeBlock":true,
+ "disableVerifyBars":false,
+ "useRedErrorEmbeds":true,
+ "emojiStyle":"before (OR after OR double OR disabled)",
+
+ "enableTicketClaimButtons":true,
+ "enableTicketCloseButtons":true,
+ "enableTicketPinButtons":true,
+ "enableTicketDeleteButtons":true,
+ "enableTicketActionWithReason":true,
+ "enableDeleteWithoutTranscript":true,
+
+ "logs":{
+ "enabled":false,
+ "channel":"discord channel id"
+ },
+
+ "limits":{
+ "enabled":true,
+ "globalMaximum":50,
+ "userMaximum":3
+ },
+
+ "permissions":{
+ "help":"everyone (OR admin OR none OR role id)",
+ "panel":"admin (OR everyone OR none OR role id)",
+ "ticket":"none (OR admin OR everyone OR role id)",
+ "close":"everyone (OR admin OR none OR role id)",
+ "delete":"admin (OR everyone OR none OR role id)",
+ "reopen":"everyone (OR admin OR none OR role id)",
+ "claim":"admin (OR everyone OR none OR role id)",
+ "unclaim":"admin (OR everyone OR none OR role id)",
+ "pin":"admin (OR everyone OR none OR role id)",
+ "unpin":"admin (OR everyone OR none OR role id)",
+ "move":"admin (OR everyone OR none OR role id)",
+ "rename":"admin (OR everyone OR none OR role id)",
+ "add":"admin (OR everyone OR none OR role id)",
+ "remove":"admin (OR everyone OR none OR role id)",
+ "blacklist":"admin (OR everyone OR none OR role id)",
+ "stats":"everyone (OR admin OR none OR role id)",
+ "clear":"admin (OR everyone OR none OR role id)",
+ "autoclose":"admin (OR everyone OR none OR role id)",
+ "autodelete":"admin (OR everyone OR none OR role id)"
+ },
+
+ "messages":{
+ "creation":{"dm":false, "logs":true},
+ "closing":{"dm":false, "logs":true},
+ "deleting":{"dm":false, "logs":true},
+ "reopening":{"dm":false, "logs":true},
+ "claiming":{"dm":false, "logs":true},
+ "pinning":{"dm":false, "logs":true},
+ "adding":{"dm":false, "logs":true},
+ "removing":{"dm":false, "logs":true},
+ "renaming":{"dm":false, "logs":true},
+ "moving":{"dm":false, "logs":true},
+ "blacklisting":{"dm":false, "logs":true},
+ "roleAdding":{"dm":false, "logs":true},
+ "roleRemoving":{"dm":false, "logs":true}
+ }
+ }
+}
\ No newline at end of file
diff --git a/config/options.json b/config/options.json
new file mode 100644
index 0000000..6dc8604
--- /dev/null
+++ b/config/options.json
@@ -0,0 +1,122 @@
+[
+ {
+ "id":"example-ticket",
+ "name":"Question",
+ "description":"Create this ticket if you have a question! (or leave empty)",
+ "type":"ticket",
+
+ "button":{
+ "emoji":"🎫 (or leave empty)",
+ "label":"question (or leave empty)",
+ "color":"gray OR red OR green OR blue"
+ },
+
+ "ticketAdmins":["discord role id"],
+ "readonlyAdmins":["discord role id"],
+ "allowCreationByBlacklistedUsers":false,
+ "questions":["example-question-1","example-question-2"],
+
+ "channel":{
+ "prefix":"question-",
+ "suffix":"user-name OR user-id OR random-number OR random-hex OR counter-dynamic OR counter-fixed",
+ "category":"category id (or leave empty)",
+ "closedCategory":"category id (or leave empty)",
+ "backupCategory":"category id (or leave empty)",
+ "claimedCategory":[
+ {"user":"user id","category":"category id"}
+ ],
+ "description":"This is a question ticket (or leave empty)"
+ },
+
+ "dmMessage":{
+ "enabled":false,
+ "text":"Thanks for creating a ticket in our server! (or leave empty)",
+ "embed":{
+ "enabled":false,
+ "title":"Embed Title! (or leave empty)",
+ "description":"Description (or leave empty)",
+ "customColor":"#f8ab00 (or leave empty)",
+
+ "image":"https://www.example.com/image.png (or leave empty)",
+ "thumbnail":"https://www.example.com/image.png (or leave empty)",
+ "fields":[
+ {"name":"field name","value":"field value","inline":false}
+ ],
+ "timestamp":false
+ }
+ },
+ "ticketMessage":{
+ "enabled":true,
+ "text":"",
+ "embed":{
+ "enabled":true,
+ "title":"Question Ticket",
+ "description":"Thanks for creating a 'Question' ticket in our server!\nOur support team will help you soon!",
+ "customColor":"#f8ab00 (or leave empty)",
+
+ "image":"https://www.example.com/image.png (or leave empty)",
+ "thumbnail":"https://www.example.com/image.png (or leave empty)",
+ "fields":[
+ {"name":"field name","value":"field value","inline":false}
+ ],
+ "timestamp":false
+ },
+ "ping":{
+ "@here":true,
+ "@everyone":false,
+ "custom":["discord role id"]
+ }
+ },
+ "autoclose":{
+ "enableInactiveHours":false,
+ "inactiveHours":24,
+ "enableUserLeave":true,
+ "disableOnClaim":false
+ },
+ "autodelete":{
+ "enableInactiveDays":false,
+ "inactiveDays":7,
+ "enableUserLeave":true,
+ "disableOnClaim":false
+ },
+ "cooldown":{
+ "enabled":false,
+ "cooldownMinutes":10
+ },
+ "limits":{
+ "enabled":false,
+ "globalMaximum":20,
+ "userMaximum":3
+ }
+ },
+ {
+ "id":"example-website",
+ "name":"Website",
+ "description":"Go to our website.",
+ "type":"website",
+
+ "button":{
+ "emoji":"😃",
+ "label":"Visit our website"
+ },
+
+ "url":"https://www.dj-dj.be"
+ },
+ {
+ "id":"example-role",
+ "name":"Update Ping",
+ "description":"Click here to get notified on updates!",
+ "type":"role",
+
+ "button":{
+ "emoji":"📢",
+ "label":"Update Ping",
+ "color":"gray OR red OR green OR blue"
+ },
+
+ "roles":["discord role id"],
+ "mode":"add&remove OR remove OR add",
+ "removeRolesOnAdd":["discord role id"],
+ "addOnMemberJoin":false
+ }
+]
\ No newline at end of file
diff --git a/config/panels.json b/config/panels.json
new file mode 100644
index 0000000..805ced5
--- /dev/null
+++ b/config/panels.json
@@ -0,0 +1,39 @@
+[
+ {
+ "id":"example-embed",
+ "name":"Example Embed",
+ "dropdown":false,
+ "options":["example-ticket","example-website","example-role"],
+
+ "text":"",
+ "embed":{
+ "enabled":true,
+ "title":"Tickets:",
+ "description":"Create a ticket by clicking one of the buttons below!",
+
+ "customColor":"#f8ab00 (or leave empty)",
+ "url":"https://openticket.dj-dj.be (or leave empty)",
+
+ "image":"https://www.example.com/image.png (or leave empty)",
+ "thumbnail":"https://www.example.com/image.png (or leave empty)",
+
+ "footer":"Open Ticket v4.0.0 (or leave empty)",
+ "fields":[
+ {"name":"field name","value":"field value","inline":false}
+ ],
+ "timestamp":false
+ },
+ "settings":{
+ "dropdownPlaceholder":"Create a ticket!",
+
+ "enableMaxTicketsWarningInText":false,
+ "enableMaxTicketsWarningInEmbed":true,
+
+ "describeOptionsLayout":"simple OR normal OR detailed",
+ "describeOptionsCustomTitle":"",
+ "describeOptionsInText":false,
+ "describeOptionsInEmbedFields":true,
+ "describeOptionsInEmbedDescription":false
+ }
+ }
+]
\ No newline at end of file
diff --git a/config/questions.json b/config/questions.json
new file mode 100644
index 0000000..0d2556e
--- /dev/null
+++ b/config/questions.json
@@ -0,0 +1,28 @@
+[
+ {
+ "id":"example-question-1",
+ "name":"Example Question 1",
+ "type":"short",
+
+ "required":true,
+ "placeholder":"Insert your short answer here!",
+ "length":{
+ "enabled":false,
+ "min":0,
+ "max":1000
+ }
+ },
+ {
+ "id":"example-question-2",
+ "name":"Example Question 2",
+ "type":"paragraph",
+
+ "required":false,
+ "placeholder":"Insert your long answer here!",
+ "length":{
+ "enabled":false,
+ "min":0,
+ "max":1000
+ }
+ }
+]
\ No newline at end of file
diff --git a/config/transcripts.json b/config/transcripts.json
new file mode 100644
index 0000000..5ce9a88
--- /dev/null
+++ b/config/transcripts.json
@@ -0,0 +1,57 @@
+{
+ "general":{
+ "enabled":false,
+
+ "enableChannel":false,
+ "enableCreatorDM":false,
+ "enableParticipantDM":false,
+ "enableActiveAdminDM":false,
+ "enableEveryAdminDM":false,
+
+ "channel":"transcript channel id (or leave empty)",
+ "mode":"html OR text"
+ },
+ "embedSettings":{
+ "customColor":"#f8ab00 (or leave empty)",
+ "listAllParticipants":false,
+ "includeTicketStats":false
+ },
+ "textTranscriptStyle":{
+ "layout":"simple OR normal OR detailed",
+ "includeStats":true,
+ "includeIds":false,
+ "includeEmbeds":true,
+ "includeFiles":true,
+ "includeBotMessages":true,
+
+ "fileMode":"custom OR channel-name OR channel-id OR user-name OR user-id",
+ "customFileName":"this-is-a-transcript (or leave empty)"
+ },
+ "htmlTranscriptStyle":{
+ "background":{
+ "enableCustomBackground":false,
+ "backgroundColor":"#f8ba00 (or leave empty)",
+ "backgroundImage":"https://www.example.com/image.png (or leave empty)"
+
+ },
+ "header":{
+ "enableCustomHeader":false,
+ "backgroundColor":"#202225",
+ "decoColor":"#f8ba00",
+ "textColor":"#ffffff"
+
+ },
+ "stats":{
+ "enableCustomStats":false,
+ "backgroundColor":"#202225",
+ "keyTextColor":"#737373",
+ "valueTextColor":"#ffffff",
+ "hideBackgroundColor":"#40444a",
+ "hideTextColor":"#ffffff"
+ },
+ "favicon":{
+ "enableCustomFavicon":false,
+ "imageUrl":"https://transcripts.dj-dj.be/favicon.png"
+ }
+ }
+}
\ No newline at end of file
diff --git a/database/global.json b/database/global.json
new file mode 100644
index 0000000..fb44b71
--- /dev/null
+++ b/database/global.json
@@ -0,0 +1,7 @@
+[
+ {"category":"openticket:last-version","key":"openticket:version","value":"v4.0.0"},
+ {"category":"openticket:last-version","key":"openticket:api","value":"v1.0.0"},
+ {"category":"openticket:last-version","key":"openticket:transcripts","value":"v2.0.0"},
+ {"category":"openticket:last-version","key":"openticket:livestatus","value":"v2.0.0"},
+ {"category":"openticket:last-version","key":"openticket:last-version","value":"v4.0.0"}
+]
\ No newline at end of file
diff --git a/database/options.json b/database/options.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/database/options.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/database/stats.json b/database/stats.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/database/stats.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/database/tickets.json b/database/tickets.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/database/tickets.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/database/users.json b/database/users.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/database/users.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/languages/custom.json b/languages/custom.json
new file mode 100644
index 0000000..8d36a30
--- /dev/null
+++ b/languages/custom.json
@@ -0,0 +1,477 @@
+{
+ "_TRANSLATION":{
+ "otversion":"v4.0.0",
+ "translator":"DJj123dj",
+ "lastedited":"21/08/2024",
+ "language":"Custom"
+ },
+ "checker":{
+ "system":{
+ "typeError":"[ERROR]",
+ "headerOpenTicket":"OPEN TICKET",
+ "typeWarning":"[WARNING]",
+ "typeInfo":"[INFO]",
+ "headerConfigChecker":"CONFIG CHECKER",
+ "headerDescription":"check for errors in you config files!",
+ "footerError":"the bot won't start until all {0}'s are fixed!",
+ "footerWarning":"it's recommended to fix all {0}'s before starting!",
+ "footerSupport":"SUPPORT: {0} - DOCS: {1}",
+ "compactInformation":"use {0} for more information!",
+ "dataPath":"path",
+ "dataDocs":"docs",
+ "dataMessages":"message"
+ },
+ "messages":{
+ "stringTooShort":"This string can't be shorter than {0} characters!",
+ "stringTooLong":"This string can't be longer than {0} characters!",
+ "stringLengthInvalid":"This string needs to be {0} characters long!",
+ "stringStartsWith":"This string needs to start with {0}!",
+ "stringEndsWith":"This string needs to end with {0}!",
+ "stringContains":"This string needs to contain {0}!",
+ "stringChoices":"This string can only be one of the following values: {0}!",
+ "stringRegex":"This string is invalid!",
+
+ "numberTooShort":"This number can't be shorter than {0} characters!",
+ "numberTooLong":"This number can't be longer than {0} characters!",
+ "numberLengthInvalid":"This number needs to be {0} characters long!",
+ "numberTooSmall":"This number needs to be at least {0}!",
+ "numberTooLarge":"This number needs to be at most {0}!",
+ "numberNotEqual":"This number needs to be {0}!",
+ "numberStep":"This number needs to be a multiple of {0}!",
+ "numberStepOffset":"This number needs to be a multiple of {0} starting with {1}!",
+ "numberStartsWith":"This number needs to start with {0}!",
+ "numberEndsWith":"This number needs to end with {0}!",
+ "numberContains":"This number needs to contain {0}!",
+ "numberChoices":"This number can only be one of the following values: {0}!",
+ "numberFloat":"This number can't be a decimal!",
+ "numberNegative":"This number can't be negative!",
+ "numberPositive":"This number can't be positive!",
+ "numberZero":"This number can't be zero!",
+
+ "booleanTrue":"This boolean can't be true!",
+ "booleanFalse":"This boolean can't be false!",
+
+ "arrayEmptyDisabled":"This array isn't allowed to be empty!",
+ "arrayEmptyRequired":"This array is required to be empty!",
+ "arrayTooShort":"This array needs to have a length of at least {0}!",
+ "arrayTooLong":"This array needs to have a length of at most {0}!",
+ "arrayLengthInvalid":"This array needs to have a length of {0}!",
+ "arrayInvalidTypes":"This array can only contain the following types: {0}!",
+ "arrayDouble":"This array doesn't allow the same value twice!",
+
+ "discordInvalidId":"This is an invalid discord {0} id!",
+ "discordInvalidIdOptions":"This is an invalid discord {0} id! You can also use one of these: {1}!",
+ "discordInvalidToken":"This is an invalid discord token (syntactically)!",
+ "colorInvalid":"This is an invalid hex color!",
+ "emojiTooShort":"This string needs to have at least {0} emoji's!",
+ "emojiTooLong":"This string needs to have at most {0} emoji's!",
+ "emojiCustom":"This emoji can't be a custom discord emoji!",
+ "emojiInvalid":"This is an invalid emoji!",
+ "urlInvalid":"This url is invalid!",
+ "urlInvalidHttp":"This url can only use the https:// protocol!",
+ "urlInvalidProtocol":"This url can only use the http:// & https:// protocols!",
+ "urlInvalidHostname":"This url has a disallowed hostname!",
+ "urlInvalidExtension":"This url has an invalid extension! Choose between: {0}!",
+ "urlInvalidPath":"This url has an invalid path!",
+ "idNotUnique":"This id isn't unique, use another id instead!",
+ "idNonExistent":"The id {0} doesn't exist!",
+
+ "invalidType":"This property needs to be the type: {0}!",
+ "propertyMissing":"The property {0} is missing from this object!",
+ "propertyOptional":"The property {0} is optional in this object!",
+ "objectDisabled":"This object is disabled, enable it using {0}!",
+ "nullInvalid":"This property can't be null!",
+ "switchInvalidType":"This needs to be one of the following types: {0}!",
+ "objectSwitchInvalid":"This object needs to be one of the following types: {0}!",
+
+ "invalidLanguage":"This is an invalid language!",
+ "invalidButton":"This button needs to have at least an {0} or {1}!",
+ "unusedOption":"The option {0} isn't used anywhere!",
+ "unusedQuestion":"The question {0} isn't used anywhere!",
+ "dropdownOption":"A panel with dropdown enabled can only contain options of the 'ticket' type!"
+ }
+ },
+ "actions":{
+ "buttons":{
+ "create":"Visit Ticket",
+ "close":"Close Ticket",
+ "delete":"Delete Ticket",
+ "reopen":"Reopen Ticket",
+ "claim":"Claim Ticket",
+ "unclaim":"Unclaim Ticket",
+ "pin":"Pin Ticket",
+ "unpin":"Unpin Ticket",
+ "clear":"Delete Tickets",
+ "helpSwitchSlash":"View Slash Commands",
+ "helpSwitchText":"View Text Commands",
+ "helpPage":"Page {0}",
+ "withReason":"With Reason",
+ "withoutTranscript":"Without Transcript"
+ },
+ "titles":{
+ "created":"Ticket Created",
+ "close":"Ticket Closed",
+ "delete":"Ticket Deleted",
+ "reopen":"Ticket Reopened",
+ "claim":"Ticket Claimed",
+ "unclaim":"Ticket Unclaimed",
+ "pin":"Ticket Pinned",
+ "unpin":"Ticket Unpinned",
+ "rename":"Ticket Renamed",
+ "move":"Ticket Moved",
+ "add":"Ticket User Added",
+ "remove":"Ticket User Removed",
+
+ "help":"Available Commands",
+ "statsReset":"Reset Stats",
+ "blacklistAdd":"User Blacklisted",
+ "blacklistRemove":"User Released",
+ "blacklistGet":"Blacklisted User",
+ "blacklistView":"Current Blacklist",
+ "blacklistAddDm":"Added To Blacklist",
+ "blacklistRemoveDm":"Removed From Blacklist",
+ "clear":"Tickets Cleared",
+ "roles":"Roles Updated",
+
+ "autoclose":"Ticket Autoclosed",
+ "autocloseEnabled":"Autoclose Enabled",
+ "autocloseDisabled":"Autoclose Disabled",
+ "autodelete":"Ticket Autodeleted",
+ "autodeleteEnabled":"Autodelete Enabled",
+ "autodeleteDisabled":"Autodelete Disabled"
+ },
+ "descriptions":{
+ "create":"Your ticket has been created. Click the button below to access it!",
+ "close":"The ticket has been closed succesfully!",
+ "delete":"The ticket has been deleted succesfully!",
+ "reopen":"The ticket has been reopened succesfully!",
+ "claim":"The ticket has been claimed succesfully!",
+ "unclaim":"The ticket has been unclaimed succesfully!",
+ "pin":"The ticket has been pinned succesfully!",
+ "unpin":"The ticket has been unpinned succesfully!",
+ "rename":"The ticket has been renamed to {0} succesfully!",
+ "move":"The ticket has been moved to {0} succesfully!",
+ "add":"{0} has been added to the ticket succesfully!",
+ "remove":"{0} has been removed from the ticket succesfully!",
+
+ "helpExplanation":"`` => required parameter\n`[name]` => optional parameter",
+ "statsReset":"The bot stats have been reset successfully!",
+ "statsError":"Unable to view ticket stats!\n{0} is not a ticket!",
+ "blacklistAdd":"{0} has been blacklisted successfully!",
+ "blacklistRemove":"{0} has been released successfully!",
+ "blacklistGetSuccess":"{0} is currently blacklisted!",
+ "blacklistGetEmpty":"{0} is currently not blacklisted!",
+ "blacklistViewEmpty":"No-one has been blacklisted yet!",
+ "blacklistViewTip":"Use \"/blacklist add\" to blacklist a user!",
+ "clearVerify":"Are you sure you want to delete multiple tickets?\nThis action can't be undone!",
+ "clearReady":"{0} tickets have been deleted succesfully!",
+ "rolesEmpty":"No roles have been updated!",
+
+ "autocloseLeave":"This ticket has been autoclosed because the creator left the server!",
+ "autocloseTimeout":"This ticket has been autoclosed because it has been inactive for more than `{0}h`!",
+ "autodeleteLeave":"This ticket has been autodeleted because the creator left the server!",
+ "autodeleteTimeout":"This ticket has been autodeleted because it has been inactive for more than `{0} days`!",
+ "autocloseEnabled":"Autoclose has been enabled in this ticket!\nIt will be closed when it is inactive for more than `{0}h`!",
+ "autocloseDisabled":"Autoclose has been disabled in this ticket!\nIt won't be closed automatically anymore!",
+ "autodeleteEnabled":"Autodelete has been enabled in this ticket!\nIt will be deleted when it is inactive for more than `{0} days`!",
+ "autodeleteDisabled":"Autodelete has been disabled in this ticket!\nIt won't be deleted automatically anymore!",
+
+ "ticketMessageLimit":"You can only create {0} ticket(s) at the same time!",
+ "ticketMessageAutoclose":"This ticket will be autoclosed when inactive for {0}h!",
+ "ticketMessageAutodelete":"This ticket will be autodeleted when inactive for {0} days!",
+ "panelReady":"You can find the panel below!\nThis message can now be deleted!"
+ },
+ "modal":{
+ "closePlaceholder":"Why did you close this ticket?",
+ "deletePlaceholder":"Why did you delete this ticket?",
+ "reopenPlaceholder":"Why did you reopen this ticket?",
+ "claimPlaceholder":"Why did you claim this ticket?",
+ "unclaimPlaceholder":"Why did you unclaim this ticket?",
+ "pinPlaceholder":"Why did you pin this ticket?",
+ "unpinPlaceholder":"Why did you unpin this ticket?"
+ },
+ "logs":{
+ "createLog":"A new ticket got created by {0}!",
+ "closeLog":"This ticket has been closed by {0}!",
+ "closeDm":"Your ticket has been closed in our server!",
+ "deleteLog":"This ticket has been deleted by {0}!",
+ "deleteDm":"Your ticket has been deleted in our server!",
+ "reopenLog":"This ticket has been reopened by {0}!",
+ "reopenDm":"Your ticket has been reopened in our server!",
+ "claimLog":"This ticket has been claimed by {0}!",
+ "claimDm":"Your ticket has been claimed in our server!",
+ "unclaimLog":"This ticket has been unclaimed by {0}!",
+ "unclaimDm":"Your ticket has been unclaimed in our server!",
+ "pinLog":"This ticket has been pinned by {0}!",
+ "pinDm":"Your ticket has been pinned in our server!",
+ "unpinLog":"This ticket has been unpinned by {0}!",
+ "unpinDm":"Your ticket has been unpinned in our server!",
+ "renameLog":"This ticket has been renamed to {0} by {1}!",
+ "renameDm":"Your ticket has been renamed to {0} in our server!",
+ "moveLog":"This ticket has been moved to {0} by {1}!",
+ "moveDm":"Your ticket has been moved to {0} in our server!",
+ "addLog":"{0} has been added to this ticket by {1}!",
+ "addDm":"{0} has been added to your ticket in our server!",
+ "removeLog":"{0} has been removed from this ticket by {1}!",
+ "removeDm":"{0} has been removed from your ticket in our server!",
+
+ "blacklistAddLog":"{0} was blacklisted by {1}!",
+ "blacklistRemoveLog":"{0} was removed from the blacklist by {1}!",
+ "blacklistAddDm":"You have been blacklisted in our server!\nFrom now on, you are unable to create a ticket!",
+ "blacklistRemoveDm":"You have been removed from the blacklist in our server!\nNow you can create tickets again!",
+ "clearLog":"{0} tickets have been deleted by {1}!"
+ }
+ },
+ "transcripts":{
+ "success":{
+ "visit":"Visit Transcript",
+ "ready":"Transcript Created",
+ "textFileDescription":"This is the text transcript of a deleted ticket!",
+ "htmlProgress":"Please wait while this html transcript is getting processed...",
+
+ "createdChannel":"A new {0} transcript has been created in the server!",
+ "createdCreator":"A new {0} transcript has been created for one of your tickets!",
+ "createdParticipant":"A new {0} transcript has been created in one of the tickets you participated in!",
+ "createdActiveAdmin":"A new {0} transcript has been created in one of the tickets you participated as admin!",
+ "createdEveryAdmin":"A new {0} transcript has been created in one of the tickets you were admin in!",
+ "createdOther":"A new {0} transcript has been created!"
+ },
+ "errors":{
+ "retry":"Retry",
+ "continue":"Delete Without Transcript",
+ "backup":"Create Backup Transcript",
+ "error":"Something went wrong while trying to create the transcript.\nWhat would you like to do?\n\nThis ticket won't be deleted until you click one of these buttons."
+ }
+ },
+ "errors":{
+ "titles":{
+ "internalError":"Internal Error",
+ "optionMissing":"Command Option Missing",
+ "optionInvalid":"Command Option Invalid",
+ "unknownCommand":"Unknown Command",
+ "noPermissions":"No Permissions",
+ "unknownTicket":"Unknown Ticket",
+ "deprecatedTicket":"Deprecated Ticket",
+ "unknownOption":"Unknown Option",
+ "unknownPanel":"Unknown Panel",
+ "notInGuild":"Not In Server",
+ "channelRename":"Unable To Rename Channel",
+ "busy":"Ticket Is Busy"
+ },
+ "descriptions":{
+ "askForInfo":"Contact the owner of this bot for more info!",
+ "askForInfoResolve":"Contact the bot owner of this bot if this issue doesn't resolve after a few tries.",
+ "internalError":"Failed to respond to this {0} due to an internal error!",
+ "optionMissing":"A required parameter is missing in this command!",
+ "optionInvalid":"A parameter in this command is invalid!",
+ "optionInvalidChoose":"Choose between",
+ "unknownCommand":"Try visiting the help menu for more info!",
+ "noPermissions":"You are not allowed to use this {0}!",
+ "noPermissionsList":"Required Permissions: (one of them)",
+ "noPermissionsCooldown":"You are not allowed to use this {0} because you have a cooldown!",
+ "noPermissionsBlacklist":"You are not allowed to use this {0} because you have been blacklisted!",
+ "noPermissionsLimitGlobal":"You are not allowed to create a ticket because the server reached the max tickets limit!",
+ "noPermissionsLimitGlobalUser":"You are not allowed to create a ticket because you reached the max tickets limit!",
+ "noPermissionsLimitOption":"You are not allowed to create a ticket because the server reached the max tickets limit for this option!",
+ "noPermissionsLimitOptionUser":"You are not allowed to create a ticket because you reached the max tickets limit for this option!",
+ "unknownTicket":"Try this command again in a valid ticket!",
+ "deprecatedTicket":"The current channel is not a valid ticket! It might have been a ticket from an old Open Ticket version!",
+ "notInGuild":"This {0} doesn't work in DM! Please try it again in a server!",
+ "channelRename":"Due to discord ratelimits, it's currently impossible for the bot to rename the channel. The channel will automatically be renamed over 10 minutes if the bot isn't rebooted.",
+ "channelRenameSource":"The source of this error is: {0}",
+ "busy":"Unable to use this {0}!\nThe ticket is currently being processed by the bot.\n\nPlease try again in a few seconds!"
+ },
+ "optionInvalidReasons":{
+ "stringRegex":"Value doesn't match pattern!",
+ "stringMinLength":"Value needs to be at least {0} characters!",
+ "stringMaxLength":"Value needs to be at most {0} characters!",
+ "numberInvalid":"Invalid number!",
+ "numberMin":"Number needs to be at least {0}!",
+ "numberMax":"Number needs to be at most {0}!",
+ "numberDecimal":"Number is not allowed to be a decimal!",
+ "numberNegative":"Number is not allowed to be negative!",
+ "numberPositive":"Number is not allowed to be positive!",
+ "numberZero":"Number is not allowed to be zero!",
+ "channelNotFound":"Unable to find channel!",
+ "userNotFound":"Unable to find user!",
+ "roleNotFound":"Unable to find role!",
+ "memberNotFound":"Unable to find user!",
+ "mentionableNotFound":"Unable to find user or role!",
+ "channelType":"Invalid channel type!",
+ "notInGuild":"This option requires you to be in a server!"
+ },
+ "permissions":{
+ "developer":"You need to be the developer of the bot.",
+ "owner":"You need to be the server owner.",
+ "admin":"You need to be a server admin.",
+ "moderator":"You need to be a moderator.",
+ "support":"You need to be in the support team.",
+ "member":"You need to be a member.",
+ "discord-administrator":"You need to have the `ADMINISTRATOR` permission."
+ },
+ "actionInvalid":{
+ "close":"Ticket is already closed!",
+ "reopen":"Ticket is not closed yet!",
+ "claim":"Ticket is already claimed!",
+ "unclaim":"Ticket is not claimed yet!",
+ "pin":"Ticket is already pinned!",
+ "unpin":"Ticket is not pinned yet!",
+ "add":"This user is already able to access the ticket!",
+ "remove":"Unable to remove this user from the ticket!"
+ }
+ },
+ "params":{
+ "uppercase":{
+ "ticket":"Ticket",
+ "tickets":"Tickets",
+ "reason":"Reason",
+ "creator":"Creator",
+ "remaining":"Time Remaining",
+ "added":"Added",
+ "removed":"Removed",
+ "filter":"Filter",
+ "claimedBy":"Claimed By {0}",
+ "method":"Method",
+ "type":"Type",
+ "blacklisted":"Blacklisted",
+ "panel":"Panel",
+ "command":"Command",
+ "system":"System",
+ "true":"True",
+ "false":"False",
+ "syntax":"Syntax",
+ "originalName":"Original Name",
+ "newName":"New Name",
+ "until":"Until",
+ "validOptions":"Valid Options",
+ "validPanels":"Valid Panels",
+ "autoclose":"Autoclose",
+ "autodelete":"Autodelete",
+ "startupDate":"Startup Date",
+ "version":"Version",
+ "name":"Name",
+ "role":"Role",
+ "status":"Status",
+ "claimed":"Claimed",
+ "pinned":"Pinned",
+ "creationDate":"Creation Date"
+ },
+ "lowercase":{
+ "text":"text",
+ "html":"html",
+ "command":"command",
+ "modal":"modal",
+ "button":"button",
+ "dropdown":"dropdown",
+ "method":"method"
+ }
+ },
+ "commands":{
+ "reason":"Specify an optional reason that will be visible in logs.",
+ "help":"Get a list of all the available commands.",
+ "panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
+ "panelId":"The identifier of the panel that you want to spawn.",
+ "panelAutoUpdate":"Do you want this panel to automatically update when edited?",
+ "ticket":"Instantly create a ticket.",
+ "ticketId":"The identifier of the ticket that you want to create.",
+ "close":"Close a ticket.",
+ "delete":"Delete a ticket.",
+ "deleteNoTranscript":"Delete this ticket without creating a transcript.",
+ "reopen":"Reopen a ticket.",
+ "claim":"Claim a ticket.",
+ "claimUser":"Claim this ticket to someone else instead of yourself.",
+ "unclaim":"Unclaim a ticket.",
+ "pin":"Pin a ticket.",
+ "unpin":"Unpin a ticket.",
+ "move":"Move a ticket.",
+ "moveId":"The identifier of the option that you want to move to.",
+ "rename":"Rename a ticket.",
+ "renameName":"The new name for this ticket.",
+ "add":"Add a user to a ticket.",
+ "addUser":"The user to add.",
+ "remove":"Remove a user from a ticket.",
+ "removeUser":"The user to remove.",
+ "blacklist":"Manage the ticket blacklist.",
+ "blacklistView":"View a list of the current blacklist.",
+ "blacklistAdd":"Add a user to the blacklist.",
+ "blacklistRemove":"Remove a user from the blacklist.",
+ "blacklistGet":"Get the details from a blacklisted user.",
+ "blacklistGetUser":"The user to get details from.",
+ "stats":"View statistics from the bot, a member or a ticket.",
+ "statsReset":"Reset all the stats of the bot (and start counting from zero).",
+ "statsGlobal":"View the global stats.",
+ "statsUser":"View the stats from a user in the server.",
+ "statsUserUser":"The user to view.",
+ "statsTicket":"View the stats of a ticket in the server.",
+ "statsTicketTicket":"The ticket to view.",
+ "clear":"Delete multiple tickets at the same time.",
+ "clearFilter":"The filter for clearing tickets.",
+ "clearFilters":{
+ "all":"All",
+ "open":"Open",
+ "close":"Closed",
+ "claim":"Claimed",
+ "unclaim":"Unclaimed",
+ "pin":"Pinned",
+ "unpin":"Unpinned",
+ "autoclose":"Autoclosed"
+ },
+ "autoclose":"Manage autoclose in a ticket.",
+ "autocloseDisable":"Disable autoclose in this ticket.",
+ "autocloseEnable":"Enable autoclose in this ticket.",
+ "autocloseEnableTime":"The amount of hours this ticket needs to be inactive to close it.",
+ "autodelete":"Manage autodelete in a ticket.",
+ "autodeleteDisable":"Disable autodelete in this ticket.",
+ "autodeleteEnable":"Enable autodelete in this ticket.",
+ "autodeleteEnableTime":"The amount of days this ticket needs to be inactive to delete it."
+ },
+ "helpMenu":{
+ "help":"Get a list of all the available commands.",
+ "ticket":"Instantly create a ticket.",
+ "close":"Close a ticket, this disables writing in this channel.",
+ "delete":"Delete a ticket, this creates a transcript when enabled.",
+ "reopen":"Reopen a ticket, this enables writing in this channel again.",
+ "pin":"Pin a ticket. This will move the ticket to the top and will add a '📌' emoij to the name.",
+ "unpin":"Unpin a ticket. The ticket will stay on it's position but will lose the '📌' emoij.",
+ "move":"Move a ticket. This will change the type of this ticket.",
+ "rename":"Rename a ticket. This will change the channel name of this ticket.",
+ "claim":"Claim a ticket. With this, you can let your team know you are handling this ticket.",
+ "unclaim":"Unclaim a ticket. With this, you can let your team know that this ticket is free again.",
+ "add":"Add a user to a ticket. This will allow the user to read & write in this ticket.",
+ "remove":"Remove a user from a ticket. This will remove the ability to read & write for a user in this ticket.",
+ "panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
+ "blacklistView":"View a list of the current blacklist.",
+ "blacklistAdd":"Add a user to the blacklist.",
+ "blacklistRemove":"Remove a user from the blacklist.",
+ "blacklistGet":"Get the details from a blacklisted user.",
+ "statsGlobal":"View the global stats.",
+ "statsTicket":"View the stats of a ticket in the server.",
+ "statsUser":"View the stats from a user in the server.",
+ "statsReset":"Reset all the stats of the bot (and start counting from zero).",
+ "autocloseDisable":"Disable autoclose in this ticket.",
+ "autocloseEnable":"Enable autoclose in this ticket.",
+ "autodeleteDisable":"Disable autodelete in this ticket.",
+ "autodeleteEnable":"Enable autodelete in this ticket."
+ },
+ "stats":{
+ "scopes":{
+ "global":"Global Stats",
+ "system":"System Stats",
+ "user":"User Stats",
+ "ticket":"Ticket Stats",
+ "participants":"Participants"
+ },
+ "properties":{
+ "ticketsCreated":"Tickets Created",
+ "ticketsClosed":"Tickets Closed",
+ "ticketsDeleted":"Tickets Deleted",
+ "ticketsReopened":"Tickets Reopened",
+ "ticketsAutoclosed":"Tickets Autoclosed",
+ "ticketsClaimed":"Tickets Claimed",
+ "ticketsPinned":"Tickets Pinned",
+ "ticketsMoved":"Tickets Moved",
+ "usersBlacklisted":"Users Blacklisted",
+ "transcriptsCreated":"Transcripts Created"
+ }
+ }
+}
\ No newline at end of file
diff --git a/languages/czech.json b/languages/czech.json
new file mode 100644
index 0000000..c19fca7
--- /dev/null
+++ b/languages/czech.json
@@ -0,0 +1,477 @@
+{
+ "_TRANSLATION":{
+ "otversion":"v4.0.0",
+ "translator":"spyeye_",
+ "lastedited":"21/08/2024",
+ "language":"Czech"
+ },
+ "checker":{
+ "system":{
+ "typeError":"[ERROR]",
+ "headerOpenTicket":"OPEN TICKET",
+ "typeWarning":"[WARNING]",
+ "typeInfo":"[INFO]",
+ "headerConfigChecker":"CONFIG CHECKER",
+ "headerDescription":"kontrola chyb v konfiguračních souborech!",
+ "footerError":"Bot se nespustí, dokud všechny {0} nebudou opraveny!",
+ "footerWarning":"Doporučejeme opravit všechny {0} před spuštěním!",
+ "footerSupport":"PODPORA: {0} - DOKUMENTACE: {1}",
+ "compactInformation":"Použij {0} pro více informací!",
+ "dataPath":"path",
+ "dataDocs":"docs",
+ "dataMessages":"message"
+ },
+ "messages":{
+ "stringTooShort":"Tento string nesmí být kratší než {0} znaků!",
+ "stringTooLong":"Tento string nesmí být delší než {0} znaků!",
+ "stringLengthInvalid":"Tento string musí mít délku {0} znaků!",
+ "stringStartsWith":"Tento string musí začínat {0}!",
+ "stringEndsWith":"Tento string musí končit {0}!",
+ "stringContains":"Tento string musí obsahovat {0}!",
+ "stringChoices":"Tento string může být pouze jednou z následujících možností: {0}!",
+ "stringRegex":"Tento string je neplatný!",
+
+ "numberTooShort":"Toto číslo nesmí být kratší než {0} znaků!",
+ "numberTooLong":"Toto číslo nesmí být delší než {0} znaků.!",
+ "numberLengthInvalid":"Toto číslo musí mít délku {0} znaků.!",
+ "numberTooSmall":"Toto číslo musí být alespoň {0}.!",
+ "numberTooLarge":"Toto číslo musí být nejvýše {0}!",
+ "numberNotEqual":"Toto číslo musí být {0}!",
+ "numberStep":"Toto číslo musí být násobkem {0}.!",
+ "numberStepOffset":"Toto číslo musí být násobkem {0} žačínající {1}.!",
+ "numberStartsWith":"Toto číslo musí začínat {0}!",
+ "numberEndsWith":"Toto číslo musí končit {0}!",
+ "numberContains":"Toto číslo musí obsahovat {0}!",
+ "numberChoices":"Toto číslo může být pouze jedno z následujících hodnot: {0}!",
+ "numberFloat":"Toto číslo nemůže být desetinné!",
+ "numberNegative":"Toto číslo nemůže být záporné!",
+ "numberPositive":"Toto číslo nemůže být kladné!",
+ "numberZero":"Toto číslo nemůže být nula!",
+
+ "booleanTrue":"Tento boolean nemůže být true!",
+ "booleanFalse":"Tento boolean nemůže být false!",
+
+ "arrayEmptyDisabled":"Toto pole nesmí být prázdné.!",
+ "arrayEmptyRequired":"Toto pole musí být prázdné!",
+ "arrayTooShort":"Toto pole musí mít délku alespoň {0}!",
+ "arrayTooLong":"Toto pole musí mít délku maximálně {0}!",
+ "arrayLengthInvalid":"Toto pole musí mít délku {0}!",
+ "arrayInvalidTypes":"Toto pole může obsahovat pouze následující typy: {0}!",
+ "arrayDouble":"Toto pole neumožňuje zadat stejnou hodnotu dvakrát.!",
+
+ "discordInvalidId":"Toto je neplatné discord {0} id!",
+ "discordInvalidIdOptions":"Toto je neplatné Discord ID {0}! Můžete také použít jeden z těchto: {1}!",
+ "discordInvalidToken":"Toto je neplatný discord token (syntakticky)!",
+ "colorInvalid":"Toto je neplatná hex barva!",
+ "emojiTooShort":"Tento string musí obsahovat alespoň {0} emotikonů.!",
+ "emojiTooLong":"Tento string musí obsahovat nejvýše {0} emotikonů.!",
+ "emojiCustom":"Tento emotikon nemůže být custom emotikon!",
+ "emojiInvalid":"Toto je neplatný emotikon!",
+ "urlInvalid":"Tato url adresa je neplatná!",
+ "urlInvalidHttp":"Tato url může používat pouze protokol https://!",
+ "urlInvalidProtocol":"Tato url může používat pouze protokoly http:// a https://!",
+ "urlInvalidHostname":"Tato url má zakázané hostitelské jméno!",
+ "urlInvalidExtension":"Tato url má neplatnou příponu! Vyberte si mezi: {0}!",
+ "urlInvalidPath":"Tato url má neplatnou cestu!",
+ "idNotUnique":"Toto id není jedinečné, místo něj použijte jiné id!",
+ "idNonExistent":"Id {0} neexistuje!",
+
+ "invalidType":"Toto nastavení musí být typu: {0}!",
+ "propertyMissing":"U tohoto objektu chybí vlastnost {0}!",
+ "propertyOptional":"Vlastnost {0} je v tomto objektu nepovinná!",
+ "objectDisabled":"Tento objekt je zakázán, povolte jej pomocí {0}!",
+ "nullInvalid":"Tato vlastnost nemůže být nulová!",
+ "switchInvalidType":"Musí se jednat o jeden z následujících typů: {0}!",
+ "objectSwitchInvalid":"Tento objekt musí být jednoho z následujících typů: {0}!",
+
+ "invalidLanguage":"Jedná se o neplatný jazyk!",
+ "invalidButton":"Toto tlačítko musí mít alespoň {0} nebo {1}!",
+ "unusedOption":"Možnost {0} se nikde nepoužívá!",
+ "unusedQuestion":"Otázka {0} není nikde použita!",
+ "dropdownOption":"Panel s povoleným rozevíracím seznamem může obsahovat pouze možnosti typu „ticketu“!"
+ }
+ },
+ "actions":{
+ "buttons":{
+ "create":"Zobrazit ticket",
+ "close":"Uzavřít ticket",
+ "delete":"Vymazat ticket",
+ "reopen":"Znovu otevřít ticket",
+ "claim":"Převzít ticket",
+ "unclaim":"Zrušit převzetí ticketu",
+ "pin":"Připnout ticket",
+ "unpin":"Odepnout ticket",
+ "clear":"Vymazat tickety",
+ "helpSwitchSlash":"Zobrazit slash příkazy",
+ "helpSwitchText":"Zobrazit textové příkazy",
+ "helpPage":"Strana {0}",
+ "withReason":"S důvodem",
+ "withoutTranscript":"Bez důvodu"
+ },
+ "titles":{
+ "created":"Ticket vytvořen",
+ "close":"Ticket uzavřen",
+ "delete":"Ticket vymazán",
+ "reopen":"Ticket znovu otevřen",
+ "claim":"Ticket převzat",
+ "unclaim":"Ticket již není převezmut",
+ "pin":"Ticket připnut",
+ "unpin":"Ticket odepnut",
+ "rename":"Ticket přejmenován",
+ "move":"Ticket přesunut",
+ "add":"Uživatel přidán",
+ "remove":"Uživatel odebrán",
+
+ "help":"Dostupné příkazy:",
+ "statsReset":"Resetovat statistiky",
+ "blacklistAdd":"Uživatel blacklistován",
+ "blacklistRemove":"Uživatel odebrán z blacklistu",
+ "blacklistGet":"Uživatel na blacklistu",
+ "blacklistView":"Aktuální blacklist",
+ "blacklistAddDm":"Přidán na blacklistu",
+ "blacklistRemoveDm":"Odebrán z blacklistu",
+ "clear":"Tickety vyčištěny",
+ "roles":"Role aktualizovány",
+
+ "autoclose":"Ticket automaticky uzavřen",
+ "autocloseEnabled":"Automatické uzavření povoleno",
+ "autocloseDisabled":"Automatické uzavření zakázáno",
+ "autodelete":"Ticket automaticky vymazán",
+ "autodeleteEnabled":"Automatické mazání povoleno",
+ "autodeleteDisabled":"Automatické mazání zakázáno"
+ },
+ "descriptions":{
+ "create":"Tvůj ticket byl vytvořen. Klikni na tlačítko pod zprávou pro zobrazení!",
+ "close":"Ticket byl úspěšně uzavřen!",
+ "delete":"Ticket byl úspěšně vymazán!",
+ "reopen":"Ticket byl úspěšně znovu otevřen!",
+ "claim":"Ticket byl úspěšně převzat!",
+ "unclaim":"Ticket již není převezmut!",
+ "pin":"Ticket byl úspěšně připnut!",
+ "unpin":"Ticket byl úspěšně odepnut!",
+ "rename":"Ticket byl úspěšně přejmenován na {0}!",
+ "move":"Ticket byl úspěšně přesunut do {0}!",
+ "add":"{0} byl úspěšně přidán do ticketu!",
+ "remove":"{0} byl úspěšně odstraněn z ticketu!",
+
+ "helpExplanation":"`` => povinný parametr\n`[name]` => nepovinný parametr",
+ "statsReset":"Statistiky bota byly úspěšně resetovány!",
+ "statsError":"Nelze zobrazit statistiky ticketu!\n{0} není ticket!",
+ "blacklistAdd":"{0} byl přídán na blacklist!",
+ "blacklistRemove":"{0} byl odebrán z blacklistu!",
+ "blacklistGetSuccess":"{0} je nyní na blacklistu!",
+ "blacklistGetEmpty":"{0} nyní není na blacklistu!",
+ "blacklistViewEmpty":"Na blacklistu ještě nikdo není",
+ "blacklistViewTip":"Použij \"/blacklist add\" pro přidání uživatele na blacklist!",
+ "clearVerify":"Opravdu chcete smazat více ticketů?\nTuto akci nelze vrátit zpět!",
+ "clearReady":"{0} ticketů bylo úspěšně smazány!",
+ "rolesEmpty":"Žádné role nebyly aktualizovány!",
+
+ "autocloseLeave":"Tento ticket byl automaticky uzavřen, protože jeho autor opustil server.!",
+ "autocloseTimeout":"Tento ticket byl automaticky uzavřen, protože byl neaktivní déle než `{0}h`!",
+ "autodeleteLeave":"Tento ticket byl automaticky smazán, protože jeho autor opustil server!",
+ "autodeleteTimeout":"Tento ticket byl automaticky smazán, protože je neaktivní déle než `{0} dní`!",
+ "autocloseEnabled":"U tohoto ticketu bylo povoleno automatické uzavření!\nTicket bude uzavřen, pokud bude neaktivní déle než `{0}h`!",
+ "autocloseDisabled":"U tohoto ticketu bylo vypnuto automatické zavírání!\nUž se nebude automaticky zavírat!",
+ "autodeleteEnabled":"U tohoto ticketu bylo povoleno automatické mazání!\nBude smazán, pokud je neaktivní déle než `{0} dní`!",
+ "autodeleteDisabled":"Automatické mazání bylo v tomto zakázáno!\nUž se nebude automaticky mazat!",
+
+ "ticketMessageLimit":"Současně lze vytvořit pouze {0} ticketu!",
+ "ticketMessageAutoclose":"Tento ticket se automaticky uzavře, pokud je neaktivní po dobu {0}h!",
+ "ticketMessageAutodelete":"Tento ticket bude automaticky smazán, pokud bude neaktivní po dobu {0} dnů!",
+ "panelReady":"Panel najdete níže!\nTuto zprávu lze nyní smazat!"
+ },
+ "modal":{
+ "closePlaceholder":"Proč jste tento ticket uzavřel?",
+ "deletePlaceholder":"Proč jste tento ticket smazali?",
+ "reopenPlaceholder":"Proč jste tento ticket znovu otevřeli?",
+ "claimPlaceholder":"Proč jste si vyžádal tento ticket?",
+ "unclaimPlaceholder":"Proč jste zrušili převzetí tohoto ticketu?",
+ "pinPlaceholder":"Proč jste připnuli tento ticket?",
+ "unpinPlaceholder":"Proč jste odepnuli tento ticket?"
+ },
+ "logs":{
+ "createLog":"Nový ticket byl vytvořen uživatelem {0}!",
+ "closeLog":"Tento ticket byl uzavřen uživatelem {0}!",
+ "closeDm":"Tvůj ticket byl uzavřen na našem serveru!",
+ "deleteLog":"Tento ticket byl smazán uživatelem {0}!",
+ "deleteDm":"Tvůj ticket byl smazán na našem serveru!",
+ "reopenLog":"Tento ticket byl znovu otevřen uživatelem {0}!",
+ "reopenDm":"Tvůj ticket byl znovu otevřen na našem serveru!",
+ "claimLog":"Tento ticket byl přidělen uživatelem {0}!",
+ "claimDm":"Tvůj ticket byl přidělen na našem serveru!",
+ "unclaimLog":"Tento ticket byl odhlášen uživatelem {0}!",
+ "unclaimDm":"Tvůj ticket byl odhlášen na našem serveru!",
+ "pinLog":"Tento ticket byl připnut uživatelem {0}!",
+ "pinDm":"Tvůj ticket byl připnut na našem serveru!",
+ "unpinLog":"Tento ticket byl odepnut uživatelem {0}!",
+ "unpinDm":"Tvůj ticket byl odepnut na našem serveru!",
+ "renameLog":"Tento ticket byl přejmenován na {0} uživatelem {1}!",
+ "renameDm":"Tvůj ticket byl přejmenován na {0} na našem serveru!",
+ "moveLog":"Tento ticket byl přesunut do {0} uživatelem {1}!",
+ "moveDm":"Tvůj ticket byl přesunut do {0} na našem serveru!",
+ "addLog":"{0} byl přidán do tohoto ticketu uživatelem {1}!",
+ "addDm":"{0} byl přidán do tvého ticketu na našem serveru!",
+ "removeLog":"{0} byl odstraněn z tohoto ticketu uživatelem {1}!",
+ "removeDm":"{0} byl odstraněn z tvého ticketu na našem serveru!",
+
+ "blacklistAddLog":"{0} byl přidán na blacklist uživatelem {1}!",
+ "blacklistRemoveLog":"{0} byl odstraněn z blacklistu uživatelem {1}!",
+ "blacklistAddDm":"Byl jsi přidán na blacklist na našem serveru!\nOd teď nemůžeš vytvářet tickety!",
+ "blacklistRemoveDm":"Byl jsi odstraněn z blacklistu na našem serveru!\nNyní můžeš opět vytvářet tickety!",
+ "clearLog":"{0} ticketů bylo smazáno uživatelem {1}!"
+ }
+ },
+ "transcripts":{
+ "success":{
+ "visit":"Zobrazit přepis",
+ "ready":"Přepis vytvořen",
+ "textFileDescription":"Toto je textový přepis smazaného ticketu!",
+ "htmlProgress":"Prosím, počkejte, zatímco se zpracovává HTML přepis...",
+
+ "createdChannel":"Na serveru byl vytvořen nový přepis {0}!",
+ "createdCreator":"Byl vytvořen nový přepis {0} pro jeden z tvých ticketů!",
+ "createdParticipant":"Byl vytvořen nový přepis {0} v jednom z ticketů, kterých ses účastnil!",
+ "createdActiveAdmin":"Byl vytvořen nový přepis {0} v jednom z ticketů, kterých ses účastnil jako admin!",
+ "createdEveryAdmin":"Byl vytvořen nový přepis {0} v jednom z ticketů, kde jsi byl adminem!",
+ "createdOther":"Byl vytvořen nový přepis {0}!"
+ },
+ "errors":{
+ "retry":"Zkusit Znovu",
+ "continue":"Vymazat bez přepisu",
+ "backup":"Vytvořit záložní přepis",
+ "error":"Při pokusu o vytvoření přepisu se něco pokazilo.\nCo chcete udělat?\n\nTento ticket nebude smazán, dokud nekliknete na jedno z těchto tlačítek."
+ }
+ },
+ "errors":{
+ "titles":{
+ "internalError":"Interní chyba",
+ "optionMissing":"Chybějící možnost příkazu",
+ "optionInvalid":"Neplatná možnost příkazu",
+ "unknownCommand":"Neznámý příkaz",
+ "noPermissions":"Nemáš oprávnění",
+ "unknownTicket":"Neznámý ticket",
+ "deprecatedTicket":"Zastaralý ticket",
+ "unknownOption":"Neznámá možnost",
+ "unknownPanel":"Neznámý panel",
+ "notInGuild":"Nejsi na serveru",
+ "channelRename":"Nepodařilo se přejmenovat kanál",
+ "busy":"Ticket je zaneprázdněn"
+ },
+ "descriptions":{
+ "askForInfo":"Pro více informací kontaktuj vlastníka tohoto bota!",
+ "askForInfoResolve":"Kontaktuj vlastníka tohoto bota, pokud se tento problém nevyřeší po několika pokusech.",
+ "internalError":"Nepodařilo se odpovědět na tento {0} kvůli interní chybě!",
+ "optionMissing":"V tomto příkazu chybí požadovaný parametr!",
+ "optionInvalid":"V tomto příkazu je neplatný parametr!",
+ "optionInvalidChoose":"Vyber z",
+ "unknownCommand":"Zkus navštívit nabídku nápovědy pro více informací!",
+ "noPermissions":"Nemáš oprávnění k použití tohoto {0}!",
+ "noPermissionsList":"Požadovaná oprávnění: (jedno z nich)",
+ "noPermissionsCooldown":"Nemáš oprávnění k použití tohoto {0}, protože máš cooldown!",
+ "noPermissionsBlacklist":"Nemáš oprávnění k použití tohoto {0}, protože jsi byl přidán na blacklist!",
+ "noPermissionsLimitGlobal":"Nemáš oprávnění vytvořit ticket, protože server dosáhl maximálního limitu ticketů!",
+ "noPermissionsLimitGlobalUser":"Nemáš oprávnění vytvořit ticket, protože jsi dosáhl maximálního limitu ticketů!",
+ "noPermissionsLimitOption":"Nemáš oprávnění vytvořit ticket, protože server dosáhl maximálního limitu ticketů pro tuto možnost!",
+ "noPermissionsLimitOptionUser":"Nemáš oprávnění vytvořit ticket, protože jsi dosáhl maximálního limitu ticketů pro tuto možnost!",
+ "unknownTicket":"Zkus tento příkaz znovu v platném ticketu!",
+ "deprecatedTicket":"Aktuální kanál není platný ticket! Může se jednat o ticket ze starší verze Open Ticketu!",
+ "notInGuild":"Tento {0} nefunguje v DM! Zkus to znovu na serveru!",
+ "channelRename":"Kvůli ratelimitům Discordu není momentálně možné, aby bot přejmenoval kanál. Kanál bude automaticky přejmenován do 10 minut, pokud nedojde k restartu bota.",
+ "channelRenameSource":"Zdroj této chyby je: {0}",
+ "busy":"Nelze použít tento {0}!\nTicket je momentálně zpracováván botem.\n\nZkus to prosím znovu za několik sekund!"
+ },
+ "optionInvalidReasons":{
+ "stringRegex":"Hodnota neodpovídá vzoru!",
+ "stringMinLength":"Hodnota musí mít alespoň {0} znaků!",
+ "stringMaxLength":"Hodnota může mít maximálně {0} znaků!",
+ "numberInvalid":"Neplatné číslo!",
+ "numberMin":"Číslo musí být alespoň {0}!",
+ "numberMax":"Číslo může být maximálně {0}!",
+ "numberDecimal":"Číslo nesmí být desetinné!",
+ "numberNegative":"Číslo nesmí být záporné!",
+ "numberPositive":"Číslo nesmí být kladné!",
+ "numberZero":"Číslo nesmí být nula!",
+ "channelNotFound":"Nelze najít kanál!",
+ "userNotFound":"Nelze najít uživatele!",
+ "roleNotFound":"Nelze najít roli!",
+ "memberNotFound":"Nelze najít uživatele!",
+ "mentionableNotFound":"Nelze najít uživatele nebo roli!",
+ "channelType":"Neplatný typ kanálu!",
+ "notInGuild":"Tato možnost vyžaduje, abys byl na serveru!"
+ },
+ "permissions":{
+ "developer":"Musíš být vývojářem tohoto bota.",
+ "owner":"Musíš být vlastníkem serveru.",
+ "admin":"Musíš být adminem serveru.",
+ "moderator":"Musíš být moderátorem.",
+ "support":"Musíš být členem týmu podpory.",
+ "member":"Musíš být členem.",
+ "discord-administrator":"Musíš mít oprávnění `ADMINISTRATOR`."
+ },
+ "actionInvalid":{
+ "close":"Ticket je již uzavřený!",
+ "reopen":"Ticket ještě není uzavřený!",
+ "claim":"Ticket je již přidělený!",
+ "unclaim":"Ticket ještě není přidělený!",
+ "pin":"Ticket je již připnutý!",
+ "unpin":"Ticket ještě není připnutý!",
+ "add":"Tento uživatel už má k ticketu přístup!",
+ "remove":"Tohoto uživatele nelze z ticketu odstranit!"
+ }
+ },
+ "params":{
+ "uppercase":{
+ "ticket":"Ticket",
+ "tickets":"Tickety",
+ "reason":"Důvod",
+ "creator":"Tvůrce",
+ "remaining":"Zbývající čas",
+ "added":"Přidáno",
+ "removed":"Odstraněno",
+ "filter":"Filtr",
+ "claimedBy":"Přiděleno uživatelem {0}",
+ "method":"Metoda",
+ "type":"Typ",
+ "blacklisted":"Na blacklistu",
+ "panel":"Panel",
+ "command":"Příkaz",
+ "system":"Systém",
+ "true":"true",
+ "false":"false",
+ "syntax":"Syntaxe",
+ "originalName":"Původní jméno",
+ "newName":"Nové jméno",
+ "until":"Do",
+ "validOptions":"Platné možnosti",
+ "validPanels":"Platné panely",
+ "autoclose":"Automatické uzavření",
+ "autodelete":"Automatické smazání",
+ "startupDate":"Datum spuštění",
+ "version":"Verze",
+ "name":"Jméno",
+ "role":"Role",
+ "status":"Stav",
+ "claimed":"Přiděleno",
+ "pinned":"Připnuto",
+ "creationDate":"Datum vytvoření"
+ },
+ "lowercase":{
+ "text":"text",
+ "html":"html",
+ "command":"příkaz",
+ "modal":"modal",
+ "button":"tlačítko",
+ "dropdown":"roletka",
+ "method":"metoda"
+ }
+ },
+ "commands":{
+ "reason":"Zadej nepovinný důvod, který bude viditelný v logu.",
+ "help":"Získej seznam všech dostupných příkazů.",
+ "panel":"Vytvoř zprávu s roletkou nebo tlačítky (pro vytvoření ticketu).",
+ "panelId":"Identifikátor panelu, který chceš vytvořit.",
+ "panelAutoUpdate":"Chceš, aby se tento panel automaticky aktualizoval při úpravách?",
+ "ticket":"Okamžitě vytvoř ticket.",
+ "ticketId":"Identifikátor ticketu, který chceš vytvořit.",
+ "close":"Uzavři ticket.",
+ "delete":"Smaž ticket.",
+ "deleteNoTranscript":"Smaž tento ticket bez vytvoření přepisu.",
+ "reopen":"Znovu otevři ticket.",
+ "claim":"Přiděl ticket.",
+ "claimUser":"Přiděl tento ticket někomu jinému místo sebe.",
+ "unclaim":"Odeber přidělení ticketu.",
+ "pin":"Připni ticket.",
+ "unpin":"Odepni ticket.",
+ "move":"Přesuň ticket.",
+ "moveId":"Identifikátor možnost, na který chceš přesunout.",
+ "rename":"Přejmenuj ticket.",
+ "renameName":"Nový název pro tento ticket.",
+ "add":"Přidej uživatele k ticketu.",
+ "addUser":"Uživatel k přidání.",
+ "remove":"Odstraň uživatele z ticketu.",
+ "removeUser":"Uživatel k odstranění.",
+ "blacklist":"Spravuj blacklist ticketů.",
+ "blacklistView":"Zobraz seznam aktuálního blacklistu.",
+ "blacklistAdd":"Přidej uživatele na blacklist.",
+ "blacklistRemove":"Odstraň uživatele z blacklistu.",
+ "blacklistGet":"Získej detaily o uživateli na blacklistu.",
+ "blacklistGetUser":"Uživatel, o kterém chceš získat detaily.",
+ "stats":"Zobraz statistiky bota, člena nebo ticketu.",
+ "statsReset":"Resetuj všechny statistiky bota (a začni počítat od nuly).",
+ "statsGlobal":"Zobraz globální statistiky.",
+ "statsUser":"Zobraz statistiky uživatele na serveru.",
+ "statsUserUser":"Uživatel, jehož statistiky chceš zobrazit.",
+ "statsTicket":"Zobraz statistiky ticketu na serveru.",
+ "statsTicketTicket":"Ticket, jehož statistiky chceš zobrazit.",
+ "clear":"Smaž více ticketů najednou. Lze zadat volitelný filtr.",
+ "clearFilter":"Filtr pro vymazání tiketů.",
+ "clearFilters":{
+ "all":"Vše",
+ "open":"Otevřené",
+ "close":"Uzavřené",
+ "claim":"Přidělené",
+ "unclaim":"Nepřidělené",
+ "pin":"Připnuté",
+ "unpin":"Nepřipnuté",
+ "autoclose":"Automaticky uzavřené"
+ },
+ "autoclose":"Spravuj automatické uzavření ticketu.",
+ "autocloseDisable":"Deaktivuj automatické uzavření v tomto ticketu.",
+ "autocloseEnable":"Aktivuj automatické uzavření v tomto ticketu.",
+ "autocloseEnableTime":"Počet hodin neaktivity, po kterých se ticket uzavře.",
+ "autodelete":"Spravuj automatické smazání ticketu.",
+ "autodeleteDisable":"Deaktivuj automatické smazání v tomto ticketu.",
+ "autodeleteEnable":"Aktivuj automatické smazání v tomto ticketu.",
+ "autodeleteEnableTime":"Počet dnů neaktivity, po kterých se ticket smaže."
+ },
+ "helpMenu":{
+ "help":"Získej seznam všech dostupných příkazů.",
+ "ticket":"Okamžitě vytvoř ticket.",
+ "close":"Uzavři ticket, čímž se zakáže psaní v tomto kanálu.",
+ "delete":"Smaž ticket, čímž se vytvoří přepis, pokud je to povoleno.",
+ "reopen":"Znovu otevři ticket, což opět umožní psaní v tomto kanálu.",
+ "pin":"Připni ticket. Tento ticket se přesune na začátek a bude mít ve jménu emoji '📌'.",
+ "unpin":"Odepni ticket. Ticket zůstane na svém místě, ale ztratí emoji '📌'.",
+ "move":"Přesuň ticket. Tím se změní typ tohoto ticketu.",
+ "rename":"Přejmenuj ticket. Tím se změní název kanálu tohoto ticketu.",
+ "claim":"Přiděl ticket. Tím dáš svému týmu najevo, že tento ticket řešíš.",
+ "unclaim":"Odeber přidělení ticketu. Tím dáš svému týmu najevo, že je tento ticket znovu volný.",
+ "add":"Přidej uživatele k ticketu. Tímto uživateli umožníš číst a psát v tomto ticketu.",
+ "remove":"Odstraň uživatele z ticketu. Tímto uživateli odebereš možnost číst a psát v tomto ticketu.",
+ "panel":"Vytvoř zprávu s roletkou nebo tlačítky (pro vytvoření ticketu).",
+ "blacklistView":"Zobraz seznam aktuálního blacklistu.",
+ "blacklistAdd":"Přidej uživatele na blacklist.",
+ "blacklistRemove":"Odstraň uživatele z blacklistu.",
+ "blacklistGet":"Získej detaily o uživateli na blacklistu.",
+ "statsGlobal":"Zobraz globální statistiky.",
+ "statsTicket":"Zobraz statistiky ticketu na serveru.",
+ "statsUser":"Zobraz statistiky uživatele na serveru.",
+ "statsReset":"Resetuj všechny statistiky bota (a začni počítat od nuly).",
+ "autocloseDisable":"Deaktivuj automatické uzavření v tomto ticketu.",
+ "autocloseEnable":"Aktivuj automatické uzavření v tomto ticketu.",
+ "autodeleteDisable":"Deaktivuj automatické smazání v tomto ticketu.",
+ "autodeleteEnable":"Aktivuj automatické smazání v tomto ticketu."
+ },
+ "stats":{
+ "scopes":{
+ "global":"Globální statistiky",
+ "system":"Statistiky systému",
+ "user":"Statistiky uživatele",
+ "ticket":"Statistiky ticketu",
+ "participants":"Účastníci"
+ },
+ "properties":{
+ "ticketsCreated":"Vytvořené tickety",
+ "ticketsClosed":"Uzavřené tickety",
+ "ticketsDeleted":"Smazané tickety",
+ "ticketsReopened":"Znovu otevřené tickety",
+ "ticketsAutoclosed":"Automaticky uzavřené tickety",
+ "ticketsClaimed":"Přidělené tickety",
+ "ticketsPinned":"Připnuté tickety",
+ "ticketsMoved":"Přesunuté tickety",
+ "usersBlacklisted":"Uživatelé na blacklistu",
+ "transcriptsCreated":"Vytvořené přepisy"
+ }
+ }
+}
\ No newline at end of file
diff --git a/languages/dutch.json b/languages/dutch.json
new file mode 100644
index 0000000..fa3b14d
--- /dev/null
+++ b/languages/dutch.json
@@ -0,0 +1,477 @@
+{
+ "_TRANSLATION":{
+ "otversion":"v4.0.0",
+ "translator":"DJj123dj",
+ "lastedited":"21/08/2024",
+ "language":"Dutch"
+ },
+ "checker":{
+ "system":{
+ "typeError":"[ERROR]",
+ "headerOpenTicket":"OPEN TICKET",
+ "typeWarning":"[WAARSCHUWING]",
+ "typeInfo":"[INFO]",
+ "headerConfigChecker":"CONFIG CHECKER",
+ "headerDescription":"check voor errors in je config bestanden!",
+ "footerError":"de bot start niet tot alle {0}'s opgelost zijn!",
+ "footerWarning":"het is aangeraden om alle {0}'en op te lossen voor het starten!",
+ "footerSupport":"SUPPORT: {0} - DOCS: {1}",
+ "compactInformation":"gebruik {0} voor meer informatie!",
+ "dataPath":"pad",
+ "dataDocs":"docs",
+ "dataMessages":"bericht"
+ },
+ "messages":{
+ "stringTooShort":"Deze tekst kan niet korter dan {0} karakters zijn!",
+ "stringTooLong":"Deze tekst kan niet langer dan {0} karakters zijn!",
+ "stringLengthInvalid":"Deze tekst moet {0} karakters lang zijn!",
+ "stringStartsWith":"Deze tekst moet starten met {0}!",
+ "stringEndsWith":"Deze tekst moet eindigen met {0}!",
+ "stringContains":"Deze tekst moet {0} bevatten!",
+ "stringChoices":"Deze tekst kan alleen de volgende waardes bevatten: {0}!",
+ "stringRegex":"Deze tekst is ongeldig!",
+
+ "numberTooShort":"Dit nummer kan niet korter dan {0} karakters zijn!",
+ "numberTooLong":"Dit nummer kan niet langer dan {0} karakters zijn!",
+ "numberLengthInvalid":"Dit nummer moet {0} karakters lang zijn!",
+ "numberTooSmall":"Dit nummer moet minimum {0} zijn!",
+ "numberTooLarge":"Dit nummer kan maximum {0} zijn!",
+ "numberNotEqual":"Dit nummer moet gelijk zijn aan {0}!",
+ "numberStep":"Dit nummer moet een meervoud zijn van {0}!",
+ "numberStepOffset":"Dit nummer moet een meervoud zijn van {0} startend bij {1}!",
+ "numberStartsWith":"Dit nummer moet starten met {0}!",
+ "numberEndsWith":"Dit nummer moet eindigen met {0}!",
+ "numberContains":"Dit nummer moet {0} bevatten!",
+ "numberChoices":"Dit nummer kan alleen een van de volgende waardes bevatten: {0}!",
+ "numberFloat":"Dit nummer kan geen kommagetal zijn!",
+ "numberNegative":"Dit nummer kan niet negatief zijn!",
+ "numberPositive":"Dit nummer kan niet positief zijn!",
+ "numberZero":"Dit nummer kan niet nul zijn!",
+
+ "booleanTrue":"Deze boolean kan niet true zijn!",
+ "booleanFalse":"Deze boolean kan niet false zijn!",
+
+ "arrayEmptyDisabled":"Deze array mag niet leeg zijn!",
+ "arrayEmptyRequired":"Deze array moet leeg zijn!",
+ "arrayTooShort":"Deze array moet een minimum lengte hebben van {0}!",
+ "arrayTooLong":"Deze array mag niet langer zijn dan {0}!",
+ "arrayLengthInvalid":"Deze array moet een lengte hebben van {0}!",
+ "arrayInvalidTypes":"Deze array kan alleen de volgende waardes bevatten: {0}!",
+ "arrayDouble":"Deze array staat dubbele waardes niet toe!",
+
+ "discordInvalidId":"Dit is een ongeldig discord {0} id!",
+ "discordInvalidIdOptions":"Dit is an ongeldig discord {0} id! Je kan ook een van deze gebruiken: {1}!",
+ "discordInvalidToken":"Dit is een ongeldig discord token (syntactisch)!",
+ "colorInvalid":"Dit is een ongeldig hex kleur!",
+ "emojiTooShort":"Deze tekst moet minimum {0} emoji's hebben!",
+ "emojiTooLong":"Deze tekst mag maximum {0} emoji's hebben!",
+ "emojiCustom":"Deze emoji kan geen custom discord emoji zijn!",
+ "emojiInvalid":"Dit is een ongeldige emoji!",
+ "urlInvalid":"Deze url is ongeldig!",
+ "urlInvalidHttp":"Deze url kan alleen het https:// protocol gebruiken!",
+ "urlInvalidProtocol":"Deze url kan alleen de http:// & https:// protocolen gebruiken!",
+ "urlInvalidHostname":"Deze url heeft een verboden hostnaam (domein)!",
+ "urlInvalidExtension":"Deze url heeft een ongeldige extensie! Kies tussen: {0}!",
+ "urlInvalidPath":"Deze url heeft een ongeldig pad!",
+ "idNotUnique":"Dit id is niet uniek, gebruik een andere in de plaats!",
+ "idNonExistent":"Het id {0} bestaat niet!",
+
+ "invalidType":"Het type van deze property moet gelijk zijn aan: {0}!",
+ "propertyMissing":"De property {0} mist in dit object!",
+ "propertyOptional":"De property {0} is optioneel in dit object!",
+ "objectDisabled":"Dit object is uitgeschakeld, gebruik het met behulp van {0}!",
+ "nullInvalid":"Deze property kan niet null zijn!",
+ "switchInvalidType":"Dit moet een van de volgende types zijn: {0}!",
+ "objectSwitchInvalid":"Dit object moet een van de volgende types zijn: {0}!",
+
+ "invalidLanguage":"Dit is een ongeldige taal!",
+ "invalidButton":"Deze knop moet een {0} of {1} hebben!",
+ "unusedOption":"De optie {0} wordt nergens gebruikt!",
+ "unusedQuestion":"The vraag {0} wordt nergens gebruikt!",
+ "dropdownOption":"Een paneel met dropdown mag alleen opties bevaten van het 'ticket' type!"
+ }
+ },
+ "actions":{
+ "buttons":{
+ "create":"Bekijk Ticket",
+ "close":"Sluit Ticket",
+ "delete":"Verwijder Ticket",
+ "reopen":"Heropen Ticket",
+ "claim":"Claim Ticket",
+ "unclaim":"Ontclaim Ticket",
+ "pin":"Pin Ticket",
+ "unpin":"Maak Ticket Los",
+ "clear":"Verwijder Tickets",
+ "helpSwitchSlash":"Bekijk Slash Commands",
+ "helpSwitchText":"Bekijk Text Commands",
+ "helpPage":"Pagina {0}",
+ "withReason":"Met Reden",
+ "withoutTranscript":"Zonder Transcript"
+ },
+ "titles":{
+ "created":"Ticket Gecreëerd",
+ "close":"Ticket Gesloten",
+ "delete":"Ticket Verwijderd",
+ "reopen":"Ticket Heropend",
+ "claim":"Ticket Geclaimd",
+ "unclaim":"Ticket Ontclaimd",
+ "pin":"Ticket Gepind",
+ "unpin":"Ticket Losgemaakt",
+ "rename":"Ticket Hernoemd",
+ "move":"Ticket Verplaatst",
+ "add":"Ticket Gebruiker Toegevoegd",
+ "remove":"Ticket Gebruiker Verwijderd",
+
+ "help":"Beschikbare Commands",
+ "statsReset":"Reset Stats",
+ "blacklistAdd":"Gebruiker Geblacklisted",
+ "blacklistRemove":"Gebruiker Vrijgelaten",
+ "blacklistGet":"Geblackliste Gebruiker",
+ "blacklistView":"Huidige Blacklist",
+ "blacklistAddDm":"Toegevoegd Aan Blacklist",
+ "blacklistRemoveDm":"Verwijderd Van Blacklist",
+ "clear":"Tickets Opgeruimd",
+ "roles":"Rollen Bijgewerkt",
+
+ "autoclose":"Ticket Automatisch Gesloten",
+ "autocloseEnabled":"Autoclose Ingeschakeld",
+ "autocloseDisabled":"Autoclose Uitgeschakeld",
+ "autodelete":"Ticket Automatisch Verwijderd",
+ "autodeleteEnabled":"Autodelete Ingeschakeld",
+ "autodeleteDisabled":"Autodelete Uitgeschakeld"
+ },
+ "descriptions":{
+ "create":"Je ticket is aangemaakt. Klik op de knop hier onder om er naar toe te gaan!",
+ "close":"Het ticket is succesvol gesloten!",
+ "delete":"Het ticket is succesvol verwijderd!",
+ "reopen":"Het ticket is succesvol heropend!",
+ "claim":"Het ticket is succesvol geclaimd!",
+ "unclaim":"Het ticket is succesvol ontclaimd!",
+ "pin":"Het ticket is succesvol gepind!",
+ "unpin":"Het ticket is succesvol losgemaakt!",
+ "rename":"Het ticket is succesvol hernoemd naar {0}!",
+ "move":"Het ticket is succesvol verplaatst naar {0}!",
+ "add":"{0} is succesvol toegevoegd aan het ticket!",
+ "remove":"{0} is succesvol verwijderd van het ticket!",
+
+ "helpExplanation":"`` => verplichte parameter\n`[naam]` => optionele parameter",
+ "statsReset":"De bot stats zijn succesvol gereset!",
+ "statsError":"Kan ticket stats niet bekijken!\n{0} is geen ticket!",
+ "blacklistAdd":"{0} is succesvol geblacklist!",
+ "blacklistRemove":"{0} is succesvol vrijgelaten!",
+ "blacklistGetSuccess":"{0} is op dit moment geblacklist!",
+ "blacklistGetEmpty":"{0} is op dit moment niet geblacklist!",
+ "blacklistViewEmpty":"Nog niemand is geblacklist!",
+ "blacklistViewTip":"Gebruik \"/blacklist add\" om een gebruiker te blacklisten!",
+ "clearVerify":"Weet je zeker dat je meerdere tickets wilt verwijderen? Deze actie kan niet teruggedraaid worden!",
+ "clearReady":"{0} tickets zijn succesvol verwijderd!",
+ "rolesEmpty":"Geen enkele rollen zijn bijgewerkt!",
+
+ "autocloseLeave":"Dit ticket is automatisch gesloten omdat de maker de server verlaten is!",
+ "autocloseTimeout":"Dit ticket is automatisch gesloten omdat het inactief was voor meer dan `{0} uur`!",
+ "autodeleteLeave":"Dit ticket is automatisch verwijderd omdat de maker de server verlaten is!",
+ "autodeleteTimeout":"Dit ticket is automatisch verwijderd omdat het inactief was voor meer dan `{0} dagen`!",
+ "autocloseEnabled":"Autoclose is ingeschakeld in dit ticket!\nHet wordt gesloten wanneer het inactief is voor meer dan `{0} uur`!",
+ "autocloseDisabled":"Autoclose is uitgeschakeld in dit ticket!\nHet wordt niet meer automatisch gesloten!",
+ "autodeleteEnabled":"Autodelete is ingeschakeld in dit ticket!\nHet wordt verwijderd wanneer het inactief is voor meer dan `{0} dagen`!",
+ "autodeleteDisabled":"Autodelete is uitgeschakeld in dit ticket!\nHet wordt niet meer automatisch verwijderd!",
+
+ "ticketMessageLimit":"Je kan maar {0} ticket(s) op het zelfde moment aanmaken!",
+ "ticketMessageAutoclose":"Dit ticket wordt automatisch gesloten wanneer het inactief is voor {0} uur!",
+ "ticketMessageAutodelete":"Dit ticket wordt automatisch verwijderd wanneer het inactief is voor {0} dagen!",
+ "panelReady":"Je kan het paneel hier onder vinden!\nDit bericht kan nu verwijderd worden!"
+ },
+ "modal":{
+ "closePlaceholder":"Waarom heb je dit ticket gesloten?",
+ "deletePlaceholder":"Waarom heb je dit ticket verwijderd?",
+ "reopenPlaceholder":"Waarom heb je dit ticket heropend?",
+ "claimPlaceholder":"Waarom heb je dit ticket geclaimd?",
+ "unclaimPlaceholder":"Waarom heb je dit ticket ontclaimd?",
+ "pinPlaceholder":"Waarom heb je dit ticket gepind?",
+ "unpinPlaceholder":"Waarom heb je dit ticket losgemaakt?"
+ },
+ "logs":{
+ "createLog":"Een nieuw ticket is aangemaakt door {0}!",
+ "closeLog":"Dit ticket is gesloten door {0}!",
+ "closeDm":"Jouw ticket is gesloten in onze server!",
+ "deleteLog":"Dit ticket is verwijderd door {0}!",
+ "deleteDm":"Jouw ticket is verwijderd in onze server!",
+ "reopenLog":"Dit ticket is heropend door {0}!",
+ "reopenDm":"Jouw ticket is heropend in onze server!",
+ "claimLog":"Dit ticket is geclaimd door {0}!",
+ "claimDm":"Jouw ticket is geclaimd in onze server!",
+ "unclaimLog":"Dit ticket is ontclaimd door {0}!",
+ "unclaimDm":"Jouw ticket is ontclaimd in onze server!",
+ "pinLog":"Dit ticket is gepind door {0}!",
+ "pinDm":"Jouw ticket is gepind in onze server!",
+ "unpinLog":"Dit ticket is losgemaakt door {0}!",
+ "unpinDm":"Jouw ticket is losgemaakt in onze server!",
+ "renameLog":"Dit ticket is hernoemd naar {0} door {1}!",
+ "renameDm":"Jouw ticket is hernoemd naar {0} in onze server!",
+ "moveLog":"Dit ticket is verplaatst naar {0} door {1}!",
+ "moveDm":"Jouw ticket is verplaatst naar {0} in onze server!",
+ "addLog":"{0} is toegevoegd aan dit ticket door {1}!",
+ "addDm":"{0} is toegevoegd aan jouw ticket in onze server!",
+ "removeLog":"{0} is verwijderd van dit ticket door {1}!",
+ "removeDm":"{0} is verwijderd van jouw ticket in onze server!",
+
+ "blacklistAddLog":"{0} is geblacklist door {1}!",
+ "blacklistRemoveLog":"{0} is verwijderd van de blacklist door {1}!",
+ "blacklistAddDm":"Je bent geblacklist in onze server!\nVanaf nu kan je geen tickets meer aanmaken!",
+ "blacklistRemoveDm":"Je bent verwijderd van de blacklist in onze server!\nNormaal zou je nu terug tickets kunnen aanmaken!",
+ "clearLog":"{0} tickets zijn verwijderd door by {1}!"
+ }
+ },
+ "transcripts":{
+ "success":{
+ "visit":"Bekijk Transcript",
+ "ready":"Transcript Aangemaakt",
+ "textFileDescription":"Dit is een tekst transcript van een verwijderd ticket!",
+ "htmlProgress":"Gelieve te wachten terwijl dit html transcript verwerkt wordt...",
+
+ "createdChannel":"Een nieuw {0} transcript is aangemaakt in de server!",
+ "createdCreator":"Een nieuw {0} transcript is aangemaakt voor een van jouw tickets!",
+ "createdParticipant":"Een nieuw {0} transcript is aangemaakt in een van de tickets waar jij lid van was!",
+ "createdActiveAdmin":"Een nieuw {0} transcript is aangemaakt in een van de tickets waar jij een actieve admin was!",
+ "createdEveryAdmin":"Een nieuw {0} transcript is aangemaakt in een van de tickets waar jij admin was!",
+ "createdOther":"Een nieuw {0} transcript is aangemaakt!"
+ },
+ "errors":{
+ "retry":"Herprobeer",
+ "continue":"Verwijder Zonder Transcript",
+ "backup":"Maak Backup Transcript",
+ "error":"Er is iets misgegaan bij het maken van het transcript.\nWat wil je doen?\n\nDit ticket wordt niet meer verwijderd to je een van de onderstaande knoppen gebruikt."
+ }
+ },
+ "errors":{
+ "titles":{
+ "internalError":"Interne Error",
+ "optionMissing":"Missende Command Optie",
+ "optionInvalid":"Onjuiste Command Optie",
+ "unknownCommand":"Onbekende Command",
+ "noPermissions":"Geen Permissies",
+ "unknownTicket":"Onbekend Ticket",
+ "deprecatedTicket":"Verouderd Ticket",
+ "unknownOption":"Onbekende Optie",
+ "unknownPanel":"Onbekend Paneel",
+ "notInGuild":"Niet In Server",
+ "channelRename":"Kan Kanaal Niet Hernoemen",
+ "busy":"Ticket Is Bezig"
+ },
+ "descriptions":{
+ "askForInfo":"Contacteer the eigenaar van deze bot voor meer info!",
+ "askForInfoResolve":"Contacteer de eigenaar van deze bot als het probleem niet opgelost wordt na enkele keren.",
+ "internalError":"Gefaald om te reageren op deze {0} door een interne error!",
+ "optionMissing":"Een verplichte parameter mist in deze command!",
+ "optionInvalid":"Een parameter in deze command is ongeldig!",
+ "optionInvalidChoose":"Kies tussen",
+ "unknownCommand":"Probeer het help menu te bekijken voor meer info!",
+ "noPermissions":"Je bent niet toegestaan om deze {0} te gebruiken!",
+ "noPermissionsList":"Benodigde Permissies: (één van deze)",
+ "noPermissionsCooldown":"Je bent niet toegestaan om deze {0} te gebruiken omdat je een cooldown hebt!",
+ "noPermissionsBlacklist":"Je bent niet toegestaan om deze {0} te gebruiken omdat je geblacklist bent!",
+ "noPermissionsLimitGlobal":"Je bent niet toegestaan om een ticket aan te maken omdat de server het maximum tickets limiet heeft bereikt!",
+ "noPermissionsLimitGlobalUser":"Je bent niet toegestaan om een ticket aan te maken omdat je het maximum tickets limiet hebt bereikt!",
+ "noPermissionsLimitOption":"Je bent niet toegestaan om een ticket aan te maken omdat de server het maximum tickets limiet van deze optie heeft bereikt!",
+ "noPermissionsLimitOptionUser":"Je bent niet toegestaan om een ticket aan te maken omdat je het maximum tickets limiet van deze optie hebt bereikt!",
+ "unknownTicket":"Probeer deze command opnieuw in een geldig ticket!",
+ "deprecatedTicket":"Het huidige kanaal is geen geldig ticket! Het is misschien een ticket van een oudere Open Ticket versie!",
+ "notInGuild":"Deze {0} werkt niet in DM! Probeer het opnieuw in een server!",
+ "channelRename":"Door discord ratelimits is het op dit moment onmogelijk voor de bot om het kanaal te hernoemen. Het kanaal zal automatisch hernoemd worden over 10 min als de bot niet herstart wordt.",
+ "channelRenameSource":"De bron van deze error is: {0}",
+ "busy":"Kan deze {0} niet gebruiken!\nHet ticket wordt op dit moment verwerkt door de bot.\n\nProbeer het opnieuw binnen een paar seconden!"
+ },
+ "optionInvalidReasons":{
+ "stringRegex":"Waarde is niet gelijk aan het patroon!",
+ "stringMinLength":"Waarde moet minstens {0} karakters hebben!",
+ "stringMaxLength":"Waarde moet maximum {0} karakters hebben!",
+ "numberInvalid":"Ongeldig nummer!",
+ "numberMin":"Nummer moet minstens {0} zijn!",
+ "numberMax":"Nummer moet maximum {0} zijn!",
+ "numberDecimal":"Nummer kan geen kommagetal zijn!",
+ "numberNegative":"Nummer mag niet negatief zijn!",
+ "numberPositive":"Nummer mag niet positief zijn!",
+ "numberZero":"Nummer mag niet nul zijn!",
+ "channelNotFound":"Kan kanaal niet vinden!",
+ "userNotFound":"Kan gebruiker niet vinden!",
+ "roleNotFound":"Kan rol niet vinden!",
+ "memberNotFound":"Kan gebruiker niet vinden!",
+ "mentionableNotFound":"Kan gebruiker of rol niet vinden!",
+ "channelType":"Ongeldig kanaal type!",
+ "notInGuild":"Voor deze optie moet je in een server zitten!"
+ },
+ "permissions":{
+ "developer":"Je moet de ontwikkelaar van de bot zijn.",
+ "owner":"Je moet de server eigenaar zijn.",
+ "admin":"Je moet een server admin zijn.",
+ "moderator":"Je moet een server moderator zijn.",
+ "support":"Je moet in het support team zitten.",
+ "member":"Je moet een member van de server zijn.",
+ "discord-administrator":"Je hebt de `ADMINISTRATOR` permissie nodig."
+ },
+ "actionInvalid":{
+ "close":"Ticket is al gesloten!",
+ "reopen":"Ticket is nog niet gesloten!",
+ "claim":"Ticket is al geclaimd!",
+ "unclaim":"Ticket nog niet geclaimd!",
+ "pin":"Ticket is al gepind!",
+ "unpin":"Ticket nog niet gepind!",
+ "add":"Deze gebruiker heeft al toegang tot dit ticket!",
+ "remove":"Deze gebruiker kan niet verwijderd worden van dit ticket!"
+ }
+ },
+ "params":{
+ "uppercase":{
+ "ticket":"Ticket",
+ "tickets":"Tickets",
+ "reason":"Reden",
+ "creator":"Maker",
+ "remaining":"Resterende Tijd",
+ "added":"Toegevoegd",
+ "removed":"Verwijderd",
+ "filter":"Filter",
+ "claimedBy":"Geclaimd Door {0}",
+ "method":"Methode",
+ "type":"Type",
+ "blacklisted":"Geblacklist",
+ "panel":"Paneel",
+ "command":"Command",
+ "system":"Systeem",
+ "true":"Waar",
+ "false":"Onwaar",
+ "syntax":"Syntax",
+ "originalName":"Originele Naam",
+ "newName":"Nieuwe Naam",
+ "until":"Tot",
+ "validOptions":"Geldige Opties",
+ "validPanels":"Geldige Panelen",
+ "autoclose":"Autoclose",
+ "autodelete":"Autodelete",
+ "startupDate":"Opstart Datum",
+ "version":"Versie",
+ "name":"Naam",
+ "role":"Rol",
+ "status":"Status",
+ "claimed":"Geclaimd",
+ "pinned":"Gepind",
+ "creationDate":"Aanmaakdatum"
+ },
+ "lowercase":{
+ "text":"tekst",
+ "html":"html",
+ "command":"command",
+ "modal":"form",
+ "button":"knop",
+ "dropdown":"dropdown",
+ "method":"methode"
+ }
+ },
+ "commands":{
+ "reason":"Specifieer een optionele reden die zichtbaar is in de logs.",
+ "help":"Verkrijg een lijst met alle beschikbare commands.",
+ "panel":"Spawn een bericht met een dropdown of knoppen (voor ticket creatie).",
+ "panelId":"Het id van het paneel dat je wilt spawnen.",
+ "panelAutoUpdate":"Wil je dat dit paneel automatisch bijwerkt wanneer het aangepast wordt?",
+ "ticket":"Maak een instant ticket.",
+ "ticketId":"Het id van het ticket dat je wilt aanmaken.",
+ "close":"Sluit een ticket, dit schakelt schrijven in het kanaal uit.",
+ "delete":"Verwijder een ticket, dit maakt een transcript waneer ingeschakeld.",
+ "deleteNoTranscript":"Verwijder dit ticket zonder een transcript aan te maken.",
+ "reopen":"Heropen een ticket, dit schakelt schrijven in het kanaal terug aan.",
+ "claim":"Claim een ticket.",
+ "claimUser":"Claim dit ticket voor iemand anders.",
+ "unclaim":"Ontclaim dit ticket.",
+ "pin":"Pin dit ticket.",
+ "unpin":"Maak dit ticket los.",
+ "move":"Verplaats een ticket.",
+ "moveId":"Het id van de optie waarnaar je wilt verplaatsen.",
+ "rename":"Hernoem een ticket.",
+ "renameName":"De nieuwe naam voor dit ticket.",
+ "add":"Voeg een gebruiker toe aan dit ticket.",
+ "addUser":"De gebruiker om toe te voegen.",
+ "remove":"Verwijder een user van dit ticket.",
+ "removeUser":"De gebruiker om te verwijderen.",
+ "blacklist":"Beheer de ticket blacklist.",
+ "blacklistView":"Bekijk de huidige blacklist.",
+ "blacklistAdd":"Voeg een gebruiker toe aan de blacklist.",
+ "blacklistRemove":"Verwijder een gebruiker van de blacklist.",
+ "blacklistGet":"Verkrijg de details van een geblackliste gebruiker.",
+ "blacklistGetUser":"De gebruiker om details van te verkrijgen.",
+ "stats":"Bekijk statistieken van de bot, een gebruiker of ticket.",
+ "statsReset":"Reset alle stats van de bot (en begin terug bij nul).",
+ "statsGlobal":"Bekijk de globale stats.",
+ "statsUser":"Bekijk de stats van een gebruiker in de server.",
+ "statsUserUser":"De gebruiker om te bekijken.",
+ "statsTicket":"Bekijk de stats van een ticket in de server.",
+ "statsTicketTicket":"Het ticket om te bekijken.",
+ "clear":"Verwijder meerdere tickets tegelijkertijd.",
+ "clearFilter":"De filter om tickets op te ruimen.",
+ "clearFilters":{
+ "all":"Allemaal",
+ "open":"Open (niet gesloten)",
+ "close":"Gesloten",
+ "claim":"Geclaimd",
+ "unclaim":"Ontclaimd (niet geclaimd)",
+ "pin":"Gepind",
+ "unpin":"Losgemaakt (niet gepind)",
+ "autoclose":"Automatisch Gesloten"
+ },
+ "autoclose":"Beheer autoclose in een ticket.",
+ "autocloseDisable":"Schakel autoclose in dit ticket uit.",
+ "autocloseEnable":"Schakel autoclose in dit ticket in.",
+ "autocloseEnableTime":"De hoeveelheid uren dat dit ticket inactief moet zijn voor het te sluiten.",
+ "autodelete":"Beheer autodelete in een ticket.",
+ "autodeleteDisable":"Schakel autodelete in dit ticket aan.",
+ "autodeleteEnable":"Schakel autodelete in dit ticket aan.",
+ "autodeleteEnableTime":"De hoeveelheid dagen dat dit ticket inactief moet zijn voor het te verwijderen."
+ },
+ "helpMenu":{
+ "help":"Krijg een lijst van alle beschikbare commands.",
+ "ticket":"Maak een instant ticket.",
+ "close":"Sluit een ticket, dit schakelt schrijven in het kanaal uit.",
+ "delete":"Verwijder een ticket, dit maakt een transcript wanneer ingeschakeld.",
+ "reopen":"Heropen een ticket, dit schakeld schrijven in het kanaal terug aan.",
+ "pin":"Pin een ticket. Dit verplaatst het ticket naar boven & voegt een '📌' emoij toe.",
+ "unpin":"Maak een ticket los. Het ticket zal blijven staan, maar de '📌' emoij verliezen.",
+ "move":"Verplaats een ticket. Dit verandert het soort van dit ticket.",
+ "rename":"Hernoem een ticket. Dit zal de kanaalnaam veranderen.",
+ "claim":"Claim een ticket. Hiermee kan je laten weten dat je bezig bent met dit ticket.",
+ "unclaim":"Ontclaim een ticket. Hiermee kan je laten weten dat het ticket terug vrij is.",
+ "add":"Voeg een user toe aan een ticket.",
+ "remove":"Verwijder een user van een ticket.",
+ "panel":"Spawn een bericht met dropdown of knoppen.",
+ "blacklistView":"Bekijk een lijst van de huidige blacklist.",
+ "blacklistAdd":"Voeg een user toe aan de blacklist.",
+ "blacklistRemove":"Verwijder een user van de blacklist.",
+ "blacklistGet":"Verkrijg de details van een geblacklisted user.",
+ "statsGlobal":"Bekijk de globale stats.",
+ "statsTicket":"Bekijk de stats van een ticket in de server.",
+ "statsUser":"Bekijk de stats van een user in de server.",
+ "statsReset":"Reset alle stats van de bot (en begin terug vanaf 0).",
+ "autocloseDisable":"Zet autoclose uit in dit ticket.",
+ "autocloseEnable":"Zet autoclose in aan dit ticket.",
+ "autodeleteDisable":"Zet autodelete uit in dit ticket.",
+ "autodeleteEnable":"Zet autodelete aan in dit ticket."
+ },
+ "stats":{
+ "scopes":{
+ "global":"Globale Stats",
+ "system":"Systeem Stats",
+ "user":"User Stats",
+ "ticket":"Ticket Stats",
+ "participants":"Deelnemers"
+ },
+ "properties":{
+ "ticketsCreated":"Tickets Aangemaakt",
+ "ticketsClosed":"Tickets Gesloten",
+ "ticketsDeleted":"Tickets Verwijderd",
+ "ticketsReopened":"Tickets Heropend",
+ "ticketsAutoclosed":"Tickets Autoclosed",
+ "ticketsClaimed":"Tickets Geclaimd",
+ "ticketsPinned":"Tickets Gepind",
+ "ticketsMoved":"Tickets Verplaatst",
+ "usersBlacklisted":"Users Geblacklist",
+ "transcriptsCreated":"Transcripts Aangemaakt"
+ }
+ }
+}
\ No newline at end of file
diff --git a/languages/english.json b/languages/english.json
new file mode 100644
index 0000000..d73991b
--- /dev/null
+++ b/languages/english.json
@@ -0,0 +1,477 @@
+{
+ "_TRANSLATION":{
+ "otversion":"v4.0.0",
+ "translator":"DJj123dj",
+ "lastedited":"21/08/2024",
+ "language":"English"
+ },
+ "checker":{
+ "system":{
+ "typeError":"[ERROR]",
+ "headerOpenTicket":"OPEN TICKET",
+ "typeWarning":"[WARNING]",
+ "typeInfo":"[INFO]",
+ "headerConfigChecker":"CONFIG CHECKER",
+ "headerDescription":"check for errors in you config files!",
+ "footerError":"the bot won't start until all {0}'s are fixed!",
+ "footerWarning":"it's recommended to fix all {0}'s before starting!",
+ "footerSupport":"SUPPORT: {0} - DOCS: {1}",
+ "compactInformation":"use {0} for more information!",
+ "dataPath":"path",
+ "dataDocs":"docs",
+ "dataMessages":"message"
+ },
+ "messages":{
+ "stringTooShort":"This string can't be shorter than {0} characters!",
+ "stringTooLong":"This string can't be longer than {0} characters!",
+ "stringLengthInvalid":"This string needs to be {0} characters long!",
+ "stringStartsWith":"This string needs to start with {0}!",
+ "stringEndsWith":"This string needs to end with {0}!",
+ "stringContains":"This string needs to contain {0}!",
+ "stringChoices":"This string can only be one of the following values: {0}!",
+ "stringRegex":"This string is invalid!",
+
+ "numberTooShort":"This number can't be shorter than {0} characters!",
+ "numberTooLong":"This number can't be longer than {0} characters!",
+ "numberLengthInvalid":"This number needs to be {0} characters long!",
+ "numberTooSmall":"This number needs to be at least {0}!",
+ "numberTooLarge":"This number needs to be at most {0}!",
+ "numberNotEqual":"This number needs to be {0}!",
+ "numberStep":"This number needs to be a multiple of {0}!",
+ "numberStepOffset":"This number needs to be a multiple of {0} starting with {1}!",
+ "numberStartsWith":"This number needs to start with {0}!",
+ "numberEndsWith":"This number needs to end with {0}!",
+ "numberContains":"This number needs to contain {0}!",
+ "numberChoices":"This number can only be one of the following values: {0}!",
+ "numberFloat":"This number can't be a decimal!",
+ "numberNegative":"This number can't be negative!",
+ "numberPositive":"This number can't be positive!",
+ "numberZero":"This number can't be zero!",
+
+ "booleanTrue":"This boolean can't be true!",
+ "booleanFalse":"This boolean can't be false!",
+
+ "arrayEmptyDisabled":"This array isn't allowed to be empty!",
+ "arrayEmptyRequired":"This array is required to be empty!",
+ "arrayTooShort":"This array needs to have a length of at least {0}!",
+ "arrayTooLong":"This array needs to have a length of at most {0}!",
+ "arrayLengthInvalid":"This array needs to have a length of {0}!",
+ "arrayInvalidTypes":"This array can only contain the following types: {0}!",
+ "arrayDouble":"This array doesn't allow the same value twice!",
+
+ "discordInvalidId":"This is an invalid discord {0} id!",
+ "discordInvalidIdOptions":"This is an invalid discord {0} id! You can also use one of these: {1}!",
+ "discordInvalidToken":"This is an invalid discord token (syntactically)!",
+ "colorInvalid":"This is an invalid hex color!",
+ "emojiTooShort":"This string needs to have at least {0} emoji's!",
+ "emojiTooLong":"This string needs to have at most {0} emoji's!",
+ "emojiCustom":"This emoji can't be a custom discord emoji!",
+ "emojiInvalid":"This is an invalid emoji!",
+ "urlInvalid":"This url is invalid!",
+ "urlInvalidHttp":"This url can only use the https:// protocol!",
+ "urlInvalidProtocol":"This url can only use the http:// & https:// protocols!",
+ "urlInvalidHostname":"This url has a disallowed hostname!",
+ "urlInvalidExtension":"This url has an invalid extension! Choose between: {0}!",
+ "urlInvalidPath":"This url has an invalid path!",
+ "idNotUnique":"This id isn't unique, use another id instead!",
+ "idNonExistent":"The id {0} doesn't exist!",
+
+ "invalidType":"This property needs to be the type: {0}!",
+ "propertyMissing":"The property {0} is missing from this object!",
+ "propertyOptional":"The property {0} is optional in this object!",
+ "objectDisabled":"This object is disabled, enable it using {0}!",
+ "nullInvalid":"This property can't be null!",
+ "switchInvalidType":"This needs to be one of the following types: {0}!",
+ "objectSwitchInvalid":"This object needs to be one of the following types: {0}!",
+
+ "invalidLanguage":"This is an invalid language!",
+ "invalidButton":"This button needs to have at least an {0} or {1}!",
+ "unusedOption":"The option {0} isn't used anywhere!",
+ "unusedQuestion":"The question {0} isn't used anywhere!",
+ "dropdownOption":"A panel with dropdown enabled can only contain options of the 'ticket' type!"
+ }
+ },
+ "actions":{
+ "buttons":{
+ "create":"Visit Ticket",
+ "close":"Close Ticket",
+ "delete":"Delete Ticket",
+ "reopen":"Reopen Ticket",
+ "claim":"Claim Ticket",
+ "unclaim":"Unclaim Ticket",
+ "pin":"Pin Ticket",
+ "unpin":"Unpin Ticket",
+ "clear":"Delete Tickets",
+ "helpSwitchSlash":"View Slash Commands",
+ "helpSwitchText":"View Text Commands",
+ "helpPage":"Page {0}",
+ "withReason":"With Reason",
+ "withoutTranscript":"Without Transcript"
+ },
+ "titles":{
+ "created":"Ticket Created",
+ "close":"Ticket Closed",
+ "delete":"Ticket Deleted",
+ "reopen":"Ticket Reopened",
+ "claim":"Ticket Claimed",
+ "unclaim":"Ticket Unclaimed",
+ "pin":"Ticket Pinned",
+ "unpin":"Ticket Unpinned",
+ "rename":"Ticket Renamed",
+ "move":"Ticket Moved",
+ "add":"Ticket User Added",
+ "remove":"Ticket User Removed",
+
+ "help":"Available Commands",
+ "statsReset":"Reset Stats",
+ "blacklistAdd":"User Blacklisted",
+ "blacklistRemove":"User Released",
+ "blacklistGet":"Blacklisted User",
+ "blacklistView":"Current Blacklist",
+ "blacklistAddDm":"Added To Blacklist",
+ "blacklistRemoveDm":"Removed From Blacklist",
+ "clear":"Tickets Cleared",
+ "roles":"Roles Updated",
+
+ "autoclose":"Ticket Autoclosed",
+ "autocloseEnabled":"Autoclose Enabled",
+ "autocloseDisabled":"Autoclose Disabled",
+ "autodelete":"Ticket Autodeleted",
+ "autodeleteEnabled":"Autodelete Enabled",
+ "autodeleteDisabled":"Autodelete Disabled"
+ },
+ "descriptions":{
+ "create":"Your ticket has been created. Click the button below to access it!",
+ "close":"The ticket has been closed succesfully!",
+ "delete":"The ticket has been deleted succesfully!",
+ "reopen":"The ticket has been reopened succesfully!",
+ "claim":"The ticket has been claimed succesfully!",
+ "unclaim":"The ticket has been unclaimed succesfully!",
+ "pin":"The ticket has been pinned succesfully!",
+ "unpin":"The ticket has been unpinned succesfully!",
+ "rename":"The ticket has been renamed to {0} succesfully!",
+ "move":"The ticket has been moved to {0} succesfully!",
+ "add":"{0} has been added to the ticket succesfully!",
+ "remove":"{0} has been removed from the ticket succesfully!",
+
+ "helpExplanation":"`` => required parameter\n`[name]` => optional parameter",
+ "statsReset":"The bot stats have been reset successfully!",
+ "statsError":"Unable to view ticket stats!\n{0} is not a ticket!",
+ "blacklistAdd":"{0} has been blacklisted successfully!",
+ "blacklistRemove":"{0} has been released successfully!",
+ "blacklistGetSuccess":"{0} is currently blacklisted!",
+ "blacklistGetEmpty":"{0} is currently not blacklisted!",
+ "blacklistViewEmpty":"No-one has been blacklisted yet!",
+ "blacklistViewTip":"Use \"/blacklist add\" to blacklist a user!",
+ "clearVerify":"Are you sure you want to delete multiple tickets?\nThis action can't be undone!",
+ "clearReady":"{0} tickets have been deleted succesfully!",
+ "rolesEmpty":"No roles have been updated!",
+
+ "autocloseLeave":"This ticket has been autoclosed because the creator left the server!",
+ "autocloseTimeout":"This ticket has been autoclosed because it has been inactive for more than `{0}h`!",
+ "autodeleteLeave":"This ticket has been autodeleted because the creator left the server!",
+ "autodeleteTimeout":"This ticket has been autodeleted because it has been inactive for more than `{0} days`!",
+ "autocloseEnabled":"Autoclose has been enabled in this ticket!\nIt will be closed when it is inactive for more than `{0}h`!",
+ "autocloseDisabled":"Autoclose has been disabled in this ticket!\nIt won't be closed automatically anymore!",
+ "autodeleteEnabled":"Autodelete has been enabled in this ticket!\nIt will be deleted when it is inactive for more than `{0} days`!",
+ "autodeleteDisabled":"Autodelete has been disabled in this ticket!\nIt won't be deleted automatically anymore!",
+
+ "ticketMessageLimit":"You can only create {0} ticket(s) at the same time!",
+ "ticketMessageAutoclose":"This ticket will be autoclosed when inactive for {0}h!",
+ "ticketMessageAutodelete":"This ticket will be autodeleted when inactive for {0} days!",
+ "panelReady":"You can find the panel below!\nThis message can now be deleted!"
+ },
+ "modal":{
+ "closePlaceholder":"Why did you close this ticket?",
+ "deletePlaceholder":"Why did you delete this ticket?",
+ "reopenPlaceholder":"Why did you reopen this ticket?",
+ "claimPlaceholder":"Why did you claim this ticket?",
+ "unclaimPlaceholder":"Why did you unclaim this ticket?",
+ "pinPlaceholder":"Why did you pin this ticket?",
+ "unpinPlaceholder":"Why did you unpin this ticket?"
+ },
+ "logs":{
+ "createLog":"A new ticket got created by {0}!",
+ "closeLog":"This ticket has been closed by {0}!",
+ "closeDm":"Your ticket has been closed in our server!",
+ "deleteLog":"This ticket has been deleted by {0}!",
+ "deleteDm":"Your ticket has been deleted in our server!",
+ "reopenLog":"This ticket has been reopened by {0}!",
+ "reopenDm":"Your ticket has been reopened in our server!",
+ "claimLog":"This ticket has been claimed by {0}!",
+ "claimDm":"Your ticket has been claimed in our server!",
+ "unclaimLog":"This ticket has been unclaimed by {0}!",
+ "unclaimDm":"Your ticket has been unclaimed in our server!",
+ "pinLog":"This ticket has been pinned by {0}!",
+ "pinDm":"Your ticket has been pinned in our server!",
+ "unpinLog":"This ticket has been unpinned by {0}!",
+ "unpinDm":"Your ticket has been unpinned in our server!",
+ "renameLog":"This ticket has been renamed to {0} by {1}!",
+ "renameDm":"Your ticket has been renamed to {0} in our server!",
+ "moveLog":"This ticket has been moved to {0} by {1}!",
+ "moveDm":"Your ticket has been moved to {0} in our server!",
+ "addLog":"{0} has been added to this ticket by {1}!",
+ "addDm":"{0} has been added to your ticket in our server!",
+ "removeLog":"{0} has been removed from this ticket by {1}!",
+ "removeDm":"{0} has been removed from your ticket in our server!",
+
+ "blacklistAddLog":"{0} was blacklisted by {1}!",
+ "blacklistRemoveLog":"{0} was removed from the blacklist by {1}!",
+ "blacklistAddDm":"You have been blacklisted in our server!\nFrom now on, you are unable to create a ticket!",
+ "blacklistRemoveDm":"You have been removed from the blacklist in our server!\nNow you can create tickets again!",
+ "clearLog":"{0} tickets have been deleted by {1}!"
+ }
+ },
+ "transcripts":{
+ "success":{
+ "visit":"Visit Transcript",
+ "ready":"Transcript Created",
+ "textFileDescription":"This is the text transcript of a deleted ticket!",
+ "htmlProgress":"Please wait while this html transcript is getting processed...",
+
+ "createdChannel":"A new {0} transcript has been created in the server!",
+ "createdCreator":"A new {0} transcript has been created for one of your tickets!",
+ "createdParticipant":"A new {0} transcript has been created in one of the tickets you participated in!",
+ "createdActiveAdmin":"A new {0} transcript has been created in one of the tickets you participated as admin!",
+ "createdEveryAdmin":"A new {0} transcript has been created in one of the tickets you were admin in!",
+ "createdOther":"A new {0} transcript has been created!"
+ },
+ "errors":{
+ "retry":"Retry",
+ "continue":"Delete Without Transcript",
+ "backup":"Create Backup Transcript",
+ "error":"Something went wrong while trying to create the transcript.\nWhat would you like to do?\n\nThis ticket won't be deleted until you click one of these buttons."
+ }
+ },
+ "errors":{
+ "titles":{
+ "internalError":"Internal Error",
+ "optionMissing":"Command Option Missing",
+ "optionInvalid":"Command Option Invalid",
+ "unknownCommand":"Unknown Command",
+ "noPermissions":"No Permissions",
+ "unknownTicket":"Unknown Ticket",
+ "deprecatedTicket":"Deprecated Ticket",
+ "unknownOption":"Unknown Option",
+ "unknownPanel":"Unknown Panel",
+ "notInGuild":"Not In Server",
+ "channelRename":"Unable To Rename Channel",
+ "busy":"Ticket Is Busy"
+ },
+ "descriptions":{
+ "askForInfo":"Contact the owner of this bot for more info!",
+ "askForInfoResolve":"Contact the bot owner of this bot if this issue doesn't resolve after a few tries.",
+ "internalError":"Failed to respond to this {0} due to an internal error!",
+ "optionMissing":"A required parameter is missing in this command!",
+ "optionInvalid":"A parameter in this command is invalid!",
+ "optionInvalidChoose":"Choose between",
+ "unknownCommand":"Try visiting the help menu for more info!",
+ "noPermissions":"You are not allowed to use this {0}!",
+ "noPermissionsList":"Required Permissions: (one of them)",
+ "noPermissionsCooldown":"You are not allowed to use this {0} because you have a cooldown!",
+ "noPermissionsBlacklist":"You are not allowed to use this {0} because you have been blacklisted!",
+ "noPermissionsLimitGlobal":"You are not allowed to create a ticket because the server reached the max tickets limit!",
+ "noPermissionsLimitGlobalUser":"You are not allowed to create a ticket because you reached the max tickets limit!",
+ "noPermissionsLimitOption":"You are not allowed to create a ticket because the server reached the max tickets limit for this option!",
+ "noPermissionsLimitOptionUser":"You are not allowed to create a ticket because you reached the max tickets limit for this option!",
+ "unknownTicket":"Try this command again in a valid ticket!",
+ "deprecatedTicket":"The current channel is not a valid ticket! It might have been a ticket from an old Open Ticket version!",
+ "notInGuild":"This {0} doesn't work in DM! Please try it again in a server!",
+ "channelRename":"Due to discord ratelimits, it's currently impossible for the bot to rename the channel. The channel will automatically be renamed over 10 minutes if the bot isn't rebooted.",
+ "channelRenameSource":"The source of this error is: {0}",
+ "busy":"Unable to use this {0}!\nThe ticket is currently being processed by the bot.\n\nPlease try again in a few seconds!"
+ },
+ "optionInvalidReasons":{
+ "stringRegex":"Value doesn't match pattern!",
+ "stringMinLength":"Value needs to be at least {0} characters!",
+ "stringMaxLength":"Value needs to be at most {0} characters!",
+ "numberInvalid":"Invalid number!",
+ "numberMin":"Number needs to be at least {0}!",
+ "numberMax":"Number needs to be at most {0}!",
+ "numberDecimal":"Number is not allowed to be a decimal!",
+ "numberNegative":"Number is not allowed to be negative!",
+ "numberPositive":"Number is not allowed to be positive!",
+ "numberZero":"Number is not allowed to be zero!",
+ "channelNotFound":"Unable to find channel!",
+ "userNotFound":"Unable to find user!",
+ "roleNotFound":"Unable to find role!",
+ "memberNotFound":"Unable to find user!",
+ "mentionableNotFound":"Unable to find user or role!",
+ "channelType":"Invalid channel type!",
+ "notInGuild":"This option requires you to be in a server!"
+ },
+ "permissions":{
+ "developer":"You need to be the developer of the bot.",
+ "owner":"You need to be the server owner.",
+ "admin":"You need to be a server admin.",
+ "moderator":"You need to be a moderator.",
+ "support":"You need to be in the support team.",
+ "member":"You need to be a member.",
+ "discord-administrator":"You need to have the `ADMINISTRATOR` permission."
+ },
+ "actionInvalid":{
+ "close":"Ticket is already closed!",
+ "reopen":"Ticket is not closed yet!",
+ "claim":"Ticket is already claimed!",
+ "unclaim":"Ticket is not claimed yet!",
+ "pin":"Ticket is already pinned!",
+ "unpin":"Ticket is not pinned yet!",
+ "add":"This user is already able to access the ticket!",
+ "remove":"Unable to remove this user from the ticket!"
+ }
+ },
+ "params":{
+ "uppercase":{
+ "ticket":"Ticket",
+ "tickets":"Tickets",
+ "reason":"Reason",
+ "creator":"Creator",
+ "remaining":"Time Remaining",
+ "added":"Added",
+ "removed":"Removed",
+ "filter":"Filter",
+ "claimedBy":"Claimed By {0}",
+ "method":"Method",
+ "type":"Type",
+ "blacklisted":"Blacklisted",
+ "panel":"Panel",
+ "command":"Command",
+ "system":"System",
+ "true":"True",
+ "false":"False",
+ "syntax":"Syntax",
+ "originalName":"Original Name",
+ "newName":"New Name",
+ "until":"Until",
+ "validOptions":"Valid Options",
+ "validPanels":"Valid Panels",
+ "autoclose":"Autoclose",
+ "autodelete":"Autodelete",
+ "startupDate":"Startup Date",
+ "version":"Version",
+ "name":"Name",
+ "role":"Role",
+ "status":"Status",
+ "claimed":"Claimed",
+ "pinned":"Pinned",
+ "creationDate":"Creation Date"
+ },
+ "lowercase":{
+ "text":"text",
+ "html":"html",
+ "command":"command",
+ "modal":"modal",
+ "button":"button",
+ "dropdown":"dropdown",
+ "method":"method"
+ }
+ },
+ "commands":{
+ "reason":"Specify an optional reason that will be visible in logs.",
+ "help":"Get a list of all the available commands.",
+ "panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
+ "panelId":"The identifier of the panel that you want to spawn.",
+ "panelAutoUpdate":"Do you want this panel to automatically update when edited?",
+ "ticket":"Instantly create a ticket.",
+ "ticketId":"The identifier of the ticket that you want to create.",
+ "close":"Close a ticket.",
+ "delete":"Delete a ticket.",
+ "deleteNoTranscript":"Delete this ticket without creating a transcript.",
+ "reopen":"Reopen a ticket.",
+ "claim":"Claim a ticket.",
+ "claimUser":"Claim this ticket to someone else instead of yourself.",
+ "unclaim":"Unclaim a ticket.",
+ "pin":"Pin a ticket.",
+ "unpin":"Unpin a ticket.",
+ "move":"Move a ticket.",
+ "moveId":"The identifier of the option that you want to move to.",
+ "rename":"Rename a ticket.",
+ "renameName":"The new name for this ticket.",
+ "add":"Add a user to a ticket.",
+ "addUser":"The user to add.",
+ "remove":"Remove a user from a ticket.",
+ "removeUser":"The user to remove.",
+ "blacklist":"Manage the ticket blacklist.",
+ "blacklistView":"View a list of the current blacklist.",
+ "blacklistAdd":"Add a user to the blacklist.",
+ "blacklistRemove":"Remove a user from the blacklist.",
+ "blacklistGet":"Get the details from a blacklisted user.",
+ "blacklistGetUser":"The user to get details from.",
+ "stats":"View statistics from the bot, a member or a ticket.",
+ "statsReset":"Reset all the stats of the bot (and start counting from zero).",
+ "statsGlobal":"View the global stats.",
+ "statsUser":"View the stats from a user in the server.",
+ "statsUserUser":"The user to view.",
+ "statsTicket":"View the stats of a ticket in the server.",
+ "statsTicketTicket":"The ticket to view.",
+ "clear":"Delete multiple tickets at the same time.",
+ "clearFilter":"The filter for clearing tickets.",
+ "clearFilters":{
+ "all":"All",
+ "open":"Open",
+ "close":"Closed",
+ "claim":"Claimed",
+ "unclaim":"Unclaimed",
+ "pin":"Pinned",
+ "unpin":"Unpinned",
+ "autoclose":"Autoclosed"
+ },
+ "autoclose":"Manage autoclose in a ticket.",
+ "autocloseDisable":"Disable autoclose in this ticket.",
+ "autocloseEnable":"Enable autoclose in this ticket.",
+ "autocloseEnableTime":"The amount of hours this ticket needs to be inactive to close it.",
+ "autodelete":"Manage autodelete in a ticket.",
+ "autodeleteDisable":"Disable autodelete in this ticket.",
+ "autodeleteEnable":"Enable autodelete in this ticket.",
+ "autodeleteEnableTime":"The amount of days this ticket needs to be inactive to delete it."
+ },
+ "helpMenu":{
+ "help":"Get a list of all the available commands.",
+ "ticket":"Instantly create a ticket.",
+ "close":"Close a ticket, this disables writing in this channel.",
+ "delete":"Delete a ticket, this creates a transcript when enabled.",
+ "reopen":"Reopen a ticket, this enables writing in this channel again.",
+ "pin":"Pin a ticket. This will move the ticket to the top and will add a '📌' emoij to the name.",
+ "unpin":"Unpin a ticket. The ticket will stay on it's position but will lose the '📌' emoij.",
+ "move":"Move a ticket. This will change the type of this ticket.",
+ "rename":"Rename a ticket. This will change the channel name of this ticket.",
+ "claim":"Claim a ticket. With this, you can let your team know you are handling this ticket.",
+ "unclaim":"Unclaim a ticket. With this, you can let your team know that this ticket is free again.",
+ "add":"Add a user to a ticket. This will allow the user to read & write in this ticket.",
+ "remove":"Remove a user from a ticket. This will remove the ability to read & write for a user in this ticket.",
+ "panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
+ "blacklistView":"View a list of the current blacklist.",
+ "blacklistAdd":"Add a user to the blacklist.",
+ "blacklistRemove":"Remove a user from the blacklist.",
+ "blacklistGet":"Get the details from a blacklisted user.",
+ "statsGlobal":"View the global stats.",
+ "statsTicket":"View the stats of a ticket in the server.",
+ "statsUser":"View the stats from a user in the server.",
+ "statsReset":"Reset all the stats of the bot (and start counting from zero).",
+ "autocloseDisable":"Disable autoclose in this ticket.",
+ "autocloseEnable":"Enable autoclose in this ticket.",
+ "autodeleteDisable":"Disable autodelete in this ticket.",
+ "autodeleteEnable":"Enable autodelete in this ticket."
+ },
+ "stats":{
+ "scopes":{
+ "global":"Global Stats",
+ "system":"System Stats",
+ "user":"User Stats",
+ "ticket":"Ticket Stats",
+ "participants":"Participants"
+ },
+ "properties":{
+ "ticketsCreated":"Tickets Created",
+ "ticketsClosed":"Tickets Closed",
+ "ticketsDeleted":"Tickets Deleted",
+ "ticketsReopened":"Tickets Reopened",
+ "ticketsAutoclosed":"Tickets Autoclosed",
+ "ticketsClaimed":"Tickets Claimed",
+ "ticketsPinned":"Tickets Pinned",
+ "ticketsMoved":"Tickets Moved",
+ "usersBlacklisted":"Users Blacklisted",
+ "transcriptsCreated":"Transcripts Created"
+ }
+ }
+}
\ No newline at end of file
diff --git a/languages/portuguese.json b/languages/portuguese.json
new file mode 100644
index 0000000..181ea58
--- /dev/null
+++ b/languages/portuguese.json
@@ -0,0 +1,477 @@
+{
+ "_TRANSLATION":{
+ "otversion":"v4.0.0",
+ "translator":"quiradon",
+ "lastedited":"20/08/2024",
+ "language":"Portuguese"
+ },
+ "checker":{
+ "system":{
+ "typeError": "[ERRO]",
+ "headerOpenTicket": "ABRIR TICKET",
+ "typeWarning": "[AVISO]",
+ "typeInfo": "[INFORMAÇÃO]",
+ "headerConfigChecker": "Verificador de Configuração",
+ "headerDescription": "verifique erros nos seus arquivos de configuração!",
+ "footerError": "o bot não iniciará até que todos os {0} sejam corrigidos!",
+ "footerWarning": "é recomendado corrigir todos os {0} antes de iniciar!",
+ "footerSupport": "SUPORTE: {0} - DOCS: {1}",
+ "compactInformation": "use {0} para mais informações!",
+ "dataPath": "caminho",
+ "dataDocs": "documentos",
+ "dataMessages": "mensagem"
+ },
+ "messages":{
+ "stringTooShort": "Esta string não pode ter menos de {0} caracteres!",
+ "stringTooLong": "Esta string não pode ter mais de {0} caracteres!",
+ "stringLengthInvalid": "Esta string precisa ter {0} caracteres!",
+ "stringStartsWith": "Esta string precisa começar com {0}!",
+ "stringEndsWith": "Esta string precisa terminar com {0}!",
+ "stringContains": "Esta string precisa conter {0}!",
+ "stringChoices": "Esta string só pode ser um dos seguintes valores: {0}!",
+ "stringRegex": "Esta string é inválida!",
+
+ "numberTooShort": "Este número não pode ter menos de {0} caracteres!",
+ "numberTooLong": "Este número não pode ter mais de {0} caracteres!",
+ "numberLengthInvalid": "Este número precisa ter {0} caracteres!",
+ "numberTooSmall": "Este número precisa ser pelo menos {0}!",
+ "numberTooLarge": "Este número precisa ser no máximo {0}!",
+ "numberNotEqual": "Este número precisa ser {0}!",
+ "numberStep": "Este número precisa ser um múltiplo de {0}!",
+ "numberStepOffset": "Este número precisa ser um múltiplo de {0} começando com {1}!",
+ "numberStartsWith": "Este número precisa começar com {0}!",
+ "numberEndsWith": "Este número precisa terminar com {0}!",
+ "numberContains": "Este número precisa conter {0}!",
+ "numberChoices": "Este número só pode ser um dos seguintes valores: {0}!",
+ "numberFloat": "Este número não pode ser decimal!",
+ "numberNegative": "Este número não pode ser negativo!",
+ "numberPositive": "Este número não pode ser positivo!",
+ "numberZero": "Este número não pode ser zero!",
+
+ "booleanTrue": "Este booleano não pode ser verdadeiro!",
+ "booleanFalse": "Este booleano não pode ser falso!",
+
+ "arrayEmptyDisabled": "Este array não pode estar vazio!",
+ "arrayEmptyRequired": "Este array deve estar vazio!",
+ "arrayTooShort": "Este array precisa ter um comprimento de pelo menos {0}!",
+ "arrayTooLong": "Este array precisa ter um comprimento de no máximo {0}!",
+ "arrayLengthInvalid": "Este array precisa ter um comprimento de {0}!",
+ "arrayInvalidTypes": "Este array só pode conter os seguintes tipos: {0}!",
+ "arrayDouble": "Este array não permite o mesmo valor duas vezes!",
+
+ "discordInvalidId": "Este é um ID do Discord inválido {0}!",
+ "discordInvalidIdOptions": "Este é um ID do Discord inválido {0}! Você também pode usar um destes: {1}!",
+ "discordInvalidToken": "Este é um token do Discord inválido (sintaticamente)!",
+ "colorInvalid": "Esta é uma cor hexadecimal inválida!",
+ "emojiTooShort": "Esta string precisa ter pelo menos {0} emojis!",
+ "emojiTooLong": "Esta string precisa ter no máximo {0} emojis!",
+ "emojiCustom": "Este emoji não pode ser um emoji personalizado do Discord!",
+ "emojiInvalid": "Este é um emoji inválido!",
+ "urlInvalid": "Esta URL é inválida!",
+ "urlInvalidHttp": "Esta URL só pode usar o protocolo https://!",
+ "urlInvalidProtocol": "Esta URL só pode usar os protocolos http:// e https://!",
+ "urlInvalidHostname": "Esta URL tem um hostname não permitido!",
+ "urlInvalidExtension": "Esta URL tem uma extensão inválida! Escolha entre: {0}!",
+ "urlInvalidPath": "Esta URL tem um caminho inválido!",
+ "idNotUnique": "Este ID não é único, use outro ID!",
+ "idNonExistent": "O ID {0} não existe!",
+
+ "invalidType": "Esta propriedade precisa ser do tipo: {0}!",
+ "propertyMissing": "A propriedade {0} está faltando neste objeto!",
+ "propertyOptional": "A propriedade {0} é opcional neste objeto!",
+ "objectDisabled": "Este objeto está desabilitado, habilite-o usando {0}!",
+ "nullInvalid": "Esta propriedade não pode ser nula!",
+ "switchInvalidType": "Isso precisa ser um dos seguintes tipos: {0}!",
+ "objectSwitchInvalid": "Este objeto precisa ser um dos seguintes tipos: {0}!",
+
+ "invalidLanguage": "Este é um idioma inválido!",
+ "invalidButton": "Este botão precisa ter pelo menos um {0} ou {1}!",
+ "unusedOption": "A opção {0} não é usada em nenhum lugar!",
+ "unusedQuestion": "A pergunta {0} não é usada em nenhum lugar!",
+ "dropdownOption": "Um painel com dropdown habilitado só pode conter opções do tipo 'ticket'!"
+ }
+ },
+ "actions":{
+ "buttons":{
+ "create": "Visitar Ticket",
+ "close": "Fechar Ticket",
+ "delete": "Excluir Ticket",
+ "reopen": "Reabrir Ticket",
+ "claim": "Reivindicar Ticket",
+ "unclaim": "Desreivindicar Ticket",
+ "pin": "Fixar Ticket",
+ "unpin": "Desfixar Ticket",
+ "clear": "Excluir Tickets",
+ "helpSwitchSlash": "Ver Comandos Slash",
+ "helpSwitchText": "Ver Comandos de Texto",
+ "helpPage": "Página {0}",
+ "withReason": "Com Motivo",
+ "withoutTranscript": "Sem Transcrição"
+ },
+ "titles":{
+ "created":"Ticket Criado",
+ "close":"Ticket Fechado",
+ "delete":"Ticket Deletado",
+ "reopen":"Ticket Re-abeto",
+ "claim":"Ticket Resgatado",
+ "unclaim":"Ticket Não Resgatado",
+ "pin":"Ticket Fixado",
+ "unpin":"Ticket Desfixado",
+ "rename":"Ticket Renomeado",
+ "move":"Ticket Movido",
+ "add":"Ticket Usuário Adicionado",
+ "remove":"Ticket Usuário Removido",
+
+ "help":"Comandos disponíveis",
+ "statsReset":"Redefinir Status",
+ "blacklistAdd":"User Blacklisted",
+ "blacklistRemove":"User Released",
+ "blacklistGet":"Usuário na Blacklisted",
+ "blacklistView":"Atualmente na Blacklist",
+ "blacklistAddDm":"Adicionado a Blacklist",
+ "blacklistRemoveDm":"Removido da Blacklist",
+ "clear":"Tickets Limpos",
+ "roles":"Cargos Atualizados",
+
+ "autoclose": "Ticket Fechado Automaticamente",
+ "autocloseEnabled": "Fechamento Automático Habilitado",
+ "autocloseDisabled": "Fechamento Automático Desabilitado",
+ "autodelete": "Ticket Excluído Automaticamente",
+ "autodeleteEnabled": "Exclusão Automática Habilitada",
+ "autodeleteDisabled": "Exclusão Automática Desabilitada"
+ },
+ "descriptions":{
+ "create": "Seu ticket foi criado. Clique no botão abaixo para acessá-lo!",
+ "close": "O ticket foi fechado com sucesso!",
+ "delete": "O ticket foi excluído com sucesso!",
+ "reopen": "O ticket foi reaberto com sucesso!",
+ "claim": "O ticket foi reivindicado com sucesso!",
+ "unclaim": "O ticket foi desreivindicado com sucesso!",
+ "pin": "O ticket foi fixado com sucesso!",
+ "unpin": "O ticket foi desfixado com sucesso!",
+ "rename": "O ticket foi renomeado para {0} com sucesso!",
+ "move": "O ticket foi movido para {0} com sucesso!",
+ "add": "{0} foi adicionado ao ticket com sucesso!",
+ "remove": "{0} foi removido do ticket com sucesso!",
+
+ "helpExplanation":"`` => parâmetro obrigatório\n`[nome]` => parâmetro opcional",
+ "statsReset":"As estatísticas do bot foram redefinidas com sucesso!",
+ "statsError":"Não foi possível visualizar as estatísticas do ticket!\n{0} não é um ticket!",
+ "blacklistAdd":"{0} foi adicionado à lista negra com sucesso!",
+ "blacklistRemove":"{0} foi removido da lista negra com sucesso!",
+ "blacklistGetSuccess":"{0} está atualmente na lista negra!",
+ "blacklistGetEmpty":"{0} não está atualmente na lista negra!",
+ "blacklistViewEmpty":"Ninguém foi adicionado à lista negra ainda!",
+ "blacklistViewTip":"Use \"/blacklist add\" para adicionar um usuário à lista negra!",
+ "clearVerify":"Você tem certeza de que deseja excluir vários tickets?\nEsta ação não pode ser desfeita!",
+ "clearReady":"{0} tickets foram excluídos com sucesso!",
+ "rolesEmpty":"Nenhum cargo foi atualizado!",
+
+ "autocloseLeave": "Este ticket foi fechado automaticamente porque o criador saiu do servidor!",
+ "autocloseTimeout": "Este ticket foi fechado automaticamente porque ficou inativo por mais de `{0}h`!",
+ "autodeleteLeave": "Este ticket foi excluído automaticamente porque o criador saiu do servidor!",
+ "autodeleteTimeout": "Este ticket foi excluído automaticamente porque ficou inativo por mais de `{0} dias`!",
+ "autocloseEnabled": "O fechamento automático foi habilitado neste ticket!\nEle será fechado quando ficar inativo por mais de `{0}h`!",
+ "autocloseDisabled": "O fechamento automático foi desabilitado neste ticket!\nEle não será mais fechado automaticamente!",
+ "autodeleteEnabled": "A exclusão automática foi habilitada neste ticket!\nEle será excluído quando ficar inativo por mais de `{0} dias`!",
+ "autodeleteDisabled": "A exclusão automática foi desabilitada neste ticket!\nEle não será mais excluído automaticamente!",
+
+ "ticketMessageLimit": "Você só pode criar {0} ticket(s) ao mesmo tempo!",
+ "ticketMessageAutoclose": "Este ticket será fechado automaticamente quando inativo por {0}h!",
+ "ticketMessageAutodelete": "Este ticket será excluído automaticamente quando inativo por {0} dias!",
+ "panelReady": "Você pode encontrar o painel abaixo!\nEsta mensagem agora pode ser excluída!"
+ },
+ "modal":{
+ "closePlaceholder": "Por que você fechou este ticket?",
+ "deletePlaceholder": "Por que você excluiu este ticket?",
+ "reopenPlaceholder": "Por que você reabriu este ticket?",
+ "claimPlaceholder": "Por que você reivindicou este ticket?",
+ "unclaimPlaceholder": "Por que você desreivindicou este ticket?",
+ "pinPlaceholder": "Por que você fixou este ticket?",
+ "unpinPlaceholder": "Por que você desfixou este ticket?"
+ },
+ "logs":{
+ "createLog": "Um novo ticket foi criado por {0}!",
+ "closeLog": "Este ticket foi fechado por {0}!",
+ "closeDm": "Seu ticket foi fechado em nosso servidor!",
+ "deleteLog": "Este ticket foi excluído por {0}!",
+ "deleteDm": "Seu ticket foi excluído em nosso servidor!",
+ "reopenLog": "Este ticket foi reaberto por {0}!",
+ "reopenDm": "Seu ticket foi reaberto em nosso servidor!",
+ "claimLog": "Este ticket foi reivindicado por {0}!",
+ "claimDm": "Seu ticket foi reivindicado em nosso servidor!",
+ "unclaimLog": "Este ticket foi desreivindicado por {0}!",
+ "unclaimDm": "Seu ticket foi desreivindicado em nosso servidor!",
+ "pinLog": "Este ticket foi fixado por {0}!",
+ "pinDm": "Seu ticket foi fixado em nosso servidor!",
+ "unpinLog": "Este ticket foi desfixado por {0}!",
+ "unpinDm": "Seu ticket foi desfixado em nosso servidor!",
+ "renameLog": "Este ticket foi renomeado para {0} por {1}!",
+ "renameDm": "Seu ticket foi renomeado para {0} em nosso servidor!",
+ "moveLog": "Este ticket foi movido para {0} por {1}!",
+ "moveDm": "Seu ticket foi movido para {0} em nosso servidor!",
+ "addLog": "{0} foi adicionado a este ticket por {1}!",
+ "addDm": "{0} foi adicionado ao seu ticket em nosso servidor!",
+ "removeLog": "{0} foi removido deste ticket por {1}!",
+ "removeDm": "{0} foi removido do seu ticket em nosso servidor!",
+
+ "blacklistAddLog": "{0} foi adicionado à lista negra por {1}!",
+ "blacklistRemoveLog": "{0} foi removido da lista negra por {1}!",
+ "blacklistAddDm": "Você foi adicionado à lista negra em nosso servidor!\nA partir de agora, você não pode criar um ticket!",
+ "blacklistRemoveDm": "Você foi removido da lista negra em nosso servidor!\nAgora você pode criar tickets novamente!",
+ "clearLog": "{0} tickets foram excluídos por {1}!"
+ }
+ },
+ "transcripts":{
+ "success":{
+ "visit": "Visitar Transcrição",
+ "ready": "Transcrição Criada",
+ "textFileDescription": "Esta é a transcrição em texto de um ticket excluído!",
+ "htmlProgress": "Por favor, aguarde enquanto esta transcrição em HTML está sendo processada...",
+
+ "createdChannel": "Uma nova transcrição de {0} foi criada no servidor!",
+ "createdCreator": "Uma nova transcrição de {0} foi criada para um dos seus tickets!",
+ "createdParticipant": "Uma nova transcrição de {0} foi criada em um dos tickets em que você participou!",
+ "createdActiveAdmin": "Uma nova transcrição de {0} foi criada em um dos tickets em que você participou como administrador!",
+ "createdEveryAdmin": "Uma nova transcrição de {0} foi criada em um dos tickets em que você era administrador!",
+ "createdOther": "Uma nova transcrição de {0} foi criada!"
+ },
+ "errors":{
+ "retry": "Tentar Novamente",
+ "continue": "Excluir Sem Transcrição",
+ "backup": "Criar Transcrição de Backup",
+ "error": "Algo deu errado ao tentar criar a transcrição.\nO que você gostaria de fazer?\n\nEste ticket não será excluído até que você clique em um desses botões."
+ }
+ },
+ "errors":{
+ "titles":{
+ "internalError": "Erro Interno",
+ "optionMissing": "Opção de Comando Ausente",
+ "optionInvalid": "Opção de Comando Inválida",
+ "unknownCommand": "Comando Desconhecido",
+ "noPermissions": "Sem Permissões",
+ "unknownTicket": "Ticket Desconhecido",
+ "deprecatedTicket": "Ticket Obsoleto",
+ "unknownOption": "Opção Desconhecida",
+ "unknownPanel": "Painel Desconhecido",
+ "notInGuild": "Não Está no Servidor",
+ "channelRename": "Incapaz de Renomear Canal",
+ "busy": "Ticket Está Ocupado"
+ },
+ "descriptions":{
+ "askForInfo": "Entre em contato com o proprietário deste bot para mais informações!",
+ "askForInfoResolve": "Entre em contato com o proprietário deste bot se este problema não for resolvido após algumas tentativas.",
+ "internalError": "Falha ao responder a este {0} devido a um erro interno!",
+ "optionMissing": "Um parâmetro obrigatório está faltando neste comando!",
+ "optionInvalid": "Um parâmetro neste comando é inválido!",
+ "optionInvalidChoose": "Escolha entre",
+ "unknownCommand": "Tente visitar o menu de ajuda para mais informações!",
+ "noPermissions": "Você não tem permissão para usar este {0}!",
+ "noPermissionsList": "Permissões Necessárias: (uma delas)",
+ "noPermissionsCooldown": "Você não tem permissão para usar este {0} porque você está em período de cooldown!",
+ "noPermissionsBlacklist": "Você não tem permissão para usar este {0} porque você foi colocado na lista negra!",
+ "noPermissionsLimitGlobal": "Você não tem permissão para criar um ticket porque o servidor atingiu o limite máximo de tickets!",
+ "noPermissionsLimitGlobalUser": "Você não tem permissão para criar um ticket porque você atingiu o limite máximo de tickets!",
+ "noPermissionsLimitOption": "Você não tem permissão para criar um ticket porque o servidor atingiu o limite máximo de tickets para esta opção!",
+ "noPermissionsLimitOptionUser": "Você não tem permissão para criar um ticket porque você atingiu o limite máximo de tickets para esta opção!",
+ "unknownTicket": "Tente este comando novamente em um ticket válido!",
+ "deprecatedTicket": "O canal atual não é um ticket válido! Pode ter sido um ticket de uma versão antiga do Open Ticket!",
+ "notInGuild": "Este {0} não funciona em DM! Por favor, tente novamente em um servidor!",
+ "channelRename": "Devido aos limites de taxa do Discord, atualmente é impossível para o bot renomear o canal. O canal será renomeado automaticamente em 10 minutos se o bot não for reiniciado.",
+ "channelRenameSource": "A fonte deste erro é: {0}",
+ "busy": "Não é possível usar este {0}!\nO ticket está sendo processado pelo bot no momento.\n\nPor favor, tente novamente em alguns segundos!"
+ },
+ "optionInvalidReasons":{
+ "stringRegex": "O valor não corresponde ao padrão!",
+ "stringMinLength": "O valor precisa ter pelo menos {0} caracteres!",
+ "stringMaxLength": "O valor precisa ter no máximo {0} caracteres!",
+ "numberInvalid": "Número inválido!",
+ "numberMin": "O número precisa ser pelo menos {0}!",
+ "numberMax": "O número precisa ser no máximo {0}!",
+ "numberDecimal": "Não é permitido que o número seja decimal!",
+ "numberNegative": "Não é permitido que o número seja negativo!",
+ "numberPositive": "Não é permitido que o número seja positivo!",
+ "numberZero": "Não é permitido que o número seja zero!",
+ "channelNotFound": "Não foi possível encontrar o canal!",
+ "userNotFound": "Não foi possível encontrar o usuário!",
+ "roleNotFound": "Não foi possível encontrar o cargo!",
+ "memberNotFound": "Não foi possível encontrar o usuário!",
+ "mentionableNotFound": "Não foi possível encontrar o usuário ou cargo!",
+ "channelType": "Tipo de canal inválido!",
+ "notInGuild": "Esta opção requer que você esteja em um servidor!"
+ },
+ "permissions": {
+ "developer": "Você precisa ser o desenvolvedor do bot.",
+ "owner": "Você precisa ser o dono do servidor.",
+ "admin": "Você precisa ser um administrador do servidor.",
+ "moderator": "Você precisa ser um moderador.",
+ "support": "Você precisa estar na equipe de suporte.",
+ "member": "Você precisa ser um membro.",
+ "discord-administrator": "Você precisa ter a permissão `ADMINISTRATOR`."
+ },
+ "actionInvalid":{
+ "close": "O ticket já está fechado!",
+ "reopen": "O ticket ainda não está fechado!",
+ "claim": "O ticket já está reivindicado!",
+ "unclaim": "O ticket ainda não está reivindicado!",
+ "pin": "O ticket já está fixado!",
+ "unpin": "O ticket ainda não está fixado!",
+ "add": "Este usuário já pode acessar o ticket!",
+ "remove": "Não foi possível remover este usuário do ticket!"
+ }
+ },
+ "params":{
+ "uppercase":{
+ "ticket":"Ticket",
+ "tickets":"Tickets",
+ "reason":"Motivo",
+ "creator":"Criador",
+ "remaining":"Tempo Restante",
+ "added":"Adicionado",
+ "removed":"Removido",
+ "filter":"Filtro",
+ "claimedBy":"Reivindicado por {0}",
+ "method":"Método",
+ "type":"Tipo",
+ "blacklisted":"Na Lista Negra",
+ "panel":"Painel",
+ "command":"Comando",
+ "system":"Sistema",
+ "true":"Verdadeiro",
+ "false":"Falso",
+ "syntax":"Sintaxe",
+ "originalName":"Nome Original",
+ "newName":"Novo Nome",
+ "until":"Até",
+ "validOptions":"Opções Válidas",
+ "validPanels":"Painéis Válidos",
+ "autoclose":"Auto-fechar",
+ "autodelete":"Auto-deletar",
+ "startupDate":"Data de Início",
+ "version":"Versão",
+ "name":"Nome",
+ "role":"Cargo",
+ "status":"Status",
+ "claimed":"Reivindicado",
+ "pinned":"Fixado",
+ "creationDate":"Data de Criação"
+ },
+ "lowercase":{
+ "text":"texto",
+ "html":"html",
+ "command":"comando",
+ "modal":"modal",
+ "button":"botão",
+ "dropdown":"dropdown",
+ "method":"método"
+ }
+ },
+ "commands":{
+ "reason": "Especifique um motivo opcional que será visível nos logs.",
+ "help": "Obtenha uma lista de todos os comandos disponíveis.",
+ "panel": "Gerar uma mensagem com um dropdown ou botões (para criação de tickets).",
+ "panelId": "O identificador do painel que você deseja gerar.",
+ "panelAutoUpdate": "Você quer que este painel atualize automaticamente quando editado?",
+ "ticket": "Crie um ticket instantaneamente.",
+ "ticketId": "O identificador do ticket que você deseja criar.",
+ "close": "Feche um ticket.",
+ "delete": "Exclua um ticket.",
+ "deleteNoTranscript": "Exclua este ticket sem criar uma transcrição.",
+ "reopen": "Reabra um ticket.",
+ "claim": "Assuma um ticket.",
+ "claimUser": "Assuma este ticket para outra pessoa em vez de você mesmo.",
+ "unclaim": "Desassuma um ticket.",
+ "pin": "Fixe um ticket.",
+ "unpin": "Desfixe um ticket.",
+ "move": "Mova um ticket.",
+ "moveId": "O identificador do opção para o qual você deseja mover.",
+ "rename": "Renomeie um ticket.",
+ "renameName": "O novo nome para este ticket.",
+ "add": "Adicione um usuário a um ticket.",
+ "addUser": "O usuário a ser adicionado.",
+ "remove": "Remover um usuário de um ticket.",
+ "removeUser": "O usuário a ser removido.",
+ "blacklist": "Gerenciar a lista negra de tickets.",
+ "blacklistView": "Ver uma lista da blacklist atual.",
+ "blacklistAdd": "Adicionar um usuário à blacklist.",
+ "blacklistRemove": "Remover um usuário da blacklist.",
+ "blacklistGet": "Obter os detalhes de um usuário na blacklist.",
+ "blacklistGetUser": "O usuário para obter detalhes.",
+ "stats": "Ver estatísticas do bot, de um membro ou de um ticket.",
+ "statsReset": "Redefinir todas as estatísticas do bot (e começar a contar do zero).",
+ "statsGlobal": "Ver as estatísticas globais.",
+ "statsUser": "Ver as estatísticas de um usuário no servidor.",
+ "statsUserUser": "O usuário para visualizar.",
+ "statsTicket": "Ver as estatísticas de um ticket no servidor.",
+ "statsTicketTicket": "O ticket para visualizar.",
+ "clear": "Excluir vários tickets ao mesmo tempo. Um filtro opcional pode ser especificado.",
+ "clearFilter": "O filtro para limpar tickets.",
+ "clearFilters": {
+ "all": "Todos",
+ "open": "Aberto",
+ "close": "Fechado",
+ "claim": "Reivindicado",
+ "unclaim": "Não Reivindicado",
+ "pin": "Fixado",
+ "unpin": "Desfixado",
+ "autoclose": "Fechado Automaticamente"
+ },
+ "autoclose": "Gerenciar fechamento automático em um ticket.",
+ "autocloseDisable": "Desabilitar fechamento automático neste ticket.",
+ "autocloseEnable": "Habilitar fechamento automático neste ticket.",
+ "autocloseEnableTime": "A quantidade de horas que este ticket precisa estar inativo para ser fechado.",
+ "autodelete": "Gerenciar exclusão automática em um ticket.",
+ "autodeleteDisable": "Desabilitar exclusão automática neste ticket.",
+ "autodeleteEnable": "Habilitar exclusão automática neste ticket.",
+ "autodeleteEnableTime": "A quantidade de dias que este ticket precisa estar inativo para ser excluído."
+ },
+ "helpMenu": {
+ "help": "Obtenha uma lista de todos os comandos disponíveis.",
+ "ticket": "Crie um ticket instantaneamente.",
+ "close": "Feche um ticket, isso desabilita a escrita neste canal.",
+ "delete": "Exclua um ticket, isso cria uma transcrição quando habilitado.",
+ "reopen": "Reabra um ticket, isso habilita a escrita neste canal novamente.",
+ "pin": "Fixe um ticket. Isso moverá o ticket para o topo e adicionará um emoji '📌' ao nome.",
+ "unpin": "Desfixe um ticket. O ticket permanecerá na sua posição, mas perderá o emoji '📌'.",
+ "move": "Mova um ticket. Isso mudará o tipo deste ticket.",
+ "rename": "Renomeie um ticket. Isso mudará o nome do canal deste ticket.",
+ "claim": "Assuma um ticket. Com isso, você pode informar à sua equipe que está lidando com este ticket.",
+ "unclaim": "Desassuma um ticket. Com isso, você pode informar à sua equipe que este ticket está livre novamente.",
+ "add": "Adicione um usuário a um ticket. Isso permitirá que o usuário leia e escreva neste ticket.",
+ "remove": "Remova um usuário de um ticket. Isso removerá a capacidade de ler e escrever para um usuário neste ticket.",
+ "panel": "Gere uma mensagem com um dropdown ou botões (para criação de tickets).",
+ "blacklistView": "Veja uma lista da blacklist atual.",
+ "blacklistAdd": "Adicione um usuário à blacklist.",
+ "blacklistRemove": "Remova um usuário da blacklist.",
+ "blacklistGet": "Obtenha os detalhes de um usuário na blacklist.",
+ "statsGlobal": "Veja as estatísticas globais.",
+ "statsTicket": "Veja as estatísticas de um ticket no servidor.",
+ "statsUser": "Veja as estatísticas de um usuário no servidor.",
+ "statsReset": "Redefina todas as estatísticas do bot (e comece a contar do zero).",
+ "autocloseDisable": "Desabilite o fechamento automático neste ticket.",
+ "autocloseEnable": "Habilite o fechamento automático neste ticket.",
+ "autodeleteDisable": "Desabilite a exclusão automática neste ticket.",
+ "autodeleteEnable": "Habilite a exclusão automática neste ticket."
+ },
+ "stats":{
+ "scopes": {
+ "global": "Status Global",
+ "system": "Status do Sistema",
+ "user": "Status do Usuário",
+ "ticket": "Status do Ticket",
+ "participants": "Participantes"
+ },
+ "properties":{
+ "ticketsCreated":"Tickets Criados",
+ "ticketsClosed":"Tickets Fechados",
+ "ticketsDeleted":"Tickets Deletados",
+ "ticketsReopened":"Tickets Re-Abertos",
+ "ticketsAutoclosed":"Tickets Auto Fechados",
+ "ticketsClaimed":"Tickets Claimados",
+ "ticketsPinned":"Tickets Fixados",
+ "ticketsMoved":"Tickets Movidos",
+ "usersBlacklisted":"Usuários na Blacklist",
+ "transcriptsCreated":"Transcrição Criada"
+ }
+ }
+}
\ No newline at end of file
diff --git a/plugins/example-plugin/config.json b/plugins/example-plugin/config.json
new file mode 100644
index 0000000..cf41d25
--- /dev/null
+++ b/plugins/example-plugin/config.json
@@ -0,0 +1,5 @@
+{
+ "testVariable1":true,
+ "testVariable2":123,
+ "testVariable3":"abc"
+}
\ No newline at end of file
diff --git a/plugins/example-plugin/index.ts b/plugins/example-plugin/index.ts
new file mode 100644
index 0000000..94f18a3
--- /dev/null
+++ b/plugins/example-plugin/index.ts
@@ -0,0 +1,44 @@
+import {api, openticket, utilities} from "../../src/index"
+import * as discord from "discord.js"
+
+/////////////////////////////////////////////
+//// This plugin is not enabled yet! ////
+//// Enable it in the plugin.json file! ////
+/////////////////////////////////////////////
+
+if (utilities.project != "openticket") throw new api.ODPluginError("This plugin only works in Open Ticket!")
+if (!utilities.isBeta) throw new api.ODPluginError("This plugin is made for the beta version of Open Ticket!")
+
+//Add Typescript autocomplete support for plugin data. (!!!OPTIONAL!!!)
+declare module "../../src/core/api/api.ts" {
+ export interface ODConfigManagerIds_Default {
+ "example-plugin:config":api.ODJsonConfig
+ }
+}
+
+//Let's register the example config. This way it's available for all plugins & systems.
+openticket.events.get("onConfigLoad").listen((configManager) => {
+ configManager.add(new api.ODJsonConfig("example-plugin:config","config.json","./plugins/example-plugin/"))
+ /*===== What did we do? =====
+ - "example-plugin:config" Is the ID of this config. You can use this id troughout the bot to access this config file. Even in other plugins.
+ - "config.json" Is the FILE of this config. It is just the filename.
+ - "./plugins/example-plugin/" Is the DIRECTORY of this config. By default it's "./config/", but we want to change it to point at the plugin directory.
+ */
+
+ //Let's also log it to the console to let us know it worked!
+ const ourConfig = configManager.get("example-plugin:config")
+ openticket.log("The example config loaded succesfully!","plugin",[
+ {key:"var-1",value:ourConfig.data.testVariable1},
+ {key:"var-2",value:ourConfig.data.testVariable2.toString()},
+ {key:"var-3",value:ourConfig.data.testVariable3.toString()}
+ ])
+})
+
+openticket.events.get("onTicketCreate").listen((creator) => {
+ //This is logged before the ticket is created (after the button is pressed)
+ openticket.log("Ticket is getting created...","plugin")
+})
+openticket.events.get("afterTicketCreated").listen((ticket,creator,channel) => {
+ //This is logged after the ticket is created
+ openticket.log("Ticket ready!","plugin")
+})
\ No newline at end of file
diff --git a/plugins/example-plugin/plugin.json b/plugins/example-plugin/plugin.json
new file mode 100644
index 0000000..76fd490
--- /dev/null
+++ b/plugins/example-plugin/plugin.json
@@ -0,0 +1,23 @@
+{
+ "name":"Example Plugin",
+ "id":"example-plugin",
+ "version":"1.0.0",
+ "startFile":"index.ts",
+
+ "enabled":false,
+ "priority":0,
+ "events":[],
+
+ "npmDependencies":["discord.js"],
+ "requiredPlugins":[],
+ "incompatiblePlugins":[],
+
+ "details":{
+ "author":"DJj123dj",
+ "shortDescription":"A simple template for an Open Ticket v4 plugin!",
+ "longDescription":"A simple example of an Open Ticket v4 plugin!",
+ "imageUrl":"",
+ "projectUrl":"",
+ "tags":["template","example","default"]
+ }
+}
\ No newline at end of file
diff --git a/src/actions/addTicketUser.ts b/src/actions/addTicketUser.ts
new file mode 100644
index 0000000..8081b91
--- /dev/null
+++ b/src/actions/addTicketUser.ts
@@ -0,0 +1,87 @@
+///////////////////////////////////////
+//TICKET ADD USER SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:add-ticket-user"))
+ openticket.actions.get("openticket:add-ticket-user").workers.add([
+ new api.ODWorker("openticket:add-ticket-user",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to add user to ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketUserAdd").emit([ticket,user,data,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:participants").value.push({type:"user",id:data.id})
+ ticket.get("openticket:participants").refreshDatabase()
+ ticket.get("openticket:busy").value = true
+
+ //update channel permissions
+ try{
+ await channel.permissionOverwrites.create(data,{
+ ViewChannel:true,
+ SendMessages:true,
+ AddReactions:true,
+ AttachFiles:true,
+ SendPolls:true,
+ ReadMessageHistory:true
+ })
+ }catch{
+ openticket.log("Failed to add channel permission overwrites on add-ticket-user","error")
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket user adding!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value,hidden:true}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:add-message").build(source,{guild,channel,user,ticket,reason,data})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketUserAdded").emit([ticket,user,data,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.adding.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"add",reason,additionalData:data}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.adding.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"add",reason,additionalData:data}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,data} = params
+
+ openticket.log(user.displayName+" added "+data.displayName+" to a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:add-ticket-user").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/claimTicket.ts b/src/actions/claimTicket.ts
new file mode 100644
index 0000000..e3b6aa5
--- /dev/null
+++ b/src/actions/claimTicket.ts
@@ -0,0 +1,276 @@
+///////////////////////////////////////
+//TICKET CLAIMING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:claim-ticket"))
+ openticket.actions.get("openticket:claim-ticket").workers.add([
+ new api.ODWorker("openticket:claim-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to claim ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketClaim").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:claimed").value = true
+ ticket.get("openticket:claimed-by").value = user.id
+ ticket.get("openticket:claimed-on").value = new Date().getTime()
+ ticket.get("openticket:busy").value = true
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-claimed",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-claimed",user.id,1,"increase")
+
+ //update category
+ const rawClaimCategory = ticket.option.get("openticket:channel-categories-claimed").value.find((c) => c.user == user.id)
+ const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
+ if (claimCategory){
+ try {
+ channel.setParent(claimCategory,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = "claimed"
+ ticket.get("openticket:category").value = claimCategory
+ }catch(e){
+ openticket.log("Unable to move ticket to 'claimed category'!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"categoryid",value:claimCategory}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket claiming!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:claim-message").build(source,{guild,channel,user,ticket,reason})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketClaimed").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.claiming.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"claim",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.claiming.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"claim",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" claimed a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:claim-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
+
+export const registerVerifyBars = async () => {
+ //CLAIM TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:claim-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:claim-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.claim
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:claim-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already claimed
+ if (ticket.get("openticket:claimed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.claim"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start claiming ticket
+ if (params.data == "reason"){
+ //claim with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:claim-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //claim without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:claim-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:claim-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //CLAIM TICKET UNCLAIM MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:claim-ticket-unclaim-message",openticket.builders.messages.getSafe("openticket:verifybar-unclaim-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:claim-ticket-unclaim-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.claim
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:claim-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already claimed
+ if (ticket.get("openticket:claimed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.claim"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start claiming ticket
+ if (params.data == "reason"){
+ //claim with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:claim-ticket-reason").build("unclaim-message",{guild,channel,user,ticket}))
+ }else{
+ //claim without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:claim-ticket").run("unclaim-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:claim-message").build("unclaim-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:claim-ticket-unclaim-message").failure.add([
+ new api.ODWorker("openticket:back-to-unclaim-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:unclaim-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/clearTickets.ts b/src/actions/clearTickets.ts
new file mode 100644
index 0000000..97ecbf4
--- /dev/null
+++ b/src/actions/clearTickets.ts
@@ -0,0 +1,45 @@
+///////////////////////////////////////
+//CLEAR TICKETS SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:clear-tickets"))
+ openticket.actions.get("openticket:clear-tickets").workers.add([
+ new api.ODWorker("openticket:clear-tickets",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,filter,list} = params
+
+ await openticket.events.get("onTicketsClear").emit([list,user,channel,filter])
+ const nameList: string[] = []
+ for (const ticket of list){
+ const ticketChannel = await openticket.tickets.getTicketChannel(ticket)
+ if (!ticketChannel) return
+ nameList.push("#"+ticketChannel.name)
+ await openticket.actions.get("openticket:delete-ticket").run("clear",{guild,channel:ticketChannel,user,ticket,reason:"Cleared Ticket",sendMessage:true,withoutTranscript:false})
+ }
+ instance.list = nameList
+ await openticket.events.get("afterTicketsCleared").emit([list,user,channel,filter])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,filter,list} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.deleting.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:clear-logs").build(source,{guild,channel,user,filter,list:instance.list ?? []}))
+ }
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,user,filter,list} = params
+ openticket.log(user.displayName+" cleared "+list.length+" tickets!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"method",value:source},
+ {key:"filter",value:filter}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/closeTicket.ts b/src/actions/closeTicket.ts
new file mode 100644
index 0000000..ded141e
--- /dev/null
+++ b/src/actions/closeTicket.ts
@@ -0,0 +1,328 @@
+///////////////////////////////////////
+//TICKET CLOSING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:close-ticket"))
+ openticket.actions.get("openticket:close-ticket").workers.add([
+ new api.ODWorker("openticket:close-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to close ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketClose").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:closed").value = true
+ if (source == "autoclose") ticket.get("openticket:autoclosed").value = true
+ ticket.get("openticket:open").value = false
+ ticket.get("openticket:closed-by").value = user.id
+ ticket.get("openticket:closed-on").value = new Date().getTime()
+ ticket.get("openticket:busy").value = true
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-closed",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-closed",user.id,1,"increase")
+
+ //update category
+ const closeCategory = ticket.option.get("openticket:channel-category-closed").value
+ if (closeCategory !== ""){
+ try {
+ channel.setParent(closeCategory,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = "closed"
+ ticket.get("openticket:category").value = closeCategory
+ }catch(e){
+ openticket.log("Unable to move ticket to 'closed category'!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"categoryid",value:closeCategory}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //update permissions (non-staff => readonly)
+ const permissions: discord.OverwriteResolvable[] = [{
+ type:discord.OverwriteType.Role,
+ id:guild.roles.everyone.id,
+ allow:[],
+ deny:["ViewChannel","SendMessages","ReadMessageHistory"]
+ }]
+ const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
+ const optionAdmins = ticket.option.get("openticket:admins").value
+ const readonlyAdmins = ticket.option.get("openticket:admins-readonly").value
+
+ globalAdmins.forEach((admin) => {
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ optionAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ readonlyAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ if (optionAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","ReadMessageHistory"],
+ deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
+ })
+ })
+ ticket.get("openticket:participants").value.forEach((participant) => {
+ //all participants that aren't roles/admins => readonly
+ if (participant.type == "user"){
+ permissions.push({
+ type:discord.OverwriteType.Member,
+ id:user.id,
+ allow:["ViewChannel","ReadMessageHistory"],
+ deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
+ })
+ }
+ })
+ channel.permissionOverwrites.set(permissions)
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket closing!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:close-message").build(source,{guild,channel,user,ticket,reason})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketClosed").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.closing.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"close",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.closing.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"close",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" closed a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:close-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
+
+export const registerVerifyBars = async () => {
+ //CLOSE TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:close-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:close-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.close
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:close-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already closed
+ if (ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start closing ticket
+ if (params.data == "reason"){
+ //close with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:close-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //close without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:close-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:close-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //CLOSE TICKET REOPEN MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:close-ticket-reopen-message",openticket.builders.messages.getSafe("openticket:verifybar-reopen-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:close-ticket-reopen-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.close
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:close-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already closed
+ if (ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start closing ticket
+ if (params.data == "reason"){
+ //close with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:close-ticket-reason").build("reopen-message",{guild,channel,user,ticket}))
+ }else{
+ //close without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:close-ticket").run("reopen-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:close-message").build("reopen-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:close-ticket-reopen-message").failure.add([
+ new api.ODWorker("openticket:back-to-reopen-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/createTicket.ts b/src/actions/createTicket.ts
new file mode 100644
index 0000000..8bd8c36
--- /dev/null
+++ b/src/actions/createTicket.ts
@@ -0,0 +1,229 @@
+///////////////////////////////////////
+//TICKET CREATION SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:create-ticket"))
+ openticket.actions.get("openticket:create-ticket").workers.add([
+ new api.ODWorker("openticket:create-ticket",3,async (instance,params,source,cancel) => {
+ const {guild,user,answers,option} = params
+
+ await openticket.events.get("onTicketCreate").emit([user])
+ await openticket.events.get("onTicketChannelCreation").emit([option,user])
+
+ //get channel properties
+ const channelPrefix = option.get("openticket:channel-prefix").value
+ const channelCategory = option.get("openticket:channel-category").value
+ const channelBackupCategory = option.get("openticket:channel-category-backup").value
+ const channelDescription = option.get("openticket:channel-description").value
+ const channelSuffix = openticket.options.suffix.getSuffixFromOption(option,user)
+ const channelName = channelPrefix+channelSuffix
+
+ //handle category
+ let category: string|null = null
+ let categoryMode: "backup"|"normal"|null = null
+ if (channelCategory != ""){
+ //category enabled
+ const normalCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelCategory)
+ if (!normalCategory){
+ //default category was not found
+ openticket.log("Ticket Creation Error: Unable to find category! #1","error",[
+ {key:"categoryid",value:channelCategory},
+ {key:"backup",value:"false"}
+ ])
+ }else{
+ //default category was found
+ if (normalCategory.children.cache.size >= 50 && channelBackupCategory != ""){
+ //use backup category
+ const backupCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelBackupCategory)
+ if (!backupCategory){
+ //default category was not found
+ openticket.log("Ticket Creation Error: Unable to find category! #2","error",[
+ {key:"categoryid",value:channelBackupCategory},
+ {key:"backup",value:"true"}
+ ])
+ }else{
+ category = backupCategory.id
+ categoryMode = "backup"
+ }
+ }else{
+ //use default category
+ category = normalCategory.id
+ categoryMode = "normal"
+ }
+ }
+ }
+
+ //handle permissions
+ const permissions: discord.OverwriteResolvable[] = [{
+ type:discord.OverwriteType.Role,
+ id:guild.roles.everyone.id,
+ allow:[],
+ deny:["ViewChannel","SendMessages","ReadMessageHistory"]
+ }]
+ const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
+ const optionAdmins = option.get("openticket:admins").value
+ const readonlyAdmins = option.get("openticket:admins-readonly").value
+
+ globalAdmins.forEach((admin) => {
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ optionAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ readonlyAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ if (optionAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","ReadMessageHistory"],
+ deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
+ })
+ })
+ permissions.push({
+ type:discord.OverwriteType.Member,
+ id:user.id,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory"],
+ deny:[]
+ })
+
+ //create channel
+ const channel = await guild.channels.create({
+ type:discord.ChannelType.GuildText,
+ name:channelName,
+ nsfw:false,
+ topic:channelDescription,
+ parent:category,
+ reason:"Ticket Created By "+user.displayName,
+ permissionOverwrites:permissions
+ })
+
+ await openticket.events.get("afterTicketChannelCreated").emit([option,channel,user])
+
+ //create participants
+ const participants: {type:"role"|"user",id:string}[] = []
+ permissions.forEach((permission,index) => {
+ if (index == 0) return //don't include @everyone
+ const type = (permission.type == discord.OverwriteType.Role) ? "role" : "user"
+ const id = permission.id as string
+ participants.push({type,id})
+ })
+
+ //create ticket
+ const ticket = new api.ODTicket(channel.id,option,[
+ new api.ODTicketData("openticket:busy",false),
+ new api.ODTicketData("openticket:ticket-message",null),
+ new api.ODTicketData("openticket:participants",participants),
+ new api.ODTicketData("openticket:channel-suffix",channelSuffix),
+
+ new api.ODTicketData("openticket:open",true),
+ new api.ODTicketData("openticket:opened-by",user.id),
+ new api.ODTicketData("openticket:opened-on",new Date().getTime()),
+ new api.ODTicketData("openticket:closed",false),
+ new api.ODTicketData("openticket:closed-by",null),
+ new api.ODTicketData("openticket:closed-on",null),
+ new api.ODTicketData("openticket:claimed",false),
+ new api.ODTicketData("openticket:claimed-by",null),
+ new api.ODTicketData("openticket:claimed-on",null),
+ new api.ODTicketData("openticket:pinned",false),
+ new api.ODTicketData("openticket:pinned-by",null),
+ new api.ODTicketData("openticket:pinned-on",null),
+ new api.ODTicketData("openticket:for-deletion",false),
+
+ new api.ODTicketData("openticket:category",category),
+ new api.ODTicketData("openticket:category-mode",categoryMode),
+
+ new api.ODTicketData("openticket:autoclose-enabled",option.get("openticket:autoclose-enable-hours").value),
+ new api.ODTicketData("openticket:autoclose-hours",(option.get("openticket:autoclose-enable-hours").value ? option.get("openticket:autoclose-hours").value : 0)),
+ new api.ODTicketData("openticket:autoclosed",false),
+ new api.ODTicketData("openticket:autodelete-enabled",option.get("openticket:autodelete-enable-days").value),
+ new api.ODTicketData("openticket:autodelete-days",(option.get("openticket:autodelete-enable-days").value ? option.get("openticket:autodelete-days").value : 0)),
+
+ new api.ODTicketData("openticket:answers",answers)
+ ])
+
+ //manage stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-created",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-created",user.id,1,"increase")
+
+ //manage bot permissions
+ await openticket.events.get("onTicketPermissionsCreated").emit([option,openticket.permissions,channel,user])
+ await (await import("../data/framework/permissionLoader.ts")).addTicketPermissions(ticket)
+ await openticket.events.get("afterTicketPermissionsCreated").emit([option,openticket.permissions,channel,user])
+
+ //export channel & ticket
+ instance.channel = channel
+ instance.ticket = ticket
+ openticket.tickets.add(ticket)
+ }),
+ new api.ODWorker("openticket:send-ticket-message",2,async (instance,params,source,cancel) => {
+ const {guild,user,answers,option} = params
+ const {ticket,channel} = instance
+
+ if (!ticket || !channel) return openticket.log("Ticket Creation Error: Unable to send ticket message. Previous worker failed!","error")
+
+ await openticket.events.get("onTicketMainMessageCreated").emit([ticket,channel,user])
+ //check if ticket message is enabled
+ if (!option.get("openticket:ticket-message-enabled").value) return
+ try {
+ const msg = await channel.send((await openticket.builders.messages.getSafe("openticket:ticket-message").build(source,{guild,channel,user,ticket})).message)
+
+ ticket.get("openticket:ticket-message").value = msg.id
+
+ //manage stats
+ openticket.stats.get("openticket:ticket").setStat("openticket:messages-sent",ticket.id.value,1,"increase")
+
+ await openticket.events.get("afterTicketMainMessageCreated").emit([ticket,msg,channel,user])
+ }catch(err){
+ process.emit("uncaughtException",err)
+ //something went wrong while sending the ticket message
+ channel.send((await openticket.builders.messages.getSafe("openticket:error").build("other",{guild,channel,user,error:"Ticket Message: Creation Error!\n=> Ticket Is Still Created Succesfully",layout:"advanced"})).message)
+ }
+ await openticket.events.get("afterTicketCreated").emit([ticket,user,channel])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,user,answers,option} = params
+ const {ticket,channel} = instance
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.creation.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-created-logs").build(source,{guild,channel,user,ticket}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.creation.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-created-dm").build(source,{guild,channel,user,ticket}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,user,answers,option} = params
+ const {ticket,channel} = instance
+
+ if (!ticket || !channel) return openticket.log("Ticket Creation Error: Unable to create logs. Previous worker failed!","error")
+
+ openticket.log(user.displayName+" created a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"method",value:source},
+ {key:"option",value:option.id.value}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/createTicketPermissions.ts b/src/actions/createTicketPermissions.ts
new file mode 100644
index 0000000..342cbb4
--- /dev/null
+++ b/src/actions/createTicketPermissions.ts
@@ -0,0 +1,106 @@
+///////////////////////////////////////
+//TICKET CREATION SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:create-ticket-permissions"))
+ openticket.actions.get("openticket:create-ticket-permissions").workers.add([
+ new api.ODWorker("openticket:check-blacklist",4,(instance,params,source,cancel) => {
+ if (!params.option.get("openticket:allow-blacklisted-users").value && openticket.blacklist.exists(params.user.id)){
+ instance.valid = false
+ instance.reason = "blacklist"
+ openticket.log(params.user.displayName+" tried to create a ticket but is blacklisted!","info",[
+ {key:"user",value:params.user.username},
+ {key:"userid",value:params.user.id,hidden:true},
+ {key:"option",value:params.option.id.value}
+ ])
+ return cancel()
+ }
+ }),
+ new api.ODWorker("openticket:check-cooldown",3,(instance,params,source,cancel) => {
+ const cooldown = openticket.cooldowns.get("openticket:option-cooldown_"+params.option.id.value)
+ if (cooldown && cooldown instanceof api.ODTimeoutCooldown && cooldown.use(params.user.id)){
+ instance.valid = false
+ instance.reason = "cooldown"
+ const remaining = cooldown.remaining(params.user.id) ?? 0
+ instance.cooldownUntil = new Date(new Date().getTime() + remaining)
+
+ openticket.log(params.user.displayName+" tried to create a ticket but is on cooldown!","info",[
+ {key:"user",value:params.user.username},
+ {key:"userid",value:params.user.id,hidden:true},
+ {key:"option",value:params.option.id.value},
+ {key:"remaining",value:(remaining/1000).toString()+"sec"}
+ ])
+ return cancel()
+ }
+ }),
+ new api.ODWorker("openticket:check-global-limits",2,(instance,params,source,cancel) => {
+ const generalConfig = openticket.configs.get("openticket:general")
+ if (!generalConfig.data.system.limits.enabled) return
+
+ const allTickets = openticket.tickets.getAll()
+ const globalTicketCount = allTickets.length
+ const userTickets = openticket.tickets.getFiltered((ticket) => ticket.exists("openticket:opened-by") && (ticket.get("openticket:opened-by").value == params.user.id))
+ const userTicketCount = userTickets.length
+
+ if (globalTicketCount >= generalConfig.data.system.limits.globalMaximum){
+ instance.valid = false
+ instance.reason = "global-limit"
+ openticket.log(params.user.displayName+" tried to create a ticket but reached the limit!","info",[
+ {key:"user",value:params.user.username},
+ {key:"userid",value:params.user.id,hidden:true},
+ {key:"option",value:params.option.id.value},
+ {key:"limit",value:"global"}
+ ])
+ return cancel()
+ }else if (userTicketCount >= generalConfig.data.system.limits.userMaximum){
+ instance.valid = false
+ instance.reason = "global-user-limit"
+ openticket.log(params.user.displayName+" tried to create a ticket, but reached the limit!","info",[
+ {key:"user",value:params.user.username},
+ {key:"userid",value:params.user.id,hidden:true},
+ {key:"option",value:params.option.id.value},
+ {key:"limit",value:"global-user"}
+ ])
+ return cancel()
+ }
+ }),
+ new api.ODWorker("openticket:check-option-limits",1,(instance,params,source,cancel) => {
+ if (!params.option.exists("openticket:limits-enabled") || !params.option.get("openticket:limits-enabled").value) return
+
+ const allTickets = openticket.tickets.getFiltered((ticket) => ticket.option.id.value == params.option.id.value)
+ const globalTicketCount = allTickets.length
+ const userTickets = openticket.tickets.getFiltered((ticket) => ticket.option.id.value == params.option.id.value && ticket.exists("openticket:opened-by") && (ticket.get("openticket:opened-by").value == params.user.id))
+ const userTicketCount = userTickets.length
+
+ if (globalTicketCount >= params.option.get("openticket:limits-maximum-global").value){
+ instance.valid = false
+ instance.reason = "option-limit"
+ openticket.log(params.user.displayName+" tried to create a ticket, but reached the limit!","info",[
+ {key:"user",value:params.user.username},
+ {key:"userid",value:params.user.id,hidden:true},
+ {key:"option",value:params.option.id.value},
+ {key:"limit",value:"option"}
+ ])
+ return cancel()
+ }else if (userTicketCount >= params.option.get("openticket:limits-maximum-user").value){
+ instance.valid = false
+ instance.reason = "option-user-limit"
+ openticket.log(params.user.displayName+" tried to create a ticket, but reached the limit!","info",[
+ {key:"user",value:params.user.username},
+ {key:"userid",value:params.user.id,hidden:true},
+ {key:"option",value:params.option.id.value},
+ {key:"limit",value:"option-user"}
+ ])
+ return cancel()
+ }
+ }),
+ new api.ODWorker("openticket:valid",0,(instance,params,source,cancel) => {
+ instance.valid = true
+ instance.reason = null
+ cancel()
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/createTranscript.ts b/src/actions/createTranscript.ts
new file mode 100644
index 0000000..e95dc29
--- /dev/null
+++ b/src/actions/createTranscript.ts
@@ -0,0 +1,164 @@
+///////////////////////////////////////
+//TRANSCRIPT CREATION SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const transcriptConfig = openticket.configs.get("openticket:transcripts")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:create-transcript"))
+ openticket.actions.get("openticket:create-transcript").workers.add([
+ new api.ODWorker("openticket:select-compiler",4,async (instance,params,source,cancel) => {
+ const {channel,user,ticket} = params
+ if (channel.type != discord.ChannelType.GuildText) return cancel()
+ if (!transcriptConfig.data.general.enabled) return cancel()
+
+ await openticket.events.get("onTranscriptCreate").emit([openticket.transcripts,ticket,channel,user])
+
+ instance.errorReason = null
+ const participants = await openticket.tickets.getAllTicketParticipants(params.ticket)
+ if (!participants){
+ instance.pendingMessage = null
+ instance.errorReason = "Unable to fetch ticket channel participants!"
+ throw new api.ODSystemError("ODAction(ot:create-transcript) => Unable to fetch ticket channel participants!")
+ }
+ instance.participants = participants
+
+ //select transcript compiler
+ if (transcriptConfig.data.general.mode == "text") instance.compiler = openticket.transcripts.get("openticket:text-compiler")
+ else if (transcriptConfig.data.general.mode == "html") instance.compiler = openticket.transcripts.get("openticket:html-compiler")
+ }),
+ new api.ODWorker("openticket:init-transcript",3,async (instance,params,source,cancel) => {
+ const {channel,user,ticket} = params
+ if (channel.type != discord.ChannelType.GuildText) return cancel()
+ if (!transcriptConfig.data.general.enabled) return cancel()
+
+ //run transcript compiler init()
+ await openticket.events.get("onTranscriptInit").emit([openticket.transcripts,ticket,channel,user])
+ if (instance.compiler.init){
+ try{
+ const result = await instance.compiler.init(ticket,channel,user)
+ if (result.success && result.pendingMessage && transcriptConfig.data.general.enableChannel){
+ //send init message to channel
+ const post = openticket.posts.get("openticket:transcripts")
+ if (post){
+ instance.pendingMessage = await post.send(result.pendingMessage)
+ }
+ }else if (!result.success){
+ instance.pendingMessage = null
+ instance.errorReason = result.errorReason
+ throw new api.ODSystemError("ODAction(ot:create-transcript) => Known Init Error => "+result.errorReason)
+ }else instance.pendingMessage = null
+ }catch(err){
+ instance.success = false
+ cancel()
+ process.emit("uncaughtException",err)
+ throw new api.ODSystemError("ODAction(ot:create-transcript) => Failed transcript compiler init()! (see error above)")
+ }
+ }
+ await openticket.events.get("afterTranscriptInitiated").emit([openticket.transcripts,ticket,channel,user])
+ }),
+ new api.ODWorker("openticket:compile-transcript",2,async (instance,params,source,cancel) => {
+ const {channel,user,ticket} = params
+ if (channel.type != discord.ChannelType.GuildText) return cancel()
+ if (!instance.compiler){
+ instance.success = false
+ cancel()
+ throw new api.ODSystemError("ODAction(ot:create-transcript):ODWorker(ot:compile-transcript) => Instance is missing transcript compiler!")
+ }
+
+ //run transcript compiler compile()
+ await openticket.events.get("onTranscriptCompile").emit([openticket.transcripts,ticket,channel,user])
+ if (instance.compiler.compile){
+ try{
+ const result = await instance.compiler.compile(ticket,channel,user)
+ if (!result.success){
+ instance.errorReason = result.errorReason
+ throw new api.ODSystemError("ODAction(ot:create-transcript) => Known Compiler Error => "+result.errorReason)
+ }else{
+ instance.result = result
+ instance.success = true
+ }
+ }catch(err){
+ instance.success = false
+ cancel()
+ process.emit("uncaughtException",err)
+ throw new api.ODSystemError("ODAction(ot:create-transcript) => Failed transcript compiler compile()! (see error above)")
+ }
+ }
+ await openticket.events.get("afterTranscriptCompiled").emit([openticket.transcripts,ticket,channel,user])
+ }),
+ new api.ODWorker("openticket:ready-transcript",1,async (instance,params,source,cancel) => {
+ if (!instance.result){
+ instance.success = false
+ cancel()
+ throw new api.ODSystemError("ODAction(ot:create-transcript):ODWorker(ot:ready-transcript) => Instance is missing transcript result!")
+ }
+
+ //run transcript compiler ready()
+ utilities.runAsync(async () => {
+ await openticket.events.get("onTranscriptReady").emit([openticket.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
+ if (instance.compiler.ready){
+ try{
+ const {channelMessage,creatorDmMessage,participantDmMessage,activeAdminDmMessage,everyAdminDmMessage} = await instance.compiler.ready(instance.result)
+
+ //send channel message
+ if (transcriptConfig.data.general.enableChannel && channelMessage){
+ if (instance.pendingMessage && instance.pendingMessage.message && instance.pendingMessage.success){
+ //edit "pending" message to be the "ready" message
+ instance.pendingMessage.message.edit(channelMessage.message)
+ }else{
+ //send ready message to channel
+ const post = openticket.posts.get("openticket:transcripts")
+ if (post) await post.send(channelMessage)
+ }
+ }
+
+ //send dm mesages
+ if (instance.participants){
+ for (const p of instance.participants){
+ if (p.role == "creator" && transcriptConfig.data.general.enableCreatorDM && creatorDmMessage){
+ //send creator dm message
+ await openticket.client.sendUserDm(p.user,creatorDmMessage)
+ }else if (p.role == "participant" && transcriptConfig.data.general.enableParticipantDM && participantDmMessage){
+ //send participant dm message
+ await openticket.client.sendUserDm(p.user,participantDmMessage)
+ }else if (p.role == "admin" && transcriptConfig.data.general.enableActiveAdminDM && instance.result.success && instance.result.messages && instance.result.messages.some((msg) => msg.author.id == p.user.id) && activeAdminDmMessage){
+ //send active admin dm message
+ await openticket.client.sendUserDm(p.user,activeAdminDmMessage)
+ }else if (p.role == "admin" && transcriptConfig.data.general.enableEveryAdminDM && everyAdminDmMessage){
+ //send every admin dm message
+ await openticket.client.sendUserDm(p.user,everyAdminDmMessage)
+ }
+ }
+ }
+
+ }catch(err){
+ instance.success = false
+ cancel()
+ process.emit("uncaughtException",err)
+ throw new api.ODSystemError("ODAction(ot:create-transcript) => Failed transcript compiler ready()! (see error above)")
+ }
+ }
+ await openticket.events.get("afterTranscriptReady").emit([openticket.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
+ })
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:transcripts-created",1,"increase")
+ await openticket.events.get("afterTranscriptCreated").emit([openticket.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {user,channel,ticket} = params
+ openticket.log(user.displayName+" created a transcript!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"option",value:ticket.option.id.value},
+ {key:"method",value:source,hidden:true},
+ {key:"compiler",value:instance.compiler.id.value},
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/deleteTicket.ts b/src/actions/deleteTicket.ts
new file mode 100644
index 0000000..6988b5e
--- /dev/null
+++ b/src/actions/deleteTicket.ts
@@ -0,0 +1,463 @@
+///////////////////////////////////////
+//TICKET DELETION SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:delete-ticket"))
+ openticket.actions.get("openticket:delete-ticket").workers.add([
+ new api.ODWorker("openticket:delete-ticket",3,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to delete ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketDelete").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:for-deletion").value = true
+ ticket.get("openticket:busy").value = true
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket deletion!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:delete-message").build(source,{guild,channel,user,ticket,reason})).message)
+
+ //create transcript
+ if (!params.withoutTranscript){
+ const transcriptRes = await openticket.actions.get("openticket:create-transcript").run(source,{guild,channel,user,ticket})
+ if (typeof transcriptRes.success == "boolean" && !transcriptRes.success && transcriptRes.compiler){
+ const {compiler} = transcriptRes
+ await channel.send((await openticket.builders.messages.getSafe("openticket:transcript-error").build(source,{guild,channel,user,ticket,compiler,reason:transcriptRes.errorReason ?? null})).message)
+
+ //undo deletion
+ ticket.get("openticket:for-deletion").value = false
+ ticket.get("openticket:busy").value = false
+ openticket.log("Canceled ticket deletion because of transcript system malfunction!","warning",[
+ {key:"compiler",value:compiler.id.value},
+ {key:"reason",value:transcriptRes.errorReason ?? "/"},
+ ])
+ return cancel()
+ }
+ }
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-deleted",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-deleted",user.id,1,"increase")
+
+ //delete ticket from manager
+ openticket.tickets.remove(ticket.id)
+
+ //delete permissions from manager
+ await (await import("../data/framework/permissionLoader.ts")).removeTicketPermissions(ticket)
+ }),
+ new api.ODWorker("openticket:discord-logs",2,async (instance,params,source,cancel) => {
+ //logs before channel deletion => channel might still be used in log embeds
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.deleting.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"delete",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.deleting.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"delete",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:delete-channel",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ //delete channel & events
+ await openticket.events.get("onTicketChannelDeletion").emit([ticket,channel,user])
+ await channel.delete("Ticket Deleted")
+ await openticket.events.get("afterTicketChannelDeleted").emit([ticket,user])
+
+ //delete permissions from manager
+ await (await import("../data/framework/permissionLoader.ts")).removeTicketPermissions(ticket)
+
+ await openticket.events.get("afterTicketDeleted").emit([ticket,user,reason])
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" deleted a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source},
+ {key:"transcript",value:(!params.withoutTranscript).toString()},
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:delete-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ params.ticket.get("openticket:for-deletion").value = false
+ })
+}
+
+export const registerVerifyBars = async () => {
+ //DELETE TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:delete-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start deleting ticket
+ if (params.data == "reason"){
+ //delete with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //delete without reason
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true,withoutTranscript:(params.data == "no-transcript")})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:delete-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //DELETE TICKET CLOSE MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-close-message",openticket.builders.messages.getSafe("openticket:verifybar-close-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:delete-ticket-close-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start deleting ticket
+ if (params.data == "reason"){
+ //delete with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("close-message",{guild,channel,user,ticket}))
+ }else{
+ //delete without reason
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run("close-message",{guild,channel,user,ticket,reason:null,sendMessage:false,withoutTranscript:(params.data == "no-transcript")})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("close-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:delete-ticket-close-message").failure.add([
+ new api.ODWorker("openticket:back-to-close-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:close-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+
+ //DELETE TICKET REOPEN MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-reopen-message",openticket.builders.messages.getSafe("openticket:verifybar-reopen-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:delete-ticket-reopen-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start deleting ticket
+ if (params.data == "reason"){
+ //delete with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("reopen-message",{guild,channel,user,ticket}))
+ }else{
+ //delete without reason
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run("reopen-message",{guild,channel,user,ticket,reason:null,sendMessage:false,withoutTranscript:(params.data == "no-transcript")})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("reopen-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:delete-ticket-reopen-message").failure.add([
+ new api.ODWorker("openticket:back-to-reopen-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+
+ //DELETE TICKET AUTOCLOSE MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-autoclose-message",openticket.builders.messages.getSafe("openticket:verifybar-autoclose-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:delete-ticket-autoclose-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start deleting ticket
+ if (params.data == "reason"){
+ //delete with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("autoclose-message",{guild,channel,user,ticket}))
+ }else{
+ //delete without reason
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run("autoclose-message",{guild,channel,user,ticket,reason:null,sendMessage:false,withoutTranscript:(params.data == "no-transcript")})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("autoclose-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:delete-ticket-autoclose-message").failure.add([
+ new api.ODWorker("openticket:back-to-autoclose-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:autoclose-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/handleTranscriptErrors.ts b/src/actions/handleTranscriptErrors.ts
new file mode 100644
index 0000000..e15eae6
--- /dev/null
+++ b/src/actions/handleTranscriptErrors.ts
@@ -0,0 +1,164 @@
+///////////////////////////////////////
+//TRANSCRIPT ERROR SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerButtonResponders = async () => {
+ //TRANSCRIPT ERROR RETRY
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:transcript-error-retry",/^od:transcript-error-retry_([^_]+)/))
+ openticket.responders.buttons.get("openticket:transcript-error-retry").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "slash" && originalSource != "text" && originalSource != "ticket-message" && originalSource != "reopen-message" && originalSource != "close-message" && originalSource != "other") return
+
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start deleting ticket (without reason)
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason:"Transcript Error (Retried)",sendMessage:false,withoutTranscript:false})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason:"Transcript Error (Retried)"}))
+
+ }),
+ new api.ODWorker("openticket:logs",-1,async (instance,params,source,cancel) => {
+ const {user,channel} = instance
+ if (channel.isDMBased()) return
+ openticket.log(user.displayName+" retried deleting a ticket with transcript!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+
+ //TRANSCRIPT ERROR CONTINUE
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:transcript-error-continue",/^od:transcript-error-continue_([^_]+)/))
+ openticket.responders.buttons.get("openticket:transcript-error-continue").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "slash" && originalSource != "text" && originalSource != "ticket-message" && originalSource != "reopen-message" && originalSource != "close-message" && originalSource != "other") return
+
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start deleting ticket (without reason)
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason:"Transcript Error (Continued)",sendMessage:false,withoutTranscript:true})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason:"Transcript Error (Continued)"}))
+
+ }),
+ new api.ODWorker("openticket:logs",-1,async (instance,params,source,cancel) => {
+ const {user,channel} = instance
+ if (channel.isDMBased()) return
+ openticket.log(user.displayName+" continued deleting a ticket without transcript!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/handleVerifyBar.ts b/src/actions/handleVerifyBar.ts
new file mode 100644
index 0000000..4154a4b
--- /dev/null
+++ b/src/actions/handleVerifyBar.ts
@@ -0,0 +1,32 @@
+///////////////////////////////////////
+//VERIFYBAR SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+
+export const registerButtonResponders = async () => {
+ //VERIFYBAR SUCCESS
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:verifybar-success",/^od:verifybar-success_([^_]+)/))
+ openticket.responders.buttons.get("openticket:verifybar-success").workers.add(
+ new api.ODWorker("openticket:handle-verifybar",0,async (instance,params,source,cancel) => {
+ const id = instance.interaction.customId.split("_")[1]
+ const customData = instance.interaction.customId.split("_")[2] as string|undefined
+
+ const verifybar = openticket.verifybars.get(id)
+ if (!verifybar) return
+ if (verifybar.success) await verifybar.success.executeWorkers(instance,"verifybar",{data:customData ?? null,verifybarMessage:instance.message})
+ })
+ )
+
+ //VERIFYBAR FAILURE
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:verifybar-failure",/^od:verifybar-failure_([^_]+)/))
+ openticket.responders.buttons.get("openticket:verifybar-failure").workers.add(
+ new api.ODWorker("openticket:handle-verifybar",0,async (instance,params,source,cancel) => {
+ const id = instance.interaction.customId.split("_")[1]
+ const customData = instance.interaction.customId.split("_")[2] as string|undefined
+
+ const verifybar = openticket.verifybars.get(id)
+ if (!verifybar) return
+ if (verifybar.failure) await verifybar.failure.executeWorkers(instance,"verifybar",{data:customData ?? null,verifybarMessage:instance.message})
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/actions/moveTicket.ts b/src/actions/moveTicket.ts
new file mode 100644
index 0000000..7d95b82
--- /dev/null
+++ b/src/actions/moveTicket.ts
@@ -0,0 +1,220 @@
+///////////////////////////////////////
+//TICKET MOVING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:move-ticket"))
+ openticket.actions.get("openticket:move-ticket").workers.add([
+ new api.ODWorker("openticket:move-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to move ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketMove").emit([ticket,user,channel,reason])
+ ticket.option = data
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-moved",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-moved",user.id,1,"increase")
+
+ //get new channel properties
+ const channelPrefix = ticket.option.get("openticket:channel-prefix").value
+ const channelSuffix = ticket.get("openticket:channel-suffix").value
+ const channelCategory = ticket.option.get("openticket:channel-category").value
+ const channelBackupCategory = ticket.option.get("openticket:channel-category-backup").value
+ const rawClaimCategory = ticket.option.get("openticket:channel-categories-claimed").value.find((c) => c.user == user.id)
+ const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
+ const closeCategory = ticket.option.get("openticket:channel-category-closed").value
+ const channelDescription = ticket.option.get("openticket:channel-description").value
+ const channelName = channelPrefix+channelSuffix
+
+ //handle category
+ let category: string|null = null
+ let categoryMode: "backup"|"normal"|"closed"|"claimed"|null = null
+ if (claimCategory){
+ //use claim category
+ category = claimCategory
+ categoryMode = "claimed"
+ }else if (closeCategory != "" && ticket.get("openticket:closed").value){
+ //use close category
+ category = closeCategory
+ categoryMode = "closed"
+ }else if (channelCategory != ""){
+ //category enabled
+ const normalCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelCategory)
+ if (!normalCategory){
+ //default category was not found
+ openticket.log("Ticket Move Error: Unable to find category! #1","error",[
+ {key:"categoryid",value:channelCategory},
+ {key:"backup",value:"false"}
+ ])
+ }else{
+ //default category was found
+ if (normalCategory.children.cache.size >= 50 && channelBackupCategory != ""){
+ //use backup category
+ const backupCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelBackupCategory)
+ if (!backupCategory){
+ //default category was not found
+ openticket.log("Ticket Move Error: Unable to find category! #2","error",[
+ {key:"categoryid",value:channelBackupCategory},
+ {key:"backup",value:"true"}
+ ])
+ }else{
+ category = backupCategory.id
+ categoryMode = "backup"
+ }
+ }else{
+ //use default category
+ category = normalCategory.id
+ categoryMode = "normal"
+ }
+ }
+ }
+
+ try {
+ //only move category when not the same.
+ if (channel.parentId != category) await utilities.timedAwait(channel.setParent(category,{lockPermissions:false}),2500,(err) => {
+ openticket.log("Failed to change channel category on ticket move","error")
+ })
+ ticket.get("openticket:category-mode").value = categoryMode
+ ticket.get("openticket:category").value = category
+ }catch(e){
+ openticket.log("Unable to move ticket to 'moved category'!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"categoryid",value:category ?? "/"}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+
+ //handle permissions
+ const permissions: discord.OverwriteResolvable[] = [{
+ type:discord.OverwriteType.Role,
+ id:guild.roles.everyone.id,
+ allow:[],
+ deny:["ViewChannel","SendMessages","ReadMessageHistory"]
+ }]
+ const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
+ const optionAdmins = ticket.option.get("openticket:admins").value
+ const readonlyAdmins = ticket.option.get("openticket:admins-readonly").value
+
+ globalAdmins.forEach((admin) => {
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ optionAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ readonlyAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ if (optionAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","ReadMessageHistory"],
+ deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
+ })
+ })
+ //transfer all old user-participants over to the new ticket (creator & participants)
+ ticket.get("openticket:participants").value.forEach((p) => {
+ if (p.type == "user") permissions.push({
+ type:discord.OverwriteType.Member,
+ id:p.id,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory"],
+ deny:[]
+ })
+ })
+ try{
+ await channel.permissionOverwrites.set(permissions)
+ }catch{
+ openticket.log("Failed to reset channel permissions on ticket move!","error")
+ }
+
+ //handle participants
+ const participants: {type:"role"|"user",id:string}[] = []
+ permissions.forEach((permission,index) => {
+ if (index == 0) return //don't include @everyone
+ const type = (permission.type == discord.OverwriteType.Role) ? "role" : "user"
+ const id = permission.id as string
+ participants.push({type,id})
+ })
+ ticket.get("openticket:participants").value = participants
+ ticket.get("openticket:participants").refreshDatabase()
+
+ //rename channel (and give error when crashed)
+ const originalName = channel.name
+ try{
+ await utilities.timedAwait(channel.setName(channelName),2500,(err) => {
+ openticket.log("Failed to rename channel on ticket move","error")
+ })
+ }catch(err){
+ await channel.send((await openticket.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-move",{guild,channel,user,originalName,newName:channelName})).message)
+ }
+ try{
+ if (channel.type == discord.ChannelType.GuildText) channel.setTopic(channelDescription)
+ }catch{}
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket renaming!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:move-message").build(source,{guild,channel,user,ticket,reason,data})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketMoved").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.moving.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"move",reason,additionalData:data}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.moving.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"move",reason,additionalData:data}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" moved a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:move-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/pinTicket.ts b/src/actions/pinTicket.ts
new file mode 100644
index 0000000..3f06af4
--- /dev/null
+++ b/src/actions/pinTicket.ts
@@ -0,0 +1,274 @@
+///////////////////////////////////////
+//TICKET PINNING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:pin-ticket"))
+ openticket.actions.get("openticket:pin-ticket").workers.add([
+ new api.ODWorker("openticket:pin-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to pin ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketPin").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:pinned").value = true
+ ticket.get("openticket:pinned-by").value = user.id
+ ticket.get("openticket:pinned-on").value = new Date().getTime()
+ ticket.get("openticket:busy").value = true
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-pinned",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-pinned",user.id,1,"increase")
+
+ //move to top of category
+ if (channel.parent){
+ await channel.setPosition(0,{reason:"Ticket Pinned!"})
+ }
+
+ //rename channel (and give error when crashed)
+ const originalName = channel.name
+ const newName = "📌"+channel.name
+ try{
+ await utilities.timedAwait(channel.setName(newName),2500,(err) => {
+ openticket.log("Failed to rename channel on ticket pin","error")
+ })
+ }catch(err){
+ await channel.send((await openticket.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-pin",{guild,channel,user,originalName,newName})).message)
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket pinning!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"message",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:pin-message").build(source,{guild,channel,user,ticket,reason})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketPinned").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.pinning.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.pinning.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" pinned a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerVerifyBars = async () => {
+ //PIN TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:pin-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:pin-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.pin
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already pinned
+ if (ticket.get("openticket:pinned").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start pinning ticket
+ if (params.data == "reason"){
+ //pin with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:pin-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //pin without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:pin-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:pin-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //PIN TICKET UNPIN MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:pin-ticket-unpin-message",openticket.builders.messages.getSafe("openticket:verifybar-unpin-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:pin-ticket-unpin-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.pin
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already pinned
+ if (ticket.get("openticket:pinned").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start pinning ticket
+ if (params.data == "reason"){
+ //pin with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:pin-ticket-reason").build("unpin-message",{guild,channel,user,ticket}))
+ }else{
+ //pin without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:pin-ticket").run("unpin-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:pin-message").build("unpin-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:pin-ticket-unpin-message").failure.add([
+ new api.ODWorker("openticket:back-to-unpin-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:unpin-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+ openticket.actions.get("openticket:pin-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/reactionRole.ts b/src/actions/reactionRole.ts
new file mode 100644
index 0000000..884a2cd
--- /dev/null
+++ b/src/actions/reactionRole.ts
@@ -0,0 +1,94 @@
+///////////////////////////////////////
+//REACTION ROLE SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:reaction-role"))
+ openticket.actions.get("openticket:reaction-role").workers.add([
+ new api.ODWorker("openticket:reaction-role",2,async (instance,params,source,cancel) => {
+ const {guild,user,option,overwriteMode} = params
+ const role = openticket.roles.get(option.id)
+ if (!role) throw new api.ODSystemError("ODAction(ot:reaction-role) => Unknown reaction role (ODRole)")
+ instance.role = role
+ const mode = (overwriteMode) ? overwriteMode : role.get("openticket:mode").value
+
+ await openticket.events.get("onRoleUpdate").emit([user,role])
+
+ //get guild member
+ const member = await openticket.client.fetchGuildMember(guild,user.id)
+ if (!member) throw new api.ODSystemError("ODAction(ot:reaction-role) => User isn't a member of the server!")
+
+ //get all roles
+ const roleIds = role.get("openticket:roles").value
+ const roles: discord.Role[] = []
+ for (const id of roleIds){
+ const r = await openticket.client.fetchGuildRole(guild,id)
+ if (r) roles.push(r)
+ else openticket.log("Unable to find role in server!","warning",[
+ {key:"roleid",value:id}
+ ])
+ }
+
+ //update roles of user
+ const result: api.OTRoleUpdateResult[] = []
+ for (const r of roles){
+ try{
+ if (r.members.has(user.id) && (mode == "add&remove" || mode == "remove")){
+ //user has role (remove)
+ await member.roles.remove(r)
+ result.push({role:r,action:"removed"})
+ }else if (!r.members.has(user.id) && (mode == "add&remove" || mode == "add")){
+ //user doesn't have role (add)
+ await member.roles.add(r)
+ result.push({role:r,action:"added"})
+ }else{
+ //don't do anything
+ result.push({role:r,action:null})
+ }
+ }catch{
+ result.push({role:r,action:null})
+ }
+ }
+
+ //get roles to remove on add
+ if (result.find((r) => r.action == "added")){
+ //get all remove roles
+ const removeRoleIds = role.get("openticket:remove-roles-on-add").value
+ const removeRoles: discord.Role[] = []
+ for (const id of removeRoleIds){
+ const r = await openticket.client.fetchGuildRole(guild,id)
+ if (r) removeRoles.push(r)
+ else openticket.log("Unable to find role in server!","warning",[
+ {key:"roleid",value:id}
+ ])
+ }
+
+ //remove roles from user
+ for (const r of removeRoles){
+ try{
+ if (r.members.has(user.id)){
+ //user has role (remove)
+ await member.roles.remove(r)
+ result.push({role:r,action:"removed"})
+ }
+ }catch{}
+ }
+ }
+
+ //update instance & finish event
+ instance.result = result
+ await openticket.events.get("afterRolesUpdated").emit([user,role])
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,user,option} = params
+ openticket.log(user.displayName+" updated his roles!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"method",value:source},
+ {key:"option",value:option.id.value}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/actions/removeTicketUser.ts b/src/actions/removeTicketUser.ts
new file mode 100644
index 0000000..b22b62b
--- /dev/null
+++ b/src/actions/removeTicketUser.ts
@@ -0,0 +1,81 @@
+///////////////////////////////////////
+//TICKET REMOVE USER SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:remove-ticket-user"))
+ openticket.actions.get("openticket:remove-ticket-user").workers.add([
+ new api.ODWorker("openticket:remove-ticket-user",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to remove user from ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketUserRemove").emit([ticket,user,data,channel,reason])
+
+ //update ticket
+ const index = ticket.get("openticket:participants").value.findIndex((p) => p.type == "user" && p.id == data.id)
+ if (index < 0) return cancel()
+ ticket.get("openticket:participants").value.splice(index,1)
+ ticket.get("openticket:participants").refreshDatabase()
+ ticket.get("openticket:busy").value = true
+
+ //update channel permissions
+ try{
+ await channel.permissionOverwrites.delete(data)
+ }catch{
+ openticket.log("Failed to remove channel permission overwrites on remove-ticket-user","error")
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket user removal!","error",[
+ {key:"channel",value:channel.id},
+ {key:"message",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:remove-message").build(source,{guild,channel,user,ticket,reason,data})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketUserRemoved").emit([ticket,user,data,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.removing.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"remove",reason,additionalData:data}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.removing.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"remove",reason,additionalData:data}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,data} = params
+
+ openticket.log(user.displayName+" removed "+data.displayName+" from a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:remove-ticket-user").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/renameTicket.ts b/src/actions/renameTicket.ts
new file mode 100644
index 0000000..312be72
--- /dev/null
+++ b/src/actions/renameTicket.ts
@@ -0,0 +1,78 @@
+///////////////////////////////////////
+//TICKET RENAMING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:rename-ticket"))
+ openticket.actions.get("openticket:rename-ticket").workers.add([
+ new api.ODWorker("openticket:rename-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to rename ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketRename").emit([ticket,user,channel,reason])
+
+ //rename channel (and give error when crashed)
+ const originalName = channel.name
+ try{
+ await utilities.timedAwait(channel.setName(data),2500,(err) => {
+ openticket.log("Failed to rename channel on ticket rename","error")
+ })
+ }catch(err){
+ await channel.send((await openticket.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-rename",{guild,channel,user,originalName,newName:data})).message)
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket renaming!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:rename-message").build(source,{guild,channel,user,ticket,reason,data})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketRenamed").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason,data} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.renaming.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"rename",reason,additionalData:data}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.renaming.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"rename",reason,additionalData:data}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" renamed a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+ openticket.actions.get("openticket:rename-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/reopenTicket.ts b/src/actions/reopenTicket.ts
new file mode 100644
index 0000000..77bd5ab
--- /dev/null
+++ b/src/actions/reopenTicket.ts
@@ -0,0 +1,448 @@
+///////////////////////////////////////
+//TICKET REOPENING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:reopen-ticket"))
+ openticket.actions.get("openticket:reopen-ticket").workers.add([
+ new api.ODWorker("openticket:reopen-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to reopen ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketReopen").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:closed").value = false
+ ticket.get("openticket:open").value = true
+ ticket.get("openticket:autoclosed").value = false
+ ticket.get("openticket:closed-by").value = null
+ ticket.get("openticket:closed-on").value = null
+ ticket.get("openticket:busy").value = true
+
+ //update stats
+ openticket.stats.get("openticket:global").setStat("openticket:tickets-reopened",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:tickets-reopened",user.id,1,"increase")
+
+ //update category
+ const channelCategory = ticket.option.get("openticket:channel-category").value
+ const channelBackupCategory = ticket.option.get("openticket:channel-category-backup").value
+ if (channelCategory !== ""){
+ //category enabled
+ try {
+ const normalCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelCategory)
+ if (!normalCategory){
+ //default category was not found
+ openticket.log("Ticket Reopening Error: Unable to find category! #1","error",[
+ {key:"categoryid",value:channelCategory},
+ {key:"backup",value:"false"}
+ ])
+ }else{
+ //default category was found
+ if (normalCategory.children.cache.size >= 49 && channelBackupCategory != ""){
+ //use backup category
+ const backupCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelBackupCategory)
+ if (!backupCategory){
+ //default category was not found
+ openticket.log("Ticket Reopening Error: Unable to find category! #2","error",[
+ {key:"categoryid",value:channelBackupCategory},
+ {key:"backup",value:"true"}
+ ])
+ }else{
+ //use backup category
+ channel.setParent(backupCategory,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = "backup"
+ ticket.get("openticket:category").value = backupCategory.id
+ }
+ }else{
+ //use default category
+ channel.setParent(normalCategory,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = "normal"
+ ticket.get("openticket:category").value = normalCategory.id
+ }
+ }
+ }catch(e){
+ openticket.log("Unable to move ticket to 'reopened category'!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }else{
+ channel.setParent(null,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = null
+ ticket.get("openticket:category").value = null
+ }
+
+ //update permissions
+ const permissions: discord.OverwriteResolvable[] = [{
+ type:discord.OverwriteType.Role,
+ id:guild.roles.everyone.id,
+ allow:[],
+ deny:["ViewChannel","SendMessages","ReadMessageHistory"]
+ }]
+ const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
+ const optionAdmins = ticket.option.get("openticket:admins").value
+ const readonlyAdmins = ticket.option.get("openticket:admins-readonly").value
+
+ globalAdmins.forEach((admin) => {
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ optionAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
+ deny:[]
+ })
+ })
+ readonlyAdmins.forEach((admin) => {
+ if (globalAdmins.includes(admin)) return
+ if (optionAdmins.includes(admin)) return
+ permissions.push({
+ type:discord.OverwriteType.Role,
+ id:admin,
+ allow:["ViewChannel","ReadMessageHistory"],
+ deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
+ })
+ })
+ ticket.get("openticket:participants").value.forEach((participant) => {
+ //all participants that aren't roles/admins
+ if (participant.type == "user"){
+ permissions.push({
+ type:discord.OverwriteType.Member,
+ id:user.id,
+ allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory"],
+ deny:[]
+ })
+ }
+ })
+ channel.permissionOverwrites.set(permissions)
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket reopening!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:reopen-message").build(source,{guild,channel,user,ticket,reason})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketReopened").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.reopening.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"reopen",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.reopening.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"reopen",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" reopened a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerVerifyBars = async () => {
+ //REOPEN TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:reopen-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:reopen-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.reopen
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:reopen-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not closed
+ if (!ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.reopen"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start reopening ticket
+ if (params.data == "reason"){
+ //reopen with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:reopen-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //reopen without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:reopen-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //REOPEN TICKET CLOSE MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:reopen-ticket-close-message",openticket.builders.messages.getSafe("openticket:verifybar-close-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:reopen-ticket-close-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.reopen
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:reopen-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not closed
+ if (!ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.reopen"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start reopening ticket
+ if (params.data == "reason"){
+ //reopen with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:reopen-ticket-reason").build("close-message",{guild,channel,user,ticket}))
+ }else{
+ //reopen without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run("close-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("close-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:reopen-ticket-close-message").failure.add([
+ new api.ODWorker("openticket:back-to-close-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:close-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+
+ //REOPEN TICKET AUTOCLOSE MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:reopen-ticket-autoclose-message",openticket.builders.messages.getSafe("openticket:verifybar-autoclose-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:reopen-ticket-autoclose-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.reopen
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:reopen-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not closed
+ if (!ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.reopen"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start reopening ticket
+ if (params.data == "reason"){
+ //reopen with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:reopen-ticket-reason").build("autoclose-message",{guild,channel,user,ticket}))
+ }else{
+ //reopen without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run("autoclose-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("autoclose-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:reopen-ticket-autoclose-message").failure.add([
+ new api.ODWorker("openticket:back-to-autoclose-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:autoclose-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+ openticket.actions.get("openticket:reopen-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/unclaimTicket.ts b/src/actions/unclaimTicket.ts
new file mode 100644
index 0000000..302fb3a
--- /dev/null
+++ b/src/actions/unclaimTicket.ts
@@ -0,0 +1,305 @@
+///////////////////////////////////////
+//TICKET UNCLAIMING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:unclaim-ticket"))
+ openticket.actions.get("openticket:unclaim-ticket").workers.add([
+ new api.ODWorker("openticket:unclaim-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to unclaim ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketUnclaim").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:claimed").value = false
+ ticket.get("openticket:claimed-by").value = null
+ ticket.get("openticket:claimed-on").value = null
+ ticket.get("openticket:busy").value = true
+
+ //update category
+ const channelCategory = ticket.option.get("openticket:channel-category").value
+ const channelBackupCategory = ticket.option.get("openticket:channel-category-backup").value
+ if (channelCategory !== ""){
+ //category enabled
+ try {
+ const normalCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelCategory)
+ if (!normalCategory){
+ //default category was not found
+ openticket.log("Ticket Unclaiming Error: Unable to find category! #1","error",[
+ {key:"categoryid",value:channelCategory},
+ {key:"backup",value:"false"}
+ ])
+ }else{
+ //default category was found
+ if (normalCategory.children.cache.size >= 49 && channelBackupCategory != ""){
+ //use backup category
+ const backupCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelBackupCategory)
+ if (!backupCategory){
+ //default category was not found
+ openticket.log("Ticket Unclaiming Error: Unable to find category! #2","error",[
+ {key:"categoryid",value:channelBackupCategory},
+ {key:"backup",value:"true"}
+ ])
+ }else{
+ //use backup category
+ channel.setParent(backupCategory,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = "backup"
+ ticket.get("openticket:category").value = backupCategory.id
+ }
+ }else{
+ //use default category
+ channel.setParent(normalCategory,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = "normal"
+ ticket.get("openticket:category").value = normalCategory.id
+ }
+ }
+
+ }catch(e){
+ openticket.log("Unable to move ticket to 'unclaimed category'!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }else{
+ channel.setParent(null,{lockPermissions:false})
+ ticket.get("openticket:category-mode").value = null
+ ticket.get("openticket:category").value = null
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket unclaiming!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:unclaim-message").build(source,{guild,channel,user,ticket,reason})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketUnclaimed").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.claiming.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"unclaim",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.claiming.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"unclaim",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" unclaimed a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerVerifyBars = async () => {
+ //UNCLAIM TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:unclaim-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:unclaim-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.unclaim
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:unclaim-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not claimed
+ if (!ticket.get("openticket:claimed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.unclaim"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start unclaiming ticket
+ if (params.data == "reason"){
+ //unclaim with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:unclaim-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //unclaim without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unclaim-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:unclaim-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //UNCLAIM TICKET CLAIM MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:unclaim-ticket-claim-message",openticket.builders.messages.getSafe("openticket:verifybar-claim-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:unclaim-ticket-claim-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.unclaim
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:unclaim-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not claimed
+ if (!ticket.get("openticket:claimed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.unclaim"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start unclaiming ticket
+ if (params.data == "reason"){
+ //unclaim with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:unclaim-ticket-reason").build("claim-message",{guild,channel,user,ticket}))
+ }else{
+ //unclaim without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unclaim-ticket").run("claim-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:unclaim-message").build("claim-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:unclaim-ticket-claim-message").failure.add([
+ new api.ODWorker("openticket:back-to-claim-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:claim-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+ openticket.actions.get("openticket:unclaim-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/actions/unpinTicket.ts b/src/actions/unpinTicket.ts
new file mode 100644
index 0000000..e624c65
--- /dev/null
+++ b/src/actions/unpinTicket.ts
@@ -0,0 +1,267 @@
+///////////////////////////////////////
+//TICKET UNPINNING SYSTEM
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerActions = async () => {
+ openticket.actions.add(new api.ODAction("openticket:unpin-ticket"))
+ openticket.actions.get("openticket:unpin-ticket").workers.add([
+ new api.ODWorker("openticket:unpin-ticket",2,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+ if (channel.isThread()) throw new api.ODSystemError("Unable to unpin ticket! Open Ticket doesn't support threads!")
+
+ await openticket.events.get("onTicketUnpin").emit([ticket,user,channel,reason])
+
+ //update ticket
+ ticket.get("openticket:pinned").value = false
+ ticket.get("openticket:pinned-by").value = null
+ ticket.get("openticket:pinned-on").value = null
+ ticket.get("openticket:busy").value = true
+
+ //rename channel (and give error when crashed)
+ const originalName = channel.name
+ if (originalName.startsWith("📌")){
+ const newName = originalName.replace("📌","");
+ try{
+ await utilities.timedAwait(channel.setName(newName),2500,(err) => {
+ openticket.log("Failed to rename channel on ticket unpin","error")
+ })
+ }catch(err){
+ await channel.send((await openticket.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-unpin",{guild,channel,user,originalName,newName})).message)
+ }
+ }
+
+ //update ticket message
+ const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
+ if (ticketMessage){
+ try{
+ ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
+ }catch(e){
+ openticket.log("Unable to edit ticket message on ticket unpinning!","error",[
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"messageid",value:ticketMessage.id},
+ {key:"option",value:ticket.option.id.value}
+ ])
+ openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
+ }
+ }
+
+ //reply with new message
+ if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:unpin-message").build(source,{guild,channel,user,ticket,reason})).message)
+ ticket.get("openticket:busy").value = false
+ await openticket.events.get("afterTicketUnpinned").emit([ticket,user,channel,reason])
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user,ticket,reason} = params
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.pinning.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"unpin",reason,additionalData:null}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.pinning.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"unpin",reason,additionalData:null}))
+ }),
+ new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
+ const {guild,channel,user,ticket} = params
+
+ openticket.log(user.displayName+" unpinned a ticket!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channel",value:"#"+channel.name},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"reason",value:params.reason ?? "/"},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerVerifyBars = async () => {
+ //UNPIN TICKET TICKET MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:unpin-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:unpin-ticket-ticket-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.unpin
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:unpin-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not pinned
+ if (!ticket.get("openticket:pinned").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.unpin"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start unpining ticket
+ if (params.data == "reason"){
+ //unpin with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:unpin-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ //unpin without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unpin-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:unpin-ticket-ticket-message").failure.add([
+ new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ })
+ ])
+
+ //UNPIN TICKET PIN MESSAGE
+ openticket.verifybars.add(new api.ODVerifyBar("openticket:unpin-ticket-pin-message",openticket.builders.messages.getSafe("openticket:verifybar-pin-message"),!generalConfig.data.system.disableVerifyBars))
+ openticket.verifybars.get("openticket:unpin-ticket-pin-message").success.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.unpin
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:unpin-ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not pinned
+ if (!ticket.get("openticket:pinned").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.unpin"),layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ //start unpinning ticket
+ if (params.data == "reason"){
+ //unpin with reason
+ instance.modal(await openticket.builders.modals.getSafe("openticket:unpin-ticket-reason").build("pin-message",{guild,channel,user,ticket}))
+ }else{
+ //unpin without reason
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unpin-ticket").run("pin-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:unpin-message").build("pin-message",{guild,channel,user,ticket,reason:null}))
+ }
+ })
+ ])
+ openticket.verifybars.get("openticket:unpin-ticket-pin-message").failure.add([
+ new api.ODWorker("openticket:back-to-pin-message",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ const {verifybarMessage} = params
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ await instance.update(await openticket.builders.messages.getSafe("openticket:pin-message").build("other",{guild,channel,user,ticket,reason}))
+ })
+ ])
+ openticket.actions.get("openticket:unpin-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
+ //set busy to false in case of crash or cancel
+ params.ticket.get("openticket:busy").value = false
+ })
+}
\ No newline at end of file
diff --git a/src/builders/buttons.ts b/src/builders/buttons.ts
new file mode 100644
index 0000000..78f088e
--- /dev/null
+++ b/src/builders/buttons.ts
@@ -0,0 +1,351 @@
+///////////////////////////////////////
+//BUTTON BUILDERS
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const buttons = openticket.builders.buttons
+const lang = openticket.languages
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerAllButtons = async () => {
+ verifybarButtons()
+ errorButtons()
+ helpMenuButtons()
+ panelButtons()
+ ticketButtons()
+ transcriptButtons()
+ clearButtons()
+}
+
+const verifybarButtons = () => {
+ //VERIFYBAR SUCCESS
+ buttons.add(new api.ODButton("openticket:verifybar-success"))
+ buttons.get("openticket:verifybar-success").workers.add(
+ new api.ODWorker("openticket:verifybar-success",0,async (instance,params) => {
+ const {verifybar,customData,customColor,customLabel,customEmoji} = params
+
+ if (customData && customData.length > 40) throw new api.ODSystemError("ODButton:openticket:verifybar-success => customData exceeds 40 characters limit!")
+
+ const newData = (customData) ? "_"+customData : ""
+ const newColor = customColor ?? "gray"
+ const newLabel = customLabel ?? ""
+ const newEmoji = customEmoji ?? "✅"
+
+ instance.setCustomId("od:verifybar-success_"+verifybar.id.value+newData)
+ instance.setMode("button")
+ instance.setColor(newColor)
+ if (newLabel) instance.setLabel(newLabel)
+ if (newEmoji) instance.setEmoji(newEmoji)
+ })
+ )
+
+ //VERIFYBAR FAILURE
+ buttons.add(new api.ODButton("openticket:verifybar-failure"))
+ buttons.get("openticket:verifybar-failure").workers.add(
+ new api.ODWorker("openticket:verifybar-failure",0,async (instance,params) => {
+ const {verifybar,customData,customColor,customLabel,customEmoji} = params
+
+ if (customData && customData.length > 40) throw new api.ODSystemError("ODButton:openticket:verifybar-success => customData exceeds 40 characters limit!")
+
+ const newData = (customData) ? "_"+customData : ""
+ const newColor = customColor ?? "gray"
+ const newLabel = customLabel ?? ""
+ const newEmoji = customEmoji ?? "❌"
+
+ instance.setCustomId("od:verifybar-failure_"+verifybar.id.value+newData)
+ instance.setMode("button")
+ instance.setColor(newColor)
+ if (newLabel) instance.setLabel(newLabel)
+ if (newEmoji) instance.setEmoji(newEmoji)
+ })
+ )
+}
+
+const errorButtons = () => {
+ //ERROR TICKET DEPRECATED TRANSCRIPT
+ buttons.add(new api.ODButton("openticket:error-ticket-deprecated-transcript"))
+ buttons.get("openticket:error-ticket-deprecated-transcript").workers.add(
+ new api.ODWorker("openticket:error-ticket-deprecated-transcript",0,async (instance,params) => {
+
+ instance.setCustomId("od:error-ticket-deprecated-transcript")
+ instance.setMode("button")
+ instance.setColor("gray")
+ instance.setLabel(lang.getTranslation("transcripts.errors.backup"))
+ instance.setEmoji("📄")
+ })
+ )
+}
+
+const helpMenuButtons = () => {
+ //HELP MENU PAGE
+ buttons.add(new api.ODButton("openticket:help-menu-page"))
+ buttons.get("openticket:help-menu-page").workers.add(
+ new api.ODWorker("openticket:help-menu-page",0,async (instance,params) => {
+ const {mode,page} = params
+ const totalPages = (await openticket.helpmenu.render(mode)).length
+ const pageText = (page+1).toString()+"/"+totalPages.toString()
+
+ instance.setCustomId("od:help-menu-page_"+page.toString())
+ instance.setMode("button")
+ instance.setColor("gray")
+ instance.setLabel(lang.getTranslationWithParams("actions.buttons.helpPage",[pageText]))
+ instance.setDisabled(true)
+ })
+ )
+
+ //HELP MENU SWITCH
+ buttons.add(new api.ODButton("openticket:help-menu-switch"))
+ buttons.get("openticket:help-menu-switch").workers.add(
+ new api.ODWorker("openticket:help-menu-switch",0,async (instance,params) => {
+ const {mode} = params
+
+ instance.setCustomId("od:help-menu-switch_"+mode)
+ instance.setMode("button")
+ instance.setColor("gray")
+ if (mode == "slash") instance.setLabel(lang.getTranslation("actions.buttons.helpSwitchText"))
+ else instance.setLabel(lang.getTranslation("actions.buttons.helpSwitchSlash"))
+ })
+ )
+
+ //HELP MENU PREVIOUS
+ buttons.add(new api.ODButton("openticket:help-menu-previous"))
+ buttons.get("openticket:help-menu-previous").workers.add(
+ new api.ODWorker("openticket:help-menu-previous",0,async (instance,params) => {
+ const {page} = params
+
+ instance.setCustomId("od:help-menu-previous")
+ instance.setMode("button")
+ instance.setColor("gray")
+ instance.setEmoji("◀️")
+ if (page == 0) instance.setDisabled(true)
+ })
+ )
+
+ //HELP MENU NEXT
+ buttons.add(new api.ODButton("openticket:help-menu-next"))
+ buttons.get("openticket:help-menu-next").workers.add(
+ new api.ODWorker("openticket:help-menu-next",0,async (instance,params) => {
+ const {mode,page} = params
+ const totalPages = (await openticket.helpmenu.render(mode)).length
+
+ instance.setCustomId("od:help-menu-next")
+ instance.setMode("button")
+ instance.setColor("gray")
+ instance.setEmoji("▶️")
+ if (page == totalPages-1) instance.setDisabled(true)
+ })
+ )
+}
+
+const panelButtons = () => {
+ //TICKET OPTION
+ buttons.add(new api.ODButton("openticket:ticket-option"))
+ buttons.get("openticket:ticket-option").workers.add(
+ new api.ODWorker("openticket:ticket-option",0,async (instance,params) => {
+ const {panel,option} = params
+
+ instance.setCustomId("od:ticket-option_"+panel.id.value+"_"+option.id.value)
+ instance.setMode("button")
+ instance.setColor(option.get("openticket:button-color").value)
+ if (option.get("openticket:button-emoji").value) instance.setEmoji(option.get("openticket:button-emoji").value)
+ if (option.get("openticket:button-label").value) instance.setLabel(option.get("openticket:button-label").value)
+ if (!option.get("openticket:button-emoji").value && !option.get("openticket:button-label").value) instance.setLabel("<"+option.id.value+">")
+ })
+ )
+
+ //WEBSITE OPTION
+ buttons.add(new api.ODButton("openticket:website-option"))
+ buttons.get("openticket:website-option").workers.add(
+ new api.ODWorker("openticket:website-option",0,async (instance,params) => {
+ const {panel,option} = params
+
+ instance.setMode("url")
+ instance.setUrl(option.get("openticket:url").value)
+ if (option.get("openticket:button-emoji").value) instance.setEmoji(option.get("openticket:button-emoji").value)
+ if (option.get("openticket:button-label").value) instance.setLabel(option.get("openticket:button-label").value)
+ if (!option.get("openticket:button-emoji").value && !option.get("openticket:button-label").value) instance.setLabel("<"+option.id.value+">")
+ })
+ )
+
+ //ROLE OPTION
+ buttons.add(new api.ODButton("openticket:role-option"))
+ buttons.get("openticket:role-option").workers.add(
+ new api.ODWorker("openticket:role-option",0,async (instance,params) => {
+ const {panel,option} = params
+
+ instance.setCustomId("od:role-option_"+panel.id.value+"_"+option.id.value)
+ instance.setMode("button")
+ instance.setColor(option.get("openticket:button-color").value)
+ if (option.get("openticket:button-emoji").value) instance.setEmoji(option.get("openticket:button-emoji").value)
+ if (option.get("openticket:button-label").value) instance.setLabel(option.get("openticket:button-label").value)
+ if (!option.get("openticket:button-emoji").value && !option.get("openticket:button-label").value) instance.setLabel("<"+option.id.value+">")
+ })
+ )
+}
+
+const ticketButtons = () => {
+ //VISIT TICKET
+ buttons.add(new api.ODButton("openticket:visit-ticket"))
+ buttons.get("openticket:visit-ticket").workers.add(
+ new api.ODWorker("openticket:visit-ticket",0,async (instance,params) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("url")
+ instance.setUrl(channel.url)
+ instance.setEmoji("🎫")
+ instance.setLabel(lang.getTranslation("actions.buttons.create"))
+ })
+ )
+
+ //CLOSE TICKET
+ buttons.add(new api.ODButton("openticket:close-ticket"))
+ buttons.get("openticket:close-ticket").workers.add(
+ new api.ODWorker("openticket:close-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:close-ticket_"+source)
+ instance.setColor("gray")
+ instance.setEmoji("🔒")
+ instance.setLabel(lang.getTranslation("actions.buttons.close"))
+ })
+ )
+
+ //DELETE TICKET
+ buttons.add(new api.ODButton("openticket:delete-ticket"))
+ buttons.get("openticket:delete-ticket").workers.add(
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:delete-ticket_"+source)
+ instance.setColor("red")
+ instance.setEmoji("✖")
+ instance.setLabel(lang.getTranslation("actions.buttons.delete"))
+ })
+ )
+
+ //REOPEN TICKET
+ buttons.add(new api.ODButton("openticket:reopen-ticket"))
+ buttons.get("openticket:reopen-ticket").workers.add(
+ new api.ODWorker("openticket:reopen-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:reopen-ticket_"+source)
+ instance.setColor("green")
+ instance.setEmoji("🔓")
+ instance.setLabel(lang.getTranslation("actions.buttons.reopen"))
+ })
+ )
+
+ //CLAIM TICKET
+ buttons.add(new api.ODButton("openticket:claim-ticket"))
+ buttons.get("openticket:claim-ticket").workers.add(
+ new api.ODWorker("openticket:claim-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:claim-ticket_"+source)
+ instance.setColor("green")
+ instance.setEmoji("👋")
+ instance.setLabel(lang.getTranslation("actions.buttons.claim"))
+ })
+ )
+
+ //UNCLAIM TICKET
+ buttons.add(new api.ODButton("openticket:unclaim-ticket"))
+ buttons.get("openticket:unclaim-ticket").workers.add(
+ new api.ODWorker("openticket:unclaim-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:unclaim-ticket_"+source)
+ instance.setColor("green")
+ instance.setEmoji("↩️")
+ instance.setLabel(lang.getTranslation("actions.buttons.unclaim"))
+ })
+ )
+
+ //PIN TICKET
+ buttons.add(new api.ODButton("openticket:pin-ticket"))
+ buttons.get("openticket:pin-ticket").workers.add(
+ new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:pin-ticket_"+source)
+ instance.setColor("gray")
+ instance.setEmoji("📌")
+ instance.setLabel(lang.getTranslation("actions.buttons.pin"))
+ })
+ )
+
+ //UNPIN TICKET
+ buttons.add(new api.ODButton("openticket:unpin-ticket"))
+ buttons.get("openticket:unpin-ticket").workers.add(
+ new api.ODWorker("openticket:unpin-ticket",0,async (instance,params,source) => {
+ const {guild,channel,ticket} = params
+
+ instance.setMode("button")
+ instance.setCustomId("od:unpin-ticket_"+source)
+ instance.setColor("gray")
+ instance.setEmoji("📌")
+ instance.setLabel(lang.getTranslation("actions.buttons.unpin"))
+ })
+ )
+}
+
+const transcriptButtons = () => {
+ //TRANSCRIPT HTML VISIT
+ buttons.add(new api.ODButton("openticket:transcript-html-visit"))
+ buttons.get("openticket:transcript-html-visit").workers.add(
+ new api.ODWorker("openticket:transcript-html-visit",0,async (instance,params,source) => {
+ const {result} = params
+ instance.setMode("url")
+ if (result.data) instance.setUrl(result.data.url)
+ else throw new api.ODSystemError("ODButton:openticket:transcript-html-visit => Missing Transcript Result Data!")
+ instance.setEmoji("📄")
+ instance.setLabel(lang.getTranslation("transcripts.success.visit"))
+ })
+ )
+
+ //TRANSCRIPT ERROR RETRY
+ buttons.add(new api.ODButton("openticket:transcript-error-retry"))
+ buttons.get("openticket:transcript-error-retry").workers.add(
+ new api.ODWorker("openticket:transcript-error-retry",0,async (instance,params,source) => {
+ instance.setMode("button")
+ instance.setCustomId("od:transcript-error-retry_"+source)
+ instance.setColor("gray")
+ instance.setEmoji("🔄")
+ instance.setLabel(lang.getTranslation("transcripts.errors.retry"))
+ })
+ )
+
+ //TRANSCRIPT ERROR CONTINUE
+ buttons.add(new api.ODButton("openticket:transcript-error-continue"))
+ buttons.get("openticket:transcript-error-continue").workers.add(
+ new api.ODWorker("openticket:transcript-error-continue",0,async (instance,params,source) => {
+ instance.setMode("button")
+ instance.setCustomId("od:transcript-error-continue_"+source)
+ instance.setColor("red")
+ instance.setEmoji("✖")
+ instance.setLabel(lang.getTranslation("transcripts.errors.continue"))
+ })
+ )
+}
+
+const clearButtons = () => {
+ //CLEAR CONTINUE
+ buttons.add(new api.ODButton("openticket:clear-continue"))
+ buttons.get("openticket:clear-continue").workers.add(
+ new api.ODWorker("openticket:clear-continue",0,async (instance,params,source) => {
+ instance.setMode("button")
+ instance.setCustomId("od:clear-continue_"+source+"_"+params.filter)
+ instance.setColor("red")
+ instance.setEmoji("✖")
+ instance.setLabel(lang.getTranslation("actions.buttons.clear"))
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/builders/dropdowns.ts b/src/builders/dropdowns.ts
new file mode 100644
index 0000000..d2f9b60
--- /dev/null
+++ b/src/builders/dropdowns.ts
@@ -0,0 +1,37 @@
+///////////////////////////////////////
+//DROPDOWN BUILDERS
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const dropdowns = openticket.builders.dropdowns
+
+export const registerAllDropdowns = async () => {
+ panelDropdowns()
+}
+
+const panelDropdowns = () => {
+ //TICKET OPTION
+ dropdowns.add(new api.ODDropdown("openticket:panel-dropdown-tickets"))
+ dropdowns.get("openticket:panel-dropdown-tickets").workers.add(
+ new api.ODWorker("openticket:panel-dropdown-tickets",0,async (instance,params) => {
+ const {panel,options} = params
+
+ const parsedOptions = options.map((option) => {
+ return {
+ label:option.get("openticket:button-label").value.substring(0,100),
+ value:"od:ticket-option_"+panel.id.value+"_"+option.id.value,
+ emoji:option.get("openticket:button-emoji").value,
+ description:option.get("openticket:description").value.substring(0,100)
+ }
+ })
+
+ instance.setCustomId("od:panel-dropdown_"+panel.id.value)
+ instance.setType("string")
+ instance.setMaxValues(1)
+ instance.setMinValues(0)
+ instance.setPlaceholder(panel.get("openticket:dropdown-placeholder").value)
+ instance.setOptions(parsedOptions)
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/builders/embeds.ts b/src/builders/embeds.ts
new file mode 100644
index 0000000..4eb4d0e
--- /dev/null
+++ b/src/builders/embeds.ts
@@ -0,0 +1,1272 @@
+///////////////////////////////////////
+//EMBED BUILDERS
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+import nodepath from "path"
+
+const embeds = openticket.builders.embeds
+const lang = openticket.languages
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerAllEmbeds = async () => {
+ errorEmbeds()
+ helpMenuEmbeds()
+ statsEmbeds()
+ panelEmbeds()
+ ticketEmbeds()
+ blacklistEmbeds()
+ transcriptEmbeds()
+ roleEmbeds()
+ clearEmbeds()
+ autoEmbeds()
+}
+
+/**Utility function to get the translated "method" from the source. Mostly used in error embeds. */
+const getMethodFromSource = (source:"slash"|"text"|"button"|"dropdown"|"modal"|"other"): string => {
+ if (source == "slash" || source == "text") return lang.getTranslation("params.lowercase.command")
+ else if (source == "button") return lang.getTranslation("params.lowercase.button")
+ else if (source == "dropdown") return lang.getTranslation("params.lowercase.dropdown")
+ else if (source == "modal") return lang.getTranslation("params.lowercase.modal")
+ else return lang.getTranslation("params.lowercase.method")
+}
+//lang.getTranslation()
+
+const errorEmbeds = () => {
+ //ERROR
+ embeds.add(new api.ODEmbed("openticket:error"))
+ embeds.get("openticket:error").workers.add(
+ new api.ODWorker("openticket:error",0,async (instance,params,source) => {
+ const {user,error,layout} = params
+
+ const method = getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.internalError")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("errors.descriptions.internalError",[method]) + (layout == "simple") ? "\n"+error : "")
+ if (layout == "advanced" && error) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+error+"```"})
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ })
+ )
+
+ //ERROR OPTION MISSING
+ embeds.add(new api.ODEmbed("openticket:error-option-missing"))
+ embeds.get("openticket:error-option-missing").workers.add(
+ new api.ODWorker("openticket:error-option-missing",0,async (instance,params) => {
+ const {user,error} = params
+
+ const options = error.command.builder.options ?? []
+ const optionSyntax = options.map((opt,index) => {
+ if (index == error.location){
+ if (opt.required){
+ return "`<"+opt.name+":"+opt.type.replace("guildmember","user")+">`"
+ }else{
+ return "`["+opt.name+":"+opt.type.replace("guildmember","user")+"]`"
+ }
+ }else{
+ if (opt.required){
+ return "<"+opt.name+":"+opt.type.replace("guildmember","user")+">"
+ }else{
+ return "["+opt.name+":"+opt.type.replace("guildmember","user")+"]"
+ }
+ }
+ })
+ const commandSyntax = "**"+error.prefix+error.name+" "+optionSyntax.join(" ")+"**"
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.optionMissing")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.optionMissing"))
+ instance.addFields({name:lang.getTranslation("params.uppercase.syntax")+":",value:commandSyntax})
+ })
+ )
+
+ //ERROR OPTION INVALID
+ embeds.add(new api.ODEmbed("openticket:error-option-invalid"))
+ embeds.get("openticket:error-option-invalid").workers.add(
+ new api.ODWorker("openticket:error-option-invalid",0,async (instance,params) => {
+ const {user,error} = params
+
+ const options = error.command.builder.options ?? []
+ const optionSyntax = options.map((opt,index) => {
+ if (index == error.location){
+ if (opt.required){
+ return "`<"+opt.name+":"+opt.type.replace("guildmember","user")+">`"
+ }else{
+ return "`["+opt.name+":"+opt.type.replace("guildmember","user")+"]`"
+ }
+ }else{
+ if (opt.required){
+ return "<"+opt.name+":"+opt.type.replace("guildmember","user")+">"
+ }else{
+ return "["+opt.name+":"+opt.type.replace("guildmember","user")+"]"
+ }
+ }
+ })
+ const commandSyntax = "**"+error.prefix+error.name+" "+optionSyntax.join(" ")+"**"
+
+ let reasonTitle = (error.reason == "boolean" || error.reason == "string_choice") ? lang.getTranslation("errors.descriptions.optionInvalidChoose") : lang.getTranslation("params.uppercase.reason")
+ let reasonValue = ""
+
+ if (error.reason == "boolean" && error.option.type == "boolean") reasonValue = (error.option.falseValue ?? "false")+" OR "+(error.option.trueValue ?? "true")
+ else if (error.reason == "string_choice" && error.option.type == "string" && error.option.choices) reasonValue = error.option.choices.join(" OR ")
+ else if (error.reason == "string_regex" && error.option.type == "string" && error.option.regex) reasonValue = lang.getTranslation("errors.optionInvalidReasons.stringRegex")
+ else if (error.reason == "string_min_length" && error.option.type == "string" && error.option.minLength) reasonValue = lang.getTranslationWithParams("errors.optionInvalidReasons.stringMinLength",[error.option.minLength.toString()])
+ else if (error.reason == "string_max_length" && error.option.type == "string" && error.option.maxLength) reasonValue = lang.getTranslationWithParams("errors.optionInvalidReasons.stringMaxLength",[error.option.maxLength.toString()])
+ else if (error.reason == "number_invalid" && error.option.type == "number") reasonValue = lang.getTranslation("errors.optionInvalidReasons.numberInvalid")
+ else if (error.reason == "number_min" && error.option.type == "number" && error.option.min) reasonValue = lang.getTranslationWithParams("errors.optionInvalidReasons.numberMin",[error.option.min.toString()])
+ else if (error.reason == "number_max" && error.option.type == "number" && error.option.max) reasonValue = lang.getTranslationWithParams("errors.optionInvalidReasons.numberMax",[error.option.max.toString()])
+ else if (error.reason == "number_decimal" && error.option.type == "number") reasonValue = lang.getTranslation("errors.optionInvalidReasons.numberDecimal")
+ else if (error.reason == "number_negative" && error.option.type == "number") reasonValue = lang.getTranslation("errors.optionInvalidReasons.numberNegative")
+ else if (error.reason == "number_positive" && error.option.type == "number") reasonValue = lang.getTranslation("errors.optionInvalidReasons.numberPositive")
+ else if (error.reason == "number_zero" && error.option.type == "number") reasonValue = lang.getTranslation("errors.optionInvalidReasons.numberZero")
+ else if (error.reason == "channel_not_found" && error.option.type == "channel") reasonValue = lang.getTranslation("errors.optionInvalidReasons.channelNotFound")
+ else if (error.reason == "user_not_found" && error.option.type == "user") reasonValue = lang.getTranslation("errors.optionInvalidReasons.userNotFound")
+ else if (error.reason == "role_not_found" && error.option.type == "role") reasonValue = lang.getTranslation("errors.optionInvalidReasons.roleNotFound")
+ else if (error.reason == "member_not_found" && error.option.type == "guildmember") reasonValue = lang.getTranslation("errors.optionInvalidReasons.memberNotFound")
+ else if (error.reason == "mentionable_not_found" && error.option.type == "mentionable") reasonValue = lang.getTranslation("errors.optionInvalidReasons.mentionableNotFound")
+ else if (error.reason == "channel_type" && error.option.type == "channel") reasonValue = lang.getTranslation("errors.optionInvalidReasons.channelType")
+ else if (error.reason == "not_in_guild") reasonValue = lang.getTranslation("errors.optionInvalidReasons.notInGuild")
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.optionInvalid")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.optionInvalid")+"\n"+reasonTitle+": `"+reasonValue+"`")
+ instance.addFields({name:lang.getTranslation("params.uppercase.syntax")+":",value:commandSyntax})
+ })
+ )
+
+ //ERROR UNKNOWN COMMAND
+ embeds.add(new api.ODEmbed("openticket:error-unknown-command"))
+ embeds.get("openticket:error-unknown-command").workers.add(
+ new api.ODWorker("openticket:error-unknown-command",0,async (instance,params) => {
+ const {user} = params
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.unknownCommand")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.unknownCommand"))
+ })
+ )
+
+ //ERROR NO PERMISSIONS
+ embeds.add(new api.ODEmbed("openticket:error-no-permissions"))
+ embeds.get("openticket:error-no-permissions").workers.add(
+ new api.ODWorker("openticket:error-no-permissions",0,async (instance,params,source) => {
+ const {user,permissions} = params
+
+ const method = getMethodFromSource(source)
+
+ const renderedPerms = permissions.map((perm) => {
+ if (perm == "developer") return "- "+lang.getTranslation("errors.permissions.developer")
+ else if (perm == "owner") return "- "+lang.getTranslation("errors.permissions.owner")
+ else if (perm == "admin") return "- "+lang.getTranslation("errors.permissions.admin")
+ else if (perm == "moderator") return "- "+lang.getTranslation("errors.permissions.moderator")
+ else if (perm == "support") return "- "+lang.getTranslation("errors.permissions.support")
+ else if (perm == "member") return "- "+lang.getTranslation("errors.permissions.member")
+ else if (perm == "discord-administrator") return "- "+lang.getTranslation("errors.permissions.discord-administrator")
+ }).join("\n")
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.noPermissions")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("errors.descriptions.noPermissions",[method]))
+ if (renderedPerms) instance.addFields({name:lang.getTranslation("errors.descriptions.noPermissionsList"),value:renderedPerms})
+ })
+ )
+
+ //ERROR NO PERMISSIONS COOLDOWN
+ embeds.add(new api.ODEmbed("openticket:error-no-permissions-cooldown"))
+ embeds.get("openticket:error-no-permissions-cooldown").workers.add(
+ new api.ODWorker("openticket:error-no-permissions-cooldown",0,async (instance,params,source) => {
+ const {user} = params
+
+ const method = getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.noPermissions")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("errors.descriptions.noPermissionsCooldown",[method]))
+ instance.addFields({name:lang.getTranslation("params.uppercase.until")+":",value:discord.time(params.until ?? new Date(),"R")})
+ })
+ )
+
+ //ERROR NO PERMISSIONS BLACKLISTED
+ embeds.add(new api.ODEmbed("openticket:error-no-permissions-blacklisted"))
+ embeds.get("openticket:error-no-permissions-blacklisted").workers.add(
+ new api.ODWorker("openticket:error-no-permissions-blacklisted",0,async (instance,params,source) => {
+ const {user} = params
+
+ const method = getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.noPermissions")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.noPermissionsBlacklist"))
+ })
+ )
+
+ //ERROR NO PERMISSIONS LIMITS
+ embeds.add(new api.ODEmbed("openticket:error-no-permissions-limits"))
+ embeds.get("openticket:error-no-permissions-limits").workers.add(
+ new api.ODWorker("openticket:error-no-permissions-limits",0,async (instance,params,source) => {
+ const {user,limit} = params
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.noPermissions")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ if (limit == "global") instance.setDescription(lang.getTranslation("errors.descriptions.noPermissionsLimitGlobal"))
+ else if (limit == "global-user") instance.setDescription(lang.getTranslation("errors.descriptions.noPermissionsLimitGlobalUser"))
+ else if (limit == "option") instance.setDescription(lang.getTranslation("errors.descriptions.noPermissionsLimitOption"))
+ else if (limit == "option-user") instance.setDescription(lang.getTranslation("errors.descriptions.noPermissionsLimitOptionUser"))
+ })
+ )
+
+ //ERROR RESPONDER TIMEOUT
+ embeds.add(new api.ODEmbed("openticket:error-responder-timeout"))
+ embeds.get("openticket:error-responder-timeout").workers.add(
+ new api.ODWorker("openticket:error-responder-timeout",0,async (instance,params,source) => {
+ const {user} = params
+
+ const method = getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.internalError")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("errors.descriptions.internalError",[method]))
+ instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```Responder Timeout```"})
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ })
+ )
+
+ //ERROR TICKET UNKNOWN
+ embeds.add(new api.ODEmbed("openticket:error-ticket-unknown"))
+ embeds.get("openticket:error-ticket-unknown").workers.add(
+ new api.ODWorker("openticket:error-ticket-unknown",0,async (instance,params,source) => {
+ const {user} = params
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.unknownTicket")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.unknownTicket"))
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ })
+ )
+
+ //ERROR TICKET DEPRECATED
+ embeds.add(new api.ODEmbed("openticket:error-ticket-deprecated"))
+ embeds.get("openticket:error-ticket-deprecated").workers.add(
+ new api.ODWorker("openticket:error-ticket-deprecated",0,async (instance,params,source) => {
+ const {user} = params
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.deprecatedTicket")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.deprecatedTicket"))
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ })
+ )
+
+ //ERROR OPTION UNKNOWN
+ embeds.add(new api.ODEmbed("openticket:error-option-unknown"))
+ embeds.get("openticket:error-option-unknown").workers.add(
+ new api.ODWorker("openticket:error-option-unknown",0,async (instance,params,source) => {
+ const {user} = params
+
+ const renderedTicketOptions = openticket.options.getAll().map((option) => {
+ if (option instanceof api.ODTicketOption && option.exists("openticket:name")){
+ return "- **"+option.get("openticket:name").value+":** `"+option.id.value+"`"
+ }else return "- `"+option.id.value+"`"
+ }).join("\n")
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.unknownOption")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ instance.addFields({name:lang.getTranslation("params.uppercase.validOptions")+":",value:renderedTicketOptions})
+ })
+ )
+
+ //ERROR PANEL UNKNOWN
+ embeds.add(new api.ODEmbed("openticket:error-panel-unknown"))
+ embeds.get("openticket:error-panel-unknown").workers.add(
+ new api.ODWorker("openticket:error-panel-unknown",0,async (instance,params,source) => {
+ const {user} = params
+
+ const renderedPanels = openticket.panels.getAll().map((panel) => {
+ if (panel.exists("openticket:name")){
+ return "- **"+panel.get("openticket:name").value+":** `"+panel.id.value+"`"
+ }else return "- `"+panel.id.value+"`"
+ }).join("\n")
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.unknownPanel")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.addFields({name:lang.getTranslation("params.uppercase.validPanels")+":",value:renderedPanels})
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ })
+ )
+
+ //ERROR NOT IN GUILD
+ embeds.add(new api.ODEmbed("openticket:error-not-in-guild"))
+ embeds.get("openticket:error-not-in-guild").workers.add(
+ new api.ODWorker("openticket:error-not-in-guild",0,async (instance,params,source) => {
+ const {user} = params
+
+ const method = getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.notInGuild")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("errors.descriptions.notInGuild",[method]))
+ })
+ )
+
+ //ERROR CHANNEL RENAME
+ embeds.add(new api.ODEmbed("openticket:error-channel-rename"))
+ embeds.get("openticket:error-channel-rename").workers.add(
+ new api.ODWorker("openticket:error-channel-rename",0,async (instance,params,source) => {
+ const {channel,user,originalName,newName} = params
+
+ const method = (source == "ticket-move" || source == "ticket-pin" || source == "ticket-rename" || source == "ticket-unpin") ? source : getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.channelRename")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("errors.descriptions.channelRename"))
+ instance.setFooter(lang.getTranslationWithParams("errors.descriptions.channelRenameSource",[method]))
+ instance.addFields(
+ {name:lang.getTranslation("params.uppercase.originalName")+":",value:"```#"+originalName+"```",inline:false},
+ {name:lang.getTranslation("params.uppercase.newName")+":",value:"```#"+newName+"```",inline:false}
+ )
+ })
+ )
+
+ //ERROR TICKET BUSY
+ embeds.add(new api.ODEmbed("openticket:error-ticket-busy"))
+ embeds.get("openticket:error-ticket-busy").workers.add(
+ new api.ODWorker("openticket:error-ticket-busy",0,async (instance,params,source) => {
+ const {user} = params
+
+ const method = getMethodFromSource(source)
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.busy")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("errors.descriptions.busy",[method]))
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfoResolve"))
+ })
+ )
+}
+
+const helpMenuEmbeds = () => {
+ //HELP MENU
+ embeds.add(new api.ODEmbed("openticket:help-menu"))
+ embeds.get("openticket:help-menu").workers.add(
+ new api.ODWorker("openticket:help-menu",0,async (instance,params) => {
+ const {mode,page} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("ℹ️",lang.getTranslation("actions.titles.help")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.helpExplanation"))
+ instance.setThumbnail(openticket.client.client.user.displayAvatarURL())
+
+ const data = await openticket.helpmenu.render(mode)
+ const currentData = data[page] ?? []
+ instance.setFields(currentData)
+ })
+ )
+}
+
+const statsEmbeds = () => {
+ //STATS GLOBAL
+ embeds.add(new api.ODEmbed("openticket:stats-global"))
+ embeds.get("openticket:stats-global").workers.add(
+ new api.ODWorker("openticket:stats-global",0,async (instance,params) => {
+ const {guild,channel,user} = params
+
+ const scope = openticket.stats.get("openticket:global")
+ if (!scope) return
+ const data = await scope.render("GLOBAL",guild,channel,user)
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(scope.name)
+ instance.setDescription(data)
+
+ if (openticket.permissions.hasPermissions("owner",await openticket.permissions.getPermissions(user,channel,guild))){
+ //show system data when owner or developer
+ const systemScope = openticket.stats.get("openticket:system")
+ if (!systemScope) return
+ const systemData = await systemScope.render("GLOBAL",guild,channel,user)
+ instance.addFields({name:systemScope.name,value:systemData,inline:false})
+ }
+ })
+ )
+
+ //STATS TICKET
+ embeds.add(new api.ODEmbed("openticket:stats-ticket"))
+ embeds.get("openticket:stats-ticket").workers.add(
+ new api.ODWorker("openticket:stats-ticket",0,async (instance,params) => {
+ const {guild,channel,user,scopeData} = params
+
+ const scope = openticket.stats.get("openticket:ticket")
+ const participantsScope = openticket.stats.get("openticket:participants")
+ if (!scope || !participantsScope) return
+ const data = await scope.render(scopeData.id.value,guild,channel,user)
+ const participantsData = await participantsScope.render(scopeData.id.value,guild,channel,user)
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(scope.name)
+ instance.setDescription(data)
+ instance.addFields({name:participantsScope.name,value:participantsData,inline:false})
+ })
+ )
+
+ //STATS USER
+ embeds.add(new api.ODEmbed("openticket:stats-user"))
+ embeds.get("openticket:stats-user").workers.add([
+ new api.ODWorker("openticket:stats-user",0,async (instance,params) => {
+ const {guild,channel,user,scopeData} = params
+
+ const scope = openticket.stats.get("openticket:user")
+ if (!scope) return
+ const data = await scope.render(scopeData.id,guild,channel,user)
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(scope.name)
+ instance.setDescription(data)
+ instance.setThumbnail(scopeData.displayAvatarURL())
+ }),
+ new api.ODWorker("openticket:easter-egg",-1,async (instance,params) => {
+ if (!openticket.flags.exists("openticket:no-easter")) return
+ const easterFlag = openticket.flags.get("openticket:no-easter")
+ if (!easterFlag.value){
+ //🥚 add easter egg 🥚
+ const {user} = params
+ if (user.id == utilities.easterEggs.creator){
+ instance.setFooter("💻 Open Ticket Developer")
+ }else if (utilities.easterEggs.translators.includes(user.id)){
+ instance.setFooter("💬 Open Ticket Translator")
+ }
+ }
+ })
+ ])
+
+ //STATS RESET
+ embeds.add(new api.ODEmbed("openticket:stats-reset"))
+ embeds.get("openticket:stats-reset").workers.add(
+ new api.ODWorker("openticket:stats-reset",0,async (instance,params) => {
+ const {user,reason} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🗑️",lang.getTranslation("actions.titles.statsReset")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslation("actions.descriptions.statsReset"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //STATS TICKET UNKNOWN
+ embeds.add(new api.ODEmbed("openticket:stats-ticket-unknown"))
+ embeds.get("openticket:stats-ticket-unknown").workers.add(
+ new api.ODWorker("openticket:stats-ticket-unknown",0,async (instance,params) => {
+ const {user,id} = params
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.unknownTicket")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.statsError",[discord.channelMention(id)]))
+ })
+ )
+}
+
+const panelEmbeds = () => {
+ //PANEL
+ embeds.add(new api.ODEmbed("openticket:panel"))
+ embeds.get("openticket:panel").workers.add(
+ new api.ODWorker("openticket:panel",0,async (instance,params) => {
+ const {panel} = params
+ if (!panel.exists("openticket:embed")) return
+ const embedOptions = panel.get("openticket:embed").value
+
+ instance.setColor(embedOptions.customColor ? (embedOptions.customColor as discord.ColorResolvable) : generalConfig.data.mainColor)
+ instance.setTitle(embedOptions.title)
+ if (embedOptions.thumbnail) instance.setThumbnail(embedOptions.thumbnail)
+ if (embedOptions.image) instance.setImage(embedOptions.image)
+ if (embedOptions.url) instance.setUrl(embedOptions.url)
+ if (embedOptions.footer) instance.setFooter(embedOptions.footer)
+ if (embedOptions.timestamp) instance.setTimestamp(new Date())
+
+ if (panel.get("openticket:describe-options-in-embed-description").value){
+ //describe options in description
+ const text = (await import("../data/openticket/panelLoader.ts")).describePanelOptions("text",panel)
+ instance.setDescription(embedOptions.description+"\n\n"+text)
+ }else if (embedOptions.description){
+ instance.setDescription(embedOptions.description)
+ }
+
+ if (panel.get("openticket:enable-max-tickets-warning-embed").value && generalConfig.data.system.limits.enabled){
+ instance.setDescription(instance.data.description+"\n\n*"+lang.getTranslationWithParams("actions.descriptions.ticketMessageLimit",[generalConfig.data.system.limits.userMaximum.toString()])+"*")
+ }
+
+ if (panel.get("openticket:describe-options-in-embed-fields").value){
+ //describe options in fields
+ const fields = (await import("../data/openticket/panelLoader.ts")).describePanelOptions("fields",panel)
+ instance.setFields(fields)
+ }else if(embedOptions.fields.length > 0){
+ instance.setFields(embedOptions.fields)
+ }
+ })
+ )
+}
+
+const ticketEmbeds = () => {
+ //TICKET CREATED
+ embeds.add(new api.ODEmbed("openticket:ticket-created"))
+ embeds.get("openticket:ticket-created").workers.add(
+ new api.ODWorker("openticket:ticket-created",0,async (instance,params,source) => {
+ const {user} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🎫",lang.getTranslation("actions.titles.created")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.setDescription(lang.getTranslation("actions.descriptions.create"))
+ })
+ )
+
+ //TICKET CREATED DM
+ embeds.add(new api.ODEmbed("openticket:ticket-created-dm"))
+ embeds.get("openticket:ticket-created-dm").workers.add(
+ new api.ODWorker("openticket:ticket-created-dm",0,async (instance,params,source) => {
+ const {user,ticket} = params
+ const embedOptions = ticket.option.get("openticket:dm-message-embed").value
+
+ instance.setColor(embedOptions.customColor ? (embedOptions.customColor as discord.ColorResolvable) : generalConfig.data.mainColor)
+ instance.setTitle(embedOptions.title)
+ if (embedOptions.thumbnail) instance.setThumbnail(embedOptions.thumbnail)
+ if (embedOptions.image) instance.setImage(embedOptions.image)
+ if (embedOptions.timestamp) instance.setTimestamp(new Date())
+ if (embedOptions.description) instance.setDescription(embedOptions.description)
+ if (embedOptions.fields) instance.setFields(embedOptions.fields)
+
+ if (ticket.get("openticket:closed").value && ticket.get("openticket:autodelete-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutodelete",[ticket.option.get("openticket:autodelete-days").value.toString()]))
+ else if (!ticket.get("openticket:closed").value && ticket.get("openticket:autoclose-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutoclose",[ticket.option.get("openticket:autoclose-hours").value.toString()]))
+ })
+ )
+
+ //TICKET CREATED LOGS
+ embeds.add(new api.ODEmbed("openticket:ticket-created-logs"))
+ embeds.get("openticket:ticket-created-logs").workers.add(
+ new api.ODWorker("openticket:ticket-created-logs",0,async (instance,params,source) => {
+ const {user,ticket} = params
+
+ const method = (source == "panel-button" || source == "panel-dropdown") ? lang.getTranslation("params.uppercase.panel") : (source == "slash" || source == "text") ? lang.getTranslation("params.uppercase.command") : lang.getTranslation("params.uppercase.system")
+ const blacklisted = openticket.blacklist.exists(user.id) ? lang.getTranslation("params.uppercase.true") : lang.getTranslation("params.uppercase.false")
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🎫",lang.getTranslation("actions.titles.created")))
+ instance.setThumbnail(user.displayAvatarURL())
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.createLog",[discord.userMention(user.id)]))
+ instance.addFields(
+ {name:lang.getTranslation("params.uppercase.type")+":",value:"```"+ticket.option.get("openticket:name").value+"```",inline:false},
+ {name:lang.getTranslation("params.uppercase.method")+":",value:"```"+method+"```",inline:true},
+ {name:lang.getTranslation("params.uppercase.blacklisted")+":",value:"```"+blacklisted+"```", inline:true}
+ )
+ })
+ )
+
+ //TICKET MESSAGE
+ embeds.add(new api.ODEmbed("openticket:ticket-message"))
+ embeds.get("openticket:ticket-message").workers.add(
+ new api.ODWorker("openticket:ticket-message",0,async (instance,params,source) => {
+ const {user,ticket} = params
+ const embedOptions = ticket.option.get("openticket:ticket-message-embed").value
+
+ instance.setColor(embedOptions.customColor ? (embedOptions.customColor as discord.ColorResolvable) : generalConfig.data.mainColor)
+ if (embedOptions.title) instance.setTitle(embedOptions.title)
+ if (embedOptions.thumbnail) instance.setThumbnail(embedOptions.thumbnail)
+ if (embedOptions.image) instance.setImage(embedOptions.image)
+ if (embedOptions.timestamp) instance.setTimestamp(new Date())
+ if (embedOptions.description) instance.setDescription(embedOptions.description)
+
+ if (ticket.option.get("openticket:questions").value.length > 0){
+ const answers = ticket.get("openticket:answers").value
+ answers.forEach((answer) => {
+ if (!answer.value || answer.value.length == 0) return
+ if (generalConfig.data.system.questionFieldsInCodeBlock) instance.addFields({name:answer.name,value:"```"+answer.value+"```",inline:false})
+ else instance.addFields({name:answer.name,value:answer.value,inline:false})
+ })
+ }else if (embedOptions.fields){
+ instance.setFields(embedOptions.fields)
+ }
+
+ if (ticket.get("openticket:closed").value && ticket.get("openticket:autodelete-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutodelete",[ticket.option.get("openticket:autodelete-days").value.toString()]))
+ else if (!ticket.get("openticket:closed").value && ticket.get("openticket:autoclose-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutoclose",[ticket.option.get("openticket:autoclose-hours").value.toString()]))
+
+ if (ticket.get("openticket:claimed").value){
+ const claimUser = await openticket.tickets.getTicketUser(ticket,"claimer")
+ if (!claimUser) return
+ instance.setAuthor(lang.getTranslationWithParams("params.uppercase.claimedBy",[claimUser.displayName]),claimUser.displayAvatarURL())
+ }
+ })
+ )
+
+ //TICKET CLOSED
+ embeds.add(new api.ODEmbed("openticket:close-message"))
+ embeds.get("openticket:close-message").workers.add(
+ new api.ODWorker("openticket:close-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🔒",lang.getTranslation("actions.titles.close")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.close"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET REOPENED
+ embeds.add(new api.ODEmbed("openticket:reopen-message"))
+ embeds.get("openticket:reopen-message").workers.add(
+ new api.ODWorker("openticket:reopen-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🔓",lang.getTranslation("actions.titles.reopen")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.reopen"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET DELETED
+ embeds.add(new api.ODEmbed("openticket:delete-message"))
+ embeds.get("openticket:delete-message").workers.add(
+ new api.ODWorker("openticket:delete-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🗑️",lang.getTranslation("actions.titles.delete")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.delete"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET CLAIMED
+ embeds.add(new api.ODEmbed("openticket:claim-message"))
+ embeds.get("openticket:claim-message").workers.add(
+ new api.ODWorker("openticket:claim-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("👋",lang.getTranslation("actions.titles.claim")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.claim"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET UNCLAIMED
+ embeds.add(new api.ODEmbed("openticket:unclaim-message"))
+ embeds.get("openticket:unclaim-message").workers.add(
+ new api.ODWorker("openticket:unclaim-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("↩️",lang.getTranslation("actions.titles.unclaim")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.unclaim"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET PINNED
+ embeds.add(new api.ODEmbed("openticket:pin-message"))
+ embeds.get("openticket:pin-message").workers.add(
+ new api.ODWorker("openticket:pin-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("📌",lang.getTranslation("actions.titles.pin")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.pin"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET UNPINNED
+ embeds.add(new api.ODEmbed("openticket:unpin-message"))
+ embeds.get("openticket:unpin-message").workers.add(
+ new api.ODWorker("openticket:unpin-message",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("📌",lang.getTranslation("actions.titles.unpin")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.unpin"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET RENAMED
+ embeds.add(new api.ODEmbed("openticket:rename-message"))
+ embeds.get("openticket:rename-message").workers.add(
+ new api.ODWorker("openticket:rename-message",0,async (instance,params,source) => {
+ const {user,ticket,reason,data} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🔄",lang.getTranslation("actions.titles.rename")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.rename",["`#"+data+"`"]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET MOVED
+ embeds.add(new api.ODEmbed("openticket:move-message"))
+ embeds.get("openticket:move-message").workers.add(
+ new api.ODWorker("openticket:move-message",0,async (instance,params,source) => {
+ const {user,ticket,reason,data} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🔀",lang.getTranslation("actions.titles.move")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.move",["`"+data.get("openticket:name").value+"`"]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET USER ADDED
+ embeds.add(new api.ODEmbed("openticket:add-message"))
+ embeds.get("openticket:add-message").workers.add(
+ new api.ODWorker("openticket:add-message",0,async (instance,params,source) => {
+ const {user,ticket,reason,data} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("👤",lang.getTranslation("actions.titles.add")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.add",[discord.userMention(data.id)]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET USER REMOVED
+ embeds.add(new api.ODEmbed("openticket:remove-message"))
+ embeds.get("openticket:remove-message").workers.add(
+ new api.ODWorker("openticket:remove-message",0,async (instance,params,source) => {
+ const {user,ticket,reason,data} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("👤",lang.getTranslation("actions.titles.remove")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.remove",[discord.userMention(data.id)]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //TICKET ACTION DM
+ embeds.add(new api.ODEmbed("openticket:ticket-action-dm"))
+ embeds.get("openticket:ticket-action-dm").workers.add(
+ new api.ODWorker("openticket:ticket-action-dm",0,async (instance,params,source) => {
+ const {user,mode,ticket,reason,additionalData} = params
+ const channel = await openticket.tickets.getTicketChannel(ticket)
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTimestamp(new Date())
+ instance.addFields({name:lang.getTranslation("params.uppercase.ticket")+":",value:"```#"+(channel ? channel.name : "")+"```",inline:false})
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```",inline:false})
+
+ if (mode == "close"){
+ instance.setTitle(utilities.emojiTitle("🔒",lang.getTranslation("actions.titles.close")))
+ instance.setDescription(lang.getTranslation("actions.logs.closeDm"))
+ }else if (mode == "reopen"){
+ instance.setTitle(utilities.emojiTitle("🔓",lang.getTranslation("actions.titles.reopen")))
+ instance.setDescription(lang.getTranslation("actions.logs.reopenDm"))
+ }else if (mode == "delete"){
+ instance.setTitle(utilities.emojiTitle("🗑️",lang.getTranslation("actions.titles.delete")))
+ instance.setDescription(lang.getTranslation("actions.logs.deleteDm"))
+ }else if (mode == "claim"){
+ instance.setTitle(utilities.emojiTitle("👋",lang.getTranslation("actions.titles.claim")))
+ instance.setDescription(lang.getTranslation("actions.logs.claimDm"))
+ }else if (mode == "unclaim"){
+ instance.setTitle(utilities.emojiTitle("↩️",lang.getTranslation("actions.titles.unclaim")))
+ instance.setDescription(lang.getTranslation("actions.logs.unclaimDm"))
+ }else if (mode == "pin"){
+ instance.setTitle(utilities.emojiTitle("📌",lang.getTranslation("actions.titles.pin")))
+ instance.setDescription(lang.getTranslation("actions.logs.pinDm"))
+ }else if (mode == "unpin"){
+ instance.setTitle(utilities.emojiTitle("📌",lang.getTranslation("actions.titles.unpin")))
+ instance.setDescription(lang.getTranslation("actions.logs.unpinDm"))
+ }else if (mode == "rename"){
+ instance.setTitle(utilities.emojiTitle("🔄",lang.getTranslation("actions.titles.rename")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.renameDm",["`#"+(typeof additionalData == "string" ? additionalData : "")+"`"]))
+ }else if (mode == "move"){
+ instance.setTitle(utilities.emojiTitle("🔀",lang.getTranslation("actions.titles.move")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.moveDm",["`"+(additionalData instanceof api.ODTicketOption ? additionalData.get("openticket:name").value : "")+"`"]))
+ }else if (mode == "add"){
+ instance.setTitle(utilities.emojiTitle("👤",lang.getTranslation("actions.titles.add")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.addDm",[(additionalData instanceof discord.User ? discord.userMention(additionalData.id) : "")]))
+ }else if (mode == "remove"){
+ instance.setTitle(utilities.emojiTitle("👤",lang.getTranslation("actions.titles.remove")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.removeDm",[(additionalData instanceof discord.User ? discord.userMention(additionalData.id) : "")]))
+ }
+ })
+ )
+
+ //TICKET ACTION LOGS
+ embeds.add(new api.ODEmbed("openticket:ticket-action-logs"))
+ embeds.get("openticket:ticket-action-logs").workers.add(
+ new api.ODWorker("openticket:ticket-action-logs",0,async (instance,params,source) => {
+ const {user,mode,ticket,reason,additionalData} = params
+ const channel = await openticket.tickets.getTicketChannel(ticket)
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setThumbnail(user.displayAvatarURL())
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.addFields(
+ {name:lang.getTranslation("params.uppercase.ticket")+":",value:"```#"+(channel ? channel.name : "")+"```",inline:false},
+ //TODO TRANSLATION!!!
+ {name:"Option"+":",value:"```"+(ticket.option.get("openticket:name").value)+"```",inline:false},
+ )
+ if (reason) instance.addFields({name:"Reason:",value:"```"+reason+"```",inline:false})
+
+ if (mode == "close"){
+ instance.setTitle(utilities.emojiTitle("🔒",lang.getTranslation("actions.titles.close")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.closeLog",[discord.userMention(user.id)]))
+ }else if (mode == "reopen"){
+ instance.setTitle(utilities.emojiTitle("🔓",lang.getTranslation("actions.titles.reopen")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.reopenLog",[discord.userMention(user.id)]))
+ }else if (mode == "delete"){
+ instance.setTitle(utilities.emojiTitle("🗑️",lang.getTranslation("actions.titles.delete")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.deleteLog",[discord.userMention(user.id)]))
+ }else if (mode == "claim"){
+ instance.setTitle(utilities.emojiTitle("👋",lang.getTranslation("actions.titles.claim")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.claimLog",[discord.userMention(user.id)]))
+ }else if (mode == "unclaim"){
+ instance.setTitle(utilities.emojiTitle("↩️",lang.getTranslation("actions.titles.unclaim")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.unclaimLog",[discord.userMention(user.id)]))
+ }else if (mode == "pin"){
+ instance.setTitle(utilities.emojiTitle("📌",lang.getTranslation("actions.titles.pin")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.pinLog",[discord.userMention(user.id)]))
+ }else if (mode == "unpin"){
+ instance.setTitle(utilities.emojiTitle("📌",lang.getTranslation("actions.titles.unpin")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.unpinLog",[discord.userMention(user.id)]))
+ }else if (mode == "rename"){
+ instance.setTitle(utilities.emojiTitle("🔄",lang.getTranslation("actions.titles.rename")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.renameLog",["`#"+(typeof additionalData == "string" ? additionalData : "")+"`",discord.userMention(user.id)]))
+ }else if (mode == "move"){
+ instance.setTitle(utilities.emojiTitle("🔀",lang.getTranslation("actions.titles.move")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.moveLog",["`"+(additionalData instanceof api.ODTicketOption ? additionalData.get("openticket:name").value : "")+"`",discord.userMention(user.id)]))
+ }else if (mode == "add"){
+ instance.setTitle(utilities.emojiTitle("👤",lang.getTranslation("actions.titles.add")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.addLog",[(additionalData instanceof discord.User ? discord.userMention(additionalData.id) : ""),discord.userMention(user.id)]))
+ }else if (mode == "remove"){
+ instance.setTitle(utilities.emojiTitle("👤",lang.getTranslation("actions.titles.remove")))
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.removeLog",[(additionalData instanceof discord.User ? discord.userMention(additionalData.id) : ""),discord.userMention(user.id)]))
+ }
+ })
+ )
+}
+
+const blacklistEmbeds = () => {
+ //BLACKLIST VIEW
+ embeds.add(new api.ODEmbed("openticket:blacklist-view"))
+ embeds.get("openticket:blacklist-view").workers.add(
+ new api.ODWorker("openticket:blacklist-view",0,async (instance,params,source) => {
+ const {user} = params
+
+ const renderedUsers: string[] = []
+ openticket.blacklist.getAll().forEach((blacklist) => renderedUsers.push(discord.userMention(blacklist.id.value)+" - "+(blacklist.reason ? blacklist.reason : "/")))
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🚫",lang.getTranslation("actions.titles.blacklistView")))
+
+ if (renderedUsers.length > 0) instance.setDescription(renderedUsers.join("\n"))
+ else{
+ instance.setDescription("*"+lang.getTranslation("actions.descriptions.blacklistViewEmpty")+"*")
+ instance.setFooter(lang.getTranslation("actions.descriptions.blacklistViewTip"))
+ }
+ })
+ )
+ //BLACKLIST GET
+ embeds.add(new api.ODEmbed("openticket:blacklist-get"))
+ embeds.get("openticket:blacklist-get").workers.add(
+ new api.ODWorker("openticket:blacklist-get",0,async (instance,params,source) => {
+ const {user,data} = params
+ const blacklist = openticket.blacklist.get(data.id)
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🚫",lang.getTranslation("actions.titles.blacklistGet")))
+
+ if (blacklist){
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.blacklistGetSuccess",[discord.userMention(data.id)]))
+ if (blacklist.reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+blacklist.reason+"```"})
+
+ }else instance.setDescription("*"+lang.getTranslationWithParams("actions.descriptions.blacklistGetEmpty",[discord.userMention(data.id)])+"*")
+ })
+ )
+
+ //BLACKLIST ADD
+ embeds.add(new api.ODEmbed("openticket:blacklist-add"))
+ embeds.get("openticket:blacklist-add").workers.add(
+ new api.ODWorker("openticket:blacklist-add",0,async (instance,params,source) => {
+ const {user,data,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🚫",lang.getTranslation("actions.titles.blacklistAdd")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.blacklistAdd",[discord.userMention(data.id)]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //BLACKLIST REMOVE
+ embeds.add(new api.ODEmbed("openticket:blacklist-remove"))
+ embeds.get("openticket:blacklist-remove").workers.add(
+ new api.ODWorker("openticket:blacklist-remove",0,async (instance,params,source) => {
+ const {user,data,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🆓",lang.getTranslation("actions.titles.blacklistRemove")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.blacklistRemove",[discord.userMention(data.id)]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //BLACKLIST DM
+ embeds.add(new api.ODEmbed("openticket:blacklist-dm"))
+ embeds.get("openticket:blacklist-dm").workers.add(
+ new api.ODWorker("openticket:blacklist-dm",0,async (instance,params,source) => {
+ const {user,mode,data,reason} = params
+
+ const title = (mode == "add") ? lang.getTranslation("actions.titles.blacklistAddDm") : lang.getTranslation("actions.titles.blacklistRemoveDm")
+ const text = (mode == "add") ? lang.getTranslation("actions.logs.blacklistAddDm") : lang.getTranslation("actions.logs.blacklistRemoveDm")
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle((mode == "add") ? "🚫" : "🆓",title))
+ instance.setTimestamp(new Date())
+ instance.setDescription(text)
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```",inline:false})
+ })
+ )
+
+ //BLACKLIST LOGS
+ embeds.add(new api.ODEmbed("openticket:blacklist-logs"))
+ embeds.get("openticket:blacklist-logs").workers.add(
+ new api.ODWorker("openticket:blacklist-logs",0,async (instance,params,source) => {
+ const {user,mode,data,reason} = params
+
+ const title = (mode == "add") ? lang.getTranslation("actions.titles.blacklistAdd") : lang.getTranslation("actions.titles.blacklistRemove")
+ const text = (mode == "add") ? lang.getTranslationWithParams("actions.logs.blacklistAddLog",[discord.userMention(data.id),discord.userMention(user.id)]) : lang.getTranslationWithParams("actions.logs.blacklistRemoveLog",[discord.userMention(data.id),discord.userMention(user.id)])
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle((mode == "add") ? "🚫" : "🆓",title))
+ instance.setThumbnail(data.displayAvatarURL())
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.setDescription(text)
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```",inline:false})
+ })
+ )
+}
+
+const transcriptEmbeds = () => {
+ //TRANSCRIPT TEXT READY
+ embeds.add(new api.ODEmbed("openticket:transcript-text-ready"))
+ embeds.get("openticket:transcript-text-ready").workers.add(
+ new api.ODWorker("openticket:transcript-text-ready",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("📄",lang.getTranslation("transcripts.success.ready")))
+ instance.setTimestamp(new Date())
+ instance.addFields({name:lang.getTranslation("params.uppercase.ticket")+":",value:"#"+channel.name,inline:false})
+
+ const creatorId = ticket.get("openticket:opened-by").value
+ if (creatorId){
+ try{
+ const creator = await channel.client.users.fetch(creatorId)
+ instance.addFields({name:lang.getTranslation("params.uppercase.creator")+":",value:creator.username+" ("+discord.userMention(creator.id)+")"})
+ instance.setThumbnail(creator.displayAvatarURL())
+ }catch{}
+ }
+
+ if (source == "channel") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdChannel",[lang.getTranslation("params.lowercase.text")]))
+ else if (source == "creator-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdCreator",[lang.getTranslation("params.lowercase.text")]))
+ else if (source == "participant-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdParticipant",[lang.getTranslation("params.lowercase.text")]))
+ else if (source == "active-admin-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdActiveAdmin",[lang.getTranslation("params.lowercase.text")]))
+ else if (source == "every-admin-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdEveryAdmin",[lang.getTranslation("params.lowercase.text")]))
+ else instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdOther",[lang.getTranslation("params.lowercase.text")]))
+ })
+ )
+
+ //TRANSCRIPT HTML READY
+ embeds.add(new api.ODEmbed("openticket:transcript-html-ready"))
+ embeds.get("openticket:transcript-html-ready").workers.add(
+ new api.ODWorker("openticket:transcript-html-ready",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,result} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("📄",lang.getTranslation("transcripts.success.ready")))
+ instance.setTimestamp(new Date())
+ instance.addFields({name:lang.getTranslation("params.uppercase.ticket")+":",value:"#"+channel.name,inline:false})
+ if (result.data) instance.setUrl(result.data.url)
+
+ const creatorId = ticket.get("openticket:opened-by").value
+ if (creatorId){
+ try{
+ const creator = await channel.client.users.fetch(creatorId)
+ instance.addFields({name:lang.getTranslation("params.uppercase.creator")+":",value:creator.username+" ("+discord.userMention(creator.id)+")"})
+ instance.setThumbnail(creator.displayAvatarURL())
+ }catch{}
+ }
+
+ if (source == "channel") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdChannel",[lang.getTranslation("params.lowercase.html")]))
+ else if (source == "creator-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdCreator",[lang.getTranslation("params.lowercase.html")]))
+ else if (source == "participant-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdParticipant",[lang.getTranslation("params.lowercase.html")]))
+ else if (source == "active-admin-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdActiveAdmin",[lang.getTranslation("params.lowercase.html")]))
+ else if (source == "every-admin-dm") instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdEveryAdmin",[lang.getTranslation("params.lowercase.html")]))
+ else instance.setDescription(lang.getTranslationWithParams("transcripts.success.createdOther",[lang.getTranslation("params.lowercase.html")]))
+ })
+ )
+
+ //TRANSCRIPT HTML PROGRESS
+ embeds.add(new api.ODEmbed("openticket:transcript-html-progress"))
+ embeds.get("openticket:transcript-html-progress").workers.add(
+ new api.ODWorker("openticket:transcript-html-progress",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,remaining} = params
+
+ const remainingDate = new Date(new Date().getTime()+remaining)
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("📄",lang.getTranslation("transcripts.success.ready")))
+ instance.setDescription(lang.getTranslation("transcripts.success.htmlProgress"))
+ instance.setTimestamp(new Date())
+ instance.addFields({name:lang.getTranslation("params.uppercase.remaining")+":",value:discord.time(remainingDate,"R"),inline:false})
+ instance.addFields({name:lang.getTranslation("params.uppercase.ticket")+":",value:"#"+channel.name,inline:false})
+
+ const creatorId = ticket.get("openticket:opened-by").value
+ if (creatorId){
+ try{
+ const creator = await channel.client.users.fetch(creatorId)
+ instance.addFields({name:lang.getTranslation("params.uppercase.creator")+":",value:creator.username+" ("+discord.userMention(creator.id)+")"})
+ instance.setThumbnail(creator.displayAvatarURL())
+ }catch{}
+ }
+ })
+ )
+
+ //TRANSCRIPT ERROR
+ embeds.add(new api.ODEmbed("openticket:transcript-error"))
+ embeds.get("openticket:transcript-error").workers.add(
+ new api.ODWorker("openticket:transcript-error",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,reason} = params
+
+ instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("❌","Transcript Error")) //TODO TRANSLATION!!!
+ instance.setTimestamp(new Date())
+ instance.setDescription(lang.getTranslation("transcripts.errors.error"))
+ instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```",inline:false})
+ })
+ )
+}
+
+const roleEmbeds = () => {
+ //REACTION ROLE
+ embeds.add(new api.ODEmbed("openticket:reaction-role"))
+ embeds.get("openticket:reaction-role").workers.add(
+ new api.ODWorker("openticket:reaction-role",0,async (instance,params,source) => {
+ const {guild,user,role,result} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("🎨",lang.getTranslation("actions.titles.roles")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+
+ const newResult = result.filter((r) => r.action != null).sort((a,b) => {
+ if (a.action == "added" && b.action == "removed") return -1
+ else if (a.action == "removed" && b.action == "added") return 1
+ else return 0
+ }).map((r) => {
+ return (r.action == "added") ? "🟢 "+lang.getTranslation("params.uppercase.added")+" "+discord.roleMention(r.role.id) : "🔴 "+lang.getTranslation("params.uppercase.removed")+" "+discord.roleMention(r.role.id)
+ })
+
+ if (newResult.length > 0) instance.setDescription(newResult.join("\n"))
+ else instance.setDescription(lang.getTranslation("actions.descriptions.rolesEmpty"))
+ })
+ )
+}
+
+const clearEmbeds = () => {
+ //CLEAR VERIFY MESSAGE
+ embeds.add(new api.ODEmbed("openticket:clear-verify-message"))
+ embeds.get("openticket:clear-verify-message").workers.add(
+ new api.ODWorker("openticket:clear-verify-message",0,async (instance,params,source) => {
+ const {guild,channel,user,filter,list} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⚠️","Clear Tickets")) //TODO TRANSLATION!!!
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.setDescription(lang.getTranslation("actions.descriptions.clearVerify"))
+ instance.addFields(
+ {name:lang.getTranslation("params.uppercase.filter")+":",value:filter,inline:false},
+ {name:lang.getTranslation("params.uppercase.tickets")+":",value:"`"+list.join("`\n`")+"`",inline:false}
+ )
+ })
+ )
+
+ //CLEAR MESSAGE
+ embeds.add(new api.ODEmbed("openticket:clear-message"))
+ embeds.get("openticket:clear-message").workers.add(
+ new api.ODWorker("openticket:clear-message",0,async (instance,params,source) => {
+ const {guild,channel,user,filter,list} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⚠️",lang.getTranslation("actions.titles.clear")))
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.clearReady",[list.length.toString()]))
+ instance.addFields(
+ {name:lang.getTranslation("params.uppercase.tickets")+":",value:"`"+list.join("`\n`")+"`",inline:false}
+ )
+ })
+ )
+
+ //CLEAR LOGS
+ embeds.add(new api.ODEmbed("openticket:clear-logs"))
+ embeds.get("openticket:clear-logs").workers.add(
+ new api.ODWorker("openticket:clear-logs",0,async (instance,params,source) => {
+ const {guild,channel,user,filter,list} = params
+
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⚠️",lang.getTranslation("actions.titles.clear")))
+ instance.setThumbnail(user.displayAvatarURL())
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setTimestamp(new Date())
+ instance.setDescription(lang.getTranslationWithParams("actions.logs.clearLog",[list.length.toString(),discord.userMention(user.id)]))
+ instance.addFields(
+ {name:lang.getTranslation("params.uppercase.tickets")+":",value:"`"+list.join("`\n`")+"`",inline:false}
+ )
+ })
+ )
+}
+
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+//TRANSLATION FINISHED UNTIL HERE
+
+const autoEmbeds = () => {
+ //AUTOCLOSE MESSAGE
+ embeds.add(new api.ODEmbed("openticket:autoclose-message"))
+ embeds.get("openticket:autoclose-message").workers.add(
+ new api.ODWorker("openticket:autoclose-message",0,async (instance,params,source) => {
+ const {user,ticket} = params
+ const hours: number = ticket.get("openticket:autoclose-hours").value
+ const description = (source == "leave") ? lang.getTranslation("actions.descriptions.autocloseLeave") : lang.getTranslationWithParams("actions.descriptions.autocloseTimeout",[hours.toString()])
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⏱️",lang.getTranslation("actions.titles.autoclose")))
+ instance.setDescription(description)
+ instance.setTimestamp(new Date())
+ })
+ )
+
+ //AUTODELETE MESSAGE
+ embeds.add(new api.ODEmbed("openticket:autodelete-message"))
+ embeds.get("openticket:autodelete-message").workers.add(
+ new api.ODWorker("openticket:autodelete-message",0,async (instance,params,source) => {
+ const {user,ticket} = params
+ const days: number = ticket.get("openticket:autodelete-days").value
+ const description = (source == "leave") ? lang.getTranslation("actions.descriptions.autodeleteLeave") : lang.getTranslationWithParams("actions.descriptions.autodeleteTimeout",[days.toString()])
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⏱️",lang.getTranslation("actions.titles.autodelete")))
+ instance.setDescription(description)
+ instance.setTimestamp(new Date())
+ })
+ )
+
+ //AUTOCLOSE ENABLE
+ embeds.add(new api.ODEmbed("openticket:autoclose-enable"))
+ embeds.get("openticket:autoclose-enable").workers.add(
+ new api.ODWorker("openticket:autoclose-enable",0,async (instance,params,source) => {
+ const {user,ticket,reason,time} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⏱️",lang.getTranslation("actions.titles.autocloseEnabled")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.autocloseEnabled",[time.toString()]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //AUTODELETE ENABLE
+ embeds.add(new api.ODEmbed("openticket:autodelete-enable"))
+ embeds.get("openticket:autodelete-enable").workers.add(
+ new api.ODWorker("openticket:autodelete-enable",0,async (instance,params,source) => {
+ const {user,ticket,reason,time} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⏱️",lang.getTranslation("actions.titles.autodeleteEnabled")))
+ instance.setDescription(lang.getTranslationWithParams("actions.descriptions.autodeleteEnabled",[time.toString()]))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //AUTOCLOSE DISABLE
+ embeds.add(new api.ODEmbed("openticket:autoclose-disable"))
+ embeds.get("openticket:autoclose-disable").workers.add(
+ new api.ODWorker("openticket:autoclose-disable",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⏱️",lang.getTranslation("actions.titles.autocloseDisabled")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.autocloseDisabled"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+
+ //AUTODELETE DISABLE
+ embeds.add(new api.ODEmbed("openticket:autodelete-disable"))
+ embeds.get("openticket:autodelete-disable").workers.add(
+ new api.ODWorker("openticket:autodelete-disable",0,async (instance,params,source) => {
+ const {user,ticket,reason} = params
+
+ instance.setAuthor(user.displayName,user.displayAvatarURL())
+ instance.setColor(generalConfig.data.mainColor)
+ instance.setTitle(utilities.emojiTitle("⏱️",lang.getTranslation("actions.titles.autodeleteDisabled")))
+ instance.setDescription(lang.getTranslation("actions.descriptions.autodeleteDisabled"))
+ if (reason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+reason+"```"})
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/builders/files.ts b/src/builders/files.ts
new file mode 100644
index 0000000..ae00fca
--- /dev/null
+++ b/src/builders/files.ts
@@ -0,0 +1,45 @@
+///////////////////////////////////////
+//FILE BUILDERS
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const files = openticket.builders.files
+const lang = openticket.languages
+const transcriptConfig = openticket.configs.get("openticket:transcripts")
+
+export const registerAllFiles = async () => {
+ transcriptFiles()
+}
+
+
+const transcriptFiles = () => {
+ //TEXT TRANSCRIPT
+ files.add(new api.ODFile("openticket:text-transcript"))
+ files.get("openticket:text-transcript").workers.add(
+ new api.ODWorker("openticket:text-transcript",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,result} = params
+
+ const fileMode = transcriptConfig.data.textTranscriptStyle.fileMode
+ const customName = transcriptConfig.data.textTranscriptStyle.customFileName
+
+ const creatorId = ticket.get("openticket:opened-by").value ?? "unknown-creator-id"
+ const creator = (await openticket.tickets.getTicketUser(ticket,"creator"))
+
+ if (fileMode == "custom") instance.setName(customName.split(".")[0]+".txt")
+ else if (fileMode == "user-id") instance.setName(creatorId+".txt")
+ else if (fileMode == "user-name") instance.setName((creator ? creator.username : "unknown-creator-name")+".txt")
+ else if (fileMode == "channel-id") instance.setName(channel.id+".txt")
+ else if (fileMode == "channel-name") instance.setName(channel.name+".txt")
+ else instance.setName("transcript.txt")
+
+ instance.setDescription(lang.getTranslation("transcripts.success.textFileDescription"))
+
+ if (compiler.id.value != "openticket:text-compiler" || !result.data || typeof result.data.contents != "string"){
+ instance.setContents("")
+ return
+ }
+ instance.setContents(result.data.contents)
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/builders/messages.ts b/src/builders/messages.ts
new file mode 100644
index 0000000..25dd7a3
--- /dev/null
+++ b/src/builders/messages.ts
@@ -0,0 +1,1055 @@
+///////////////////////////////////////
+//MESSAGE BUILDERS
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const messages = openticket.builders.messages
+const buttons = openticket.builders.buttons
+const dropdowns = openticket.builders.dropdowns
+const files = openticket.builders.files
+const embeds = openticket.builders.embeds
+const lang = openticket.languages
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerAllMessages = async () => {
+ verifyBarMessages()
+ errorMessages()
+ helpMenuMessages()
+ statsMessages()
+ panelMessages()
+ ticketMessages()
+ blacklistMessages()
+ transcriptMessages()
+ roleMessages()
+ clearMessages()
+ autoMessages()
+}
+
+const verifyBarMessages = () => {
+ //VERIFYBAR TICKET MESSAGE
+ messages.add(new api.ODMessage("openticket:verifybar-ticket-message"))
+ messages.get("openticket:verifybar-ticket-message").workers.add(
+ new api.ODWorker("openticket:verifybar-ticket-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-ticket-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-ticket-message`")
+ return
+ }
+ const option = ticket.option
+
+ //add pings
+ const pingOptions = option.get("openticket:ticket-message-ping").value
+ const pings: string[] = [discord.userMention(user.id)]
+ if (pingOptions["@everyone"]) pings.push("@everyone")
+ if (pingOptions["@here"]) pings.push("@here")
+ pingOptions.custom.forEach((ping) => pings.push(discord.roleMention(ping)))
+ const pingText = (pings.length > 0) ? pings.join(" ")+"\n" : ""
+
+ //add text
+ const text = option.get("openticket:ticket-message-text").value
+ if (text !== "") instance.setContent(pingText+text)
+ else instance.setContent(pingText)
+
+ //add embed
+ if (option.get("openticket:ticket-message-embed").value.enabled) instance.addEmbed(await embeds.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:claim-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:unclaim-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:pin-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:unpin-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:close-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:reopen-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:delete-ticket-ticket-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
+ }
+ })
+ )
+
+ //TICKET CLOSED
+ messages.add(new api.ODMessage("openticket:verifybar-close-message"))
+ messages.get("openticket:verifybar-close-message").workers.add(
+ new api.ODWorker("openticket:verifybar-close-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-close-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-close-message`")
+ return
+ }
+
+ const rawReason = (originalMessage.embeds[0] && originalMessage.embeds[0].fields[0]) ? originalMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:close-message").build("other",{guild,channel,user,ticket,reason}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:reopen-ticket-close-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:delete-ticket-close-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
+ }
+ })
+ )
+
+ //TICKET REOPENED
+ messages.add(new api.ODMessage("openticket:verifybar-reopen-message"))
+ messages.get("openticket:verifybar-reopen-message").workers.add(
+ new api.ODWorker("openticket:verifybar-reopen-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-reopen-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-reopen-message`")
+ return
+ }
+
+ const rawReason = (originalMessage.embeds[0] && originalMessage.embeds[0].fields[0]) ? originalMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:close-ticket-reopen-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:delete-ticket-reopen-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
+ }
+ })
+ )
+
+ //TICKET CLAIM
+ messages.add(new api.ODMessage("openticket:verifybar-claim-message"))
+ messages.get("openticket:verifybar-claim-message").workers.add(
+ new api.ODWorker("openticket:verifybar-claim-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-claim-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-claim-message`")
+ return
+ }
+
+ const rawReason = (originalMessage.embeds[0] && originalMessage.embeds[0].fields[0]) ? originalMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:claim-message").build("other",{guild,channel,user,ticket,reason}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:unclaim-ticket-claim-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ }
+ })
+ )
+
+ //TICKET UNCLAIM
+ messages.add(new api.ODMessage("openticket:verifybar-unclaim-message"))
+ messages.get("openticket:verifybar-unclaim-message").workers.add(
+ new api.ODWorker("openticket:verifybar-unclaim-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-unclaim-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-unclaim-message`")
+ return
+ }
+
+ const rawReason = (originalMessage.embeds[0] && originalMessage.embeds[0].fields[0]) ? originalMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:unclaim-message").build("other",{guild,channel,user,ticket,reason}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:claim-ticket-unclaim-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ }
+ })
+ )
+
+ //TICKET PIN
+ messages.add(new api.ODMessage("openticket:verifybar-pin-message"))
+ messages.get("openticket:verifybar-pin-message").workers.add(
+ new api.ODWorker("openticket:verifybar-pin-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-pin-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-pin-message`")
+ return
+ }
+
+ const rawReason = (originalMessage.embeds[0] && originalMessage.embeds[0].fields[0]) ? originalMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:pin-message").build("other",{guild,channel,user,ticket,reason}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:unpin-ticket-pin-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ }
+ })
+ )
+
+ //TICKET UNPIN
+ messages.add(new api.ODMessage("openticket:verifybar-unpin-message"))
+ messages.get("openticket:verifybar-unpin-message").workers.add(
+ new api.ODWorker("openticket:verifybar-unpin-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-unpin-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-unpin-message`")
+ return
+ }
+
+ const rawReason = (originalMessage.embeds[0] && originalMessage.embeds[0].fields[0]) ? originalMessage.embeds[0].fields[0].value : null
+ const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:unpin-message").build("other",{guild,channel,user,ticket,reason}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:pin-ticket-unpin-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ }
+ })
+ )
+
+ //TICKET AUTOCLOSED
+ messages.add(new api.ODMessage("openticket:verifybar-autoclose-message"))
+ messages.get("openticket:verifybar-autoclose-message").workers.add(
+ new api.ODWorker("openticket:verifybar-autoclose-message",0,async (instance,params,source) => {
+ const {guild,channel,user,verifybar,originalMessage} = params
+ if (!guild || channel.isDMBased()){
+ instance.setContent("ODError: Not In Guild => `openticket:verifybar-autoclose-message`")
+ return
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket){
+ instance.setContent("ODError: Unknown Ticket => `openticket:verifybar-autoclose-message`")
+ return
+ }
+
+ //add embed
+ instance.addEmbed(await embeds.getSafe("openticket:autoclose-message").build("other",{guild,channel,user,ticket}))
+
+ //add verifybar components
+ if (verifybar.id.value == "openticket:reopen-ticket-autoclose-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+
+ }else if (verifybar.id.value == "openticket:delete-ticket-autoclose-message"){
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar}))
+ instance.addComponent(await buttons.getSafe("openticket:verifybar-failure").build("verifybar",{guild,channel,user,verifybar}))
+ if (generalConfig.data.system.enableTicketActionWithReason) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"reason",customEmoji:"✏️",customLabel:lang.getTranslation("actions.buttons.withReason"),customColor:"blue"}))
+ if (generalConfig.data.system.enableDeleteWithoutTranscript) instance.addComponent(await buttons.getSafe("openticket:verifybar-success").build("verifybar",{guild,channel,user,verifybar,customData:"no-transcript",customEmoji:"📄",customLabel:"Without Transcript",customColor:"red"}))
+ }
+ })
+ )
+}
+
+const errorMessages = () => {
+ //ERROR
+ messages.add(new api.ODMessage("openticket:error"))
+ messages.get("openticket:error").workers.add(
+ new api.ODWorker("openticket:error",0,async (instance,params,source) => {
+ const {guild,channel,user,error,layout} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error").build(source,{guild,channel,user,error,layout}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR OPTION MISSING
+ messages.add(new api.ODMessage("openticket:error-option-missing"))
+ messages.get("openticket:error-option-missing").workers.add(
+ new api.ODWorker("openticket:error-option-missing",0,async (instance,params,source) => {
+ const {guild,channel,user,error} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-option-missing").build(source,{guild,channel,user,error}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR OPTION INVALID
+ messages.add(new api.ODMessage("openticket:error-option-invalid"))
+ messages.get("openticket:error-option-invalid").workers.add(
+ new api.ODWorker("openticket:error-option-invalid",0,async (instance,params,source) => {
+ const {guild,channel,user,error} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-option-invalid").build(source,{guild,channel,user,error}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR UNKNOWN COMMAND
+ messages.add(new api.ODMessage("openticket:error-unknown-command"))
+ messages.get("openticket:error-unknown-command").workers.add(
+ new api.ODWorker("openticket:error-unknown-command",0,async (instance,params,source) => {
+ const {guild,channel,user,error} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-unknown-command").build(source,{guild,channel,user,error}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR NO PERMISSIONS
+ messages.add(new api.ODMessage("openticket:error-no-permissions"))
+ messages.get("openticket:error-no-permissions").workers.add(
+ new api.ODWorker("openticket:error-no-permissions",0,async (instance,params,source) => {
+ const {guild,channel,user,permissions} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-no-permissions").build(source,{guild,channel,user,permissions}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR NO PERMISSIONS COOLDOWN
+ messages.add(new api.ODMessage("openticket:error-no-permissions-cooldown"))
+ messages.get("openticket:error-no-permissions-cooldown").workers.add(
+ new api.ODWorker("openticket:error-no-permissions-cooldown",0,async (instance,params,source) => {
+ const {guild,channel,user,until} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-no-permissions-cooldown").build(source,{guild,channel,user,until}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR NO PERMISSIONS BLACKLISTED
+ messages.add(new api.ODMessage("openticket:error-no-permissions-blacklisted"))
+ messages.get("openticket:error-no-permissions-blacklisted").workers.add(
+ new api.ODWorker("openticket:error-no-permissions-blacklisted",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-no-permissions-blacklisted").build(source,{guild,channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR NO PERMISSIONS LIMITS
+ messages.add(new api.ODMessage("openticket:error-no-permissions-limits"))
+ messages.get("openticket:error-no-permissions-limits").workers.add(
+ new api.ODWorker("openticket:error-no-permissions-limits",0,async (instance,params,source) => {
+ const {guild,channel,user,limit} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-no-permissions-limits").build(source,{guild,channel,user,limit}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR RESPONDER TIMEOUT
+ messages.add(new api.ODMessage("openticket:error-responder-timeout"))
+ messages.get("openticket:error-responder-timeout").workers.add(
+ new api.ODWorker("openticket:error-responder-timeout",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-responder-timeout").build(source,{guild,channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR TICKET UNKNOWN
+ messages.add(new api.ODMessage("openticket:error-ticket-unknown"))
+ messages.get("openticket:error-ticket-unknown").workers.add(
+ new api.ODWorker("openticket:error-ticket-unknown",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-ticket-unknown").build(source,{guild,channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR TICKET DEPRECATED
+ messages.add(new api.ODMessage("openticket:error-ticket-deprecated"))
+ messages.get("openticket:error-ticket-deprecated").workers.add(
+ new api.ODWorker("openticket:error-ticket-deprecated",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-ticket-deprecated").build(source,{guild,channel,user}))
+ instance.addComponent(await buttons.getSafe("openticket:error-ticket-deprecated-transcript").build(source,{}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR OPTION UNKNOWN
+ messages.add(new api.ODMessage("openticket:error-option-unknown"))
+ messages.get("openticket:error-option-unknown").workers.add(
+ new api.ODWorker("openticket:error-option-unknown",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-option-unknown").build(source,{guild,channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR PANEL UNKNOWN
+ messages.add(new api.ODMessage("openticket:error-panel-unknown"))
+ messages.get("openticket:error-panel-unknown").workers.add(
+ new api.ODWorker("openticket:error-panel-unknown",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-panel-unknown").build(source,{guild,channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR NOD IN GUILD
+ messages.add(new api.ODMessage("openticket:error-not-in-guild"))
+ messages.get("openticket:error-not-in-guild").workers.add(
+ new api.ODWorker("openticket:error-not-in-guild",0,async (instance,params,source) => {
+ const {channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-not-in-guild").build(source,{channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR CHANNEL RENAME
+ messages.add(new api.ODMessage("openticket:error-channel-rename"))
+ messages.get("openticket:error-channel-rename").workers.add(
+ new api.ODWorker("openticket:error-channel-rename",0,async (instance,params,source) => {
+ const {guild,channel,user,originalName,newName} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-channel-rename").build(source,{guild,channel,user,originalName,newName}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //ERROR TICKET BUSY
+ messages.add(new api.ODMessage("openticket:error-ticket-busy"))
+ messages.get("openticket:error-ticket-busy").workers.add(
+ new api.ODWorker("openticket:error-ticket-busy",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:error-ticket-busy").build(source,{guild,channel,user}))
+ instance.setEphemeral(true)
+ })
+ )
+}
+
+const helpMenuMessages = () => {
+ //HELP MENU
+ messages.add(new api.ODMessage("openticket:help-menu"))
+ messages.get("openticket:help-menu").workers.add(
+ new api.ODWorker("openticket:help-menu",0,async (instance,params,source) => {
+ const {mode,page} = params
+ const totalPages = (await openticket.helpmenu.render(mode)).length
+
+ const embed = await embeds.getSafe("openticket:help-menu").build(source,{mode,page})
+ instance.addEmbed(embed)
+ if (totalPages > 1){
+ //when more than 1 page
+ instance.addComponent(await buttons.getSafe("openticket:help-menu-previous").build(source,{mode,page}))
+ instance.addComponent(await buttons.getSafe("openticket:help-menu-page").build(source,{mode,page}))
+ instance.addComponent(await buttons.getSafe("openticket:help-menu-next").build(source,{mode,page}))
+ instance.addComponent(buttons.getNewLine("openticket:help-menu-divider"))
+ }
+ if (generalConfig.data.textCommands && generalConfig.data.slashCommands) instance.addComponent(await buttons.get("openticket:help-menu-switch").build(source,{mode,page}))
+ })
+ )
+}
+
+const statsMessages = () => {
+ //STATS GLOBAL
+ messages.add(new api.ODMessage("openticket:stats-global"))
+ messages.get("openticket:stats-global").workers.add(
+ new api.ODWorker("openticket:stats-global",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:stats-global").build(source,{guild,channel,user}))
+ })
+ )
+
+ //STATS TICKET
+ messages.add(new api.ODMessage("openticket:stats-ticket"))
+ messages.get("openticket:stats-ticket").workers.add(
+ new api.ODWorker("openticket:stats-ticket",0,async (instance,params,source) => {
+ const {guild,channel,user,scopeData} = params
+ instance.addEmbed(await embeds.getSafe("openticket:stats-ticket").build(source,{guild,channel,user,scopeData}))
+ })
+ )
+
+ //STATS USER
+ messages.add(new api.ODMessage("openticket:stats-user"))
+ messages.get("openticket:stats-user").workers.add(
+ new api.ODWorker("openticket:stats-user",0,async (instance,params,source) => {
+ const {guild,channel,user,scopeData} = params
+ instance.addEmbed(await embeds.getSafe("openticket:stats-user").build(source,{guild,channel,user,scopeData}))
+ })
+ )
+
+ //STATS RESET
+ messages.add(new api.ODMessage("openticket:stats-reset"))
+ messages.get("openticket:stats-reset").workers.add(
+ new api.ODWorker("openticket:stats-reset",0,async (instance,params,source) => {
+ const {guild,channel,user,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:stats-reset").build(source,{guild,channel,user,reason}))
+ })
+ )
+
+ //STATS TICKET UNKNOWN
+ messages.add(new api.ODMessage("openticket:stats-ticket-unknown"))
+ messages.get("openticket:stats-ticket-unknown").workers.add(
+ new api.ODWorker("openticket:stats-ticket-unknown",0,async (instance,params,source) => {
+ const {guild,channel,user,id} = params
+ instance.addEmbed(await embeds.getSafe("openticket:stats-ticket-unknown").build(source,{guild,channel,user,id}))
+ instance.setEphemeral(true)
+ })
+ )
+}
+
+const panelMessages = () => {
+ //PANEL
+ messages.add(new api.ODMessage("openticket:panel"))
+ messages.get("openticket:panel").workers.add([
+ new api.ODWorker("openticket:panel-layout",1,async (instance,params,source) => {
+ const {guild,channel,user,panel} = params
+
+ //add text
+ const text = panel.get("openticket:text").value
+ if (panel.get("openticket:describe-options-in-text").value){
+ //describe options in text
+ const describeText = (await import("../data/openticket/panelLoader.ts")).describePanelOptions("text",panel)
+ instance.setContent(text+"\n\n"+describeText)
+ }else if (text){
+ instance.setContent(text)
+ }
+
+ if (panel.get("openticket:enable-max-tickets-warning-text").value && generalConfig.data.system.limits.enabled){
+ instance.setContent(instance.data.content+"\n\n*"+lang.getTranslationWithParams("actions.descriptions.ticketMessageLimit",[generalConfig.data.system.limits.userMaximum.toString()])+"*")
+ }
+
+ //add embed
+ const embedOptions = panel.get("openticket:embed").value
+ if (embedOptions.enabled) instance.addEmbed(await embeds.getSafe("openticket:panel").build(source,{guild,channel,user,panel}))
+ }),
+ new api.ODWorker("openticket:panel-components",0,async (instance,params,source) => {
+ const {guild,channel,user,panel} = params
+ const options: api.ODOption[] = []
+ panel.get("openticket:options").value.forEach((id) => {
+ const opt = openticket.options.get(id)
+ if (opt) options.push(opt)
+ })
+
+ if (panel.get("openticket:dropdown").value){
+ //dropdown
+ const ticketOptions: api.ODTicketOption[] = []
+ options.forEach((option) => {
+ if (option instanceof api.ODTicketOption) ticketOptions.push(option)
+ })
+ instance.addComponent(await dropdowns.getSafe("openticket:panel-dropdown-tickets").build(source,{guild,channel,user,panel,options:ticketOptions}))
+ }else{
+ //buttons
+ for (const option of options){
+ if (option instanceof api.ODTicketOption) instance.addComponent(await buttons.getSafe("openticket:ticket-option").build(source,{guild,channel,user,panel,option}))
+ else if (option instanceof api.ODWebsiteOption) instance.addComponent(await buttons.getSafe("openticket:website-option").build(source,{guild,channel,user,panel,option}))
+ else if (option instanceof api.ODRoleOption) instance.addComponent(await buttons.getSafe("openticket:role-option").build(source,{guild,channel,user,panel,option}))
+ }
+ }
+ })
+ ])
+
+ //PANEL READY
+ messages.add(new api.ODMessage("openticket:panel-ready"))
+ messages.get("openticket:panel-ready").workers.add(
+ new api.ODWorker("openticket:panel-ready",0,async (instance,params,source) => {
+ instance.setContent("## "+lang.getTranslation("actions.descriptions.panelReady"))
+ instance.setEphemeral(true)
+ })
+ )
+}
+
+const ticketMessages = () => {
+ //TICKET CREATED
+ messages.add(new api.ODMessage("openticket:ticket-created"))
+ messages.get("openticket:ticket-created").workers.add(
+ new api.ODWorker("openticket:ticket-created",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+
+ instance.addEmbed(await embeds.getSafe("openticket:ticket-created").build(source,{guild,channel,user,ticket}))
+ instance.addComponent(await buttons.getSafe("openticket:visit-ticket").build("ticket-created",{guild,channel,user,ticket}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //TICKET CREATED DM
+ messages.add(new api.ODMessage("openticket:ticket-created-dm"))
+ messages.get("openticket:ticket-created-dm").workers.add(
+ new api.ODWorker("openticket:ticket-created-dm",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+
+ //add text
+ const text = ticket.option.get("openticket:dm-message-text").value
+ if (text !== "") instance.setContent(text)
+
+ //add embed
+ if (ticket.option.get("openticket:dm-message-embed").value.enabled) instance.addEmbed(await embeds.getSafe("openticket:ticket-created-dm").build(source,{guild,channel,user,ticket}))
+
+ //add components
+ instance.addComponent(await buttons.getSafe("openticket:visit-ticket").build("ticket-created",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET CREATED LOGS
+ messages.add(new api.ODMessage("openticket:ticket-created-logs"))
+ messages.get("openticket:ticket-created-logs").workers.add(
+ new api.ODWorker("openticket:ticket-created-logs",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+
+ instance.addEmbed(await embeds.getSafe("openticket:ticket-created-logs").build(source,{guild,channel,user,ticket}))
+ instance.addComponent(await buttons.getSafe("openticket:visit-ticket").build("ticket-created",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET MESSAGE
+ messages.add(new api.ODMessage("openticket:ticket-message"))
+ messages.get("openticket:ticket-message").workers.add([
+ new api.ODWorker("openticket:ticket-message-layout",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+
+ //add pings
+ const pingOptions = ticket.option.get("openticket:ticket-message-ping").value
+ const pings: string[] = [discord.userMention(user.id)]
+ if (pingOptions["@everyone"]) pings.push("@everyone")
+ if (pingOptions["@here"]) pings.push("@here")
+ pingOptions.custom.forEach((ping) => pings.push(discord.roleMention(ping)))
+ const pingText = (pings.length > 0) ? pings.join(" ")+"\n" : ""
+
+ //add text
+ const text = ticket.option.get("openticket:ticket-message-text").value
+ if (text !== "") instance.setContent(pingText+text)
+ else instance.setContent(pingText)
+
+ //add embed
+ if (ticket.option.get("openticket:ticket-message-embed").value.enabled) instance.addEmbed(await embeds.getSafe("openticket:ticket-message").build(source,{guild,channel,user,ticket}))
+
+
+ }),
+ new api.ODWorker("openticket:ticket-message-components",1,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+ //add components
+ if (generalConfig.data.system.enableTicketClaimButtons && !ticket.get("openticket:closed").value){
+ //enable ticket claiming
+ if (ticket.get("openticket:claimed").value){
+ instance.addComponent(await buttons.getSafe("openticket:unclaim-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ instance.addComponent(await buttons.getSafe("openticket:claim-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }
+ }
+ if (generalConfig.data.system.enableTicketPinButtons && !ticket.get("openticket:closed").value){
+ //enable ticket pinning
+ if (ticket.get("openticket:pinned").value){
+ instance.addComponent(await buttons.getSafe("openticket:unpin-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ instance.addComponent(await buttons.getSafe("openticket:pin-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }
+ }
+ if (generalConfig.data.system.enableTicketCloseButtons){
+ //enable ticket closing
+ if (ticket.get("openticket:closed").value){
+ instance.addComponent(await buttons.getSafe("openticket:reopen-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }else{
+ instance.addComponent(await buttons.getSafe("openticket:close-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }
+ }
+ //enable ticket deletion
+ if (generalConfig.data.system.enableTicketDeleteButtons) instance.addComponent(await buttons.getSafe("openticket:delete-ticket").build("ticket-message",{guild,channel,user,ticket}))
+ }),
+ new api.ODWorker("openticket:ticket-message-disable-components",2,async (instance,params,source) => {
+ const {ticket} = params
+ if (ticket.get("openticket:for-deletion").value){
+ //disable all buttons when ticket is being prepared for deletion
+ instance.data.components.forEach((component) => {
+ if ((component.component instanceof discord.ButtonBuilder) || (component.component instanceof discord.BaseSelectMenuBuilder)){
+ component.component.setDisabled(true)
+ }
+ })
+ }
+ })
+ ])
+
+ //TICKET CLOSED
+ messages.add(new api.ODMessage("openticket:close-message"))
+ messages.get("openticket:close-message").workers.add(
+ new api.ODWorker("openticket:close-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:close-message").build(source,{guild,channel,user,ticket,reason}))
+ if (generalConfig.data.system.enableTicketCloseButtons) instance.addComponent(await buttons.getSafe("openticket:reopen-ticket").build("close-message",{guild,channel,user,ticket}))
+ if (generalConfig.data.system.enableTicketDeleteButtons) instance.addComponent(await buttons.getSafe("openticket:delete-ticket").build("close-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET REOPENED
+ messages.add(new api.ODMessage("openticket:reopen-message"))
+ messages.get("openticket:reopen-message").workers.add(
+ new api.ODWorker("openticket:reopen-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:reopen-message").build(source,{guild,channel,user,ticket,reason}))
+ if (generalConfig.data.system.enableTicketCloseButtons) instance.addComponent(await buttons.getSafe("openticket:close-ticket").build("reopen-message",{guild,channel,user,ticket}))
+ if (generalConfig.data.system.enableTicketDeleteButtons) instance.addComponent(await buttons.getSafe("openticket:delete-ticket").build("reopen-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET DELETED
+ messages.add(new api.ODMessage("openticket:delete-message"))
+ messages.get("openticket:delete-message").workers.add(
+ new api.ODWorker("openticket:delete-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:delete-message").build(source,{guild,channel,user,ticket,reason}))
+ })
+ )
+
+ //TICKET CLAIMED
+ messages.add(new api.ODMessage("openticket:claim-message"))
+ messages.get("openticket:claim-message").workers.add(
+ new api.ODWorker("openticket:claim-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:claim-message").build(source,{guild,channel,user,ticket,reason}))
+ if (generalConfig.data.system.enableTicketClaimButtons) instance.addComponent(await buttons.getSafe("openticket:unclaim-ticket").build("claim-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET UNCLAIMED
+ messages.add(new api.ODMessage("openticket:unclaim-message"))
+ messages.get("openticket:unclaim-message").workers.add(
+ new api.ODWorker("openticket:unclaim-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:unclaim-message").build(source,{guild,channel,user,ticket,reason}))
+ if (generalConfig.data.system.enableTicketClaimButtons) instance.addComponent(await buttons.getSafe("openticket:claim-ticket").build("unclaim-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET PINNED
+ messages.add(new api.ODMessage("openticket:pin-message"))
+ messages.get("openticket:pin-message").workers.add(
+ new api.ODWorker("openticket:pin-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:pin-message").build(source,{guild,channel,user,ticket,reason}))
+ if (generalConfig.data.system.enableTicketPinButtons) instance.addComponent(await buttons.getSafe("openticket:unpin-ticket").build("pin-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET UNPINNED
+ messages.add(new api.ODMessage("openticket:unpin-message"))
+ messages.get("openticket:unpin-message").workers.add(
+ new api.ODWorker("openticket:unpin-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:unpin-message").build(source,{guild,channel,user,ticket,reason}))
+ if (generalConfig.data.system.enableTicketPinButtons) instance.addComponent(await buttons.getSafe("openticket:pin-ticket").build("unpin-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //TICKET RENAMED
+ messages.add(new api.ODMessage("openticket:rename-message"))
+ messages.get("openticket:rename-message").workers.add(
+ new api.ODWorker("openticket:rename-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ instance.addEmbed(await embeds.getSafe("openticket:rename-message").build(source,{guild,channel,user,ticket,reason,data}))
+ })
+ )
+
+ //TICKET MOVED
+ messages.add(new api.ODMessage("openticket:move-message"))
+ messages.get("openticket:move-message").workers.add(
+ new api.ODWorker("openticket:move-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ instance.addEmbed(await embeds.getSafe("openticket:move-message").build(source,{guild,channel,user,ticket,reason,data}))
+ })
+ )
+
+ //TICKET USER ADDED
+ messages.add(new api.ODMessage("openticket:add-message"))
+ messages.get("openticket:add-message").workers.add(
+ new api.ODWorker("openticket:add-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ instance.addEmbed(await embeds.getSafe("openticket:add-message").build(source,{guild,channel,user,ticket,reason,data}))
+ })
+ )
+
+ //TICKET USER REMOVED
+ messages.add(new api.ODMessage("openticket:remove-message"))
+ messages.get("openticket:remove-message").workers.add(
+ new api.ODWorker("openticket:remove-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason,data} = params
+ instance.addEmbed(await embeds.getSafe("openticket:remove-message").build(source,{guild,channel,user,ticket,reason,data}))
+ })
+ )
+
+ //TICKET ACTION DM
+ messages.add(new api.ODMessage("openticket:ticket-action-dm"))
+ messages.get("openticket:ticket-action-dm").workers.add(
+ new api.ODWorker("openticket:ticket-action-dm",0,async (instance,params,source) => {
+ const {guild,channel,user,mode,ticket,reason,additionalData} = params
+ instance.addEmbed(await embeds.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,mode,ticket,reason,additionalData}))
+ })
+ )
+
+ //TICKET ACTION LOGS
+ messages.add(new api.ODMessage("openticket:ticket-action-logs"))
+ messages.get("openticket:ticket-action-logs").workers.add(
+ new api.ODWorker("openticket:ticket-action-logs",0,async (instance,params,source) => {
+ const {guild,channel,user,mode,ticket,reason,additionalData} = params
+ instance.addEmbed(await embeds.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,mode,ticket,reason,additionalData}))
+ })
+ )
+}
+
+const blacklistMessages = () => {
+ //BLACKLIST VIEW
+ messages.add(new api.ODMessage("openticket:blacklist-view"))
+ messages.get("openticket:blacklist-view").workers.add(
+ new api.ODWorker("openticket:blacklist-view",0,async (instance,params,source) => {
+ const {guild,channel,user} = params
+ instance.addEmbed(await embeds.getSafe("openticket:blacklist-view").build(source,{guild,channel,user}))
+ })
+ )
+
+ //BLACKLIST GET
+ messages.add(new api.ODMessage("openticket:blacklist-get"))
+ messages.get("openticket:blacklist-get").workers.add(
+ new api.ODWorker("openticket:blacklist-get",0,async (instance,params,source) => {
+ const {guild,channel,user,data} = params
+ instance.addEmbed(await embeds.getSafe("openticket:blacklist-get").build(source,{guild,channel,user,data}))
+ })
+ )
+
+ //BLACKLIST ADD
+ messages.add(new api.ODMessage("openticket:blacklist-add"))
+ messages.get("openticket:blacklist-add").workers.add(
+ new api.ODWorker("openticket:blacklist-add",0,async (instance,params,source) => {
+ const {guild,channel,user,data,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:blacklist-add").build(source,{guild,channel,user,data,reason}))
+ })
+ )
+
+ //BLACKLIST REMOVE
+ messages.add(new api.ODMessage("openticket:blacklist-remove"))
+ messages.get("openticket:blacklist-remove").workers.add(
+ new api.ODWorker("openticket:blacklist-remove",0,async (instance,params,source) => {
+ const {guild,channel,user,data,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:blacklist-remove").build(source,{guild,channel,user,data,reason}))
+ })
+ )
+
+ //BLACKLIST DM
+ messages.add(new api.ODMessage("openticket:blacklist-dm"))
+ messages.get("openticket:blacklist-dm").workers.add(
+ new api.ODWorker("openticket:blacklist-dm",0,async (instance,params,source) => {
+ const {guild,channel,user,mode,data,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:blacklist-dm").build(source,{guild,channel,user,mode,data,reason}))
+ })
+ )
+
+ //BLACKLIST LOGS
+ messages.add(new api.ODMessage("openticket:blacklist-logs"))
+ messages.get("openticket:blacklist-logs").workers.add(
+ new api.ODWorker("openticket:blacklist-logs",0,async (instance,params,source) => {
+ const {guild,channel,user,mode,data,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:blacklist-logs").build(source,{guild,channel,user,mode,data,reason}))
+ })
+ )
+}
+
+const transcriptMessages = () => {
+ //TRANSCRIPT TEXT READY
+ messages.add(new api.ODMessage("openticket:transcript-text-ready"))
+ messages.get("openticket:transcript-text-ready").workers.add(
+ new api.ODWorker("openticket:transcript-text-ready",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,result} = params
+ instance.addEmbed(await embeds.getSafe("openticket:transcript-text-ready").build(source,{guild,channel,user,ticket,compiler,result}))
+ instance.addFile(await files.getSafe("openticket:text-transcript").build(source,{guild,channel,user,ticket,compiler,result}))
+ })
+ )
+
+ //TRANSCRIPT HTML READY
+ messages.add(new api.ODMessage("openticket:transcript-html-ready"))
+ messages.get("openticket:transcript-html-ready").workers.add(
+ new api.ODWorker("openticket:transcript-html-ready",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,result} = params
+ instance.addEmbed(await embeds.getSafe("openticket:transcript-html-ready").build(source,{guild,channel,user,ticket,compiler,result}))
+ instance.addComponent(await buttons.getSafe("openticket:transcript-html-visit").build(source,{guild,channel,user,ticket,compiler,result}))
+ })
+ )
+
+ //TRANSCRIPT HTML PROGRESS
+ messages.add(new api.ODMessage("openticket:transcript-html-progress"))
+ messages.get("openticket:transcript-html-progress").workers.add(
+ new api.ODWorker("openticket:transcript-html-progress",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,remaining} = params
+ instance.addEmbed(await embeds.getSafe("openticket:transcript-html-progress").build(source,{guild,channel,user,ticket,compiler,remaining}))
+ })
+ )
+
+ //TRANSCRIPT ERROR
+ messages.add(new api.ODMessage("openticket:transcript-error"))
+ messages.get("openticket:transcript-error").workers.add(
+ new api.ODWorker("openticket:transcript-error",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,compiler,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:transcript-error").build(source,{guild,channel,user,ticket,compiler,reason}))
+ instance.addComponent(await buttons.getSafe("openticket:transcript-error-retry").build(source,{guild,channel,user,ticket,compiler,reason}))
+ instance.addComponent(await buttons.getSafe("openticket:transcript-error-continue").build(source,{guild,channel,user,ticket,compiler,reason}))
+ })
+ )
+}
+
+const roleMessages = () => {
+ //REACTION ROLE
+ messages.add(new api.ODMessage("openticket:reaction-role"))
+ messages.get("openticket:reaction-role").workers.add(
+ new api.ODWorker("openticket:reaction-role",0,async (instance,params,source) => {
+ const {guild,user,role,result} = params
+ instance.addEmbed(await embeds.getSafe("openticket:reaction-role").build(source,{guild,user,role,result}))
+ instance.setEphemeral(true)
+ })
+ )
+}
+
+const clearMessages = () => {
+ //CLEAR VERIFY MESSAGE
+ messages.add(new api.ODMessage("openticket:clear-verify-message"))
+ messages.get("openticket:clear-verify-message").workers.add(
+ new api.ODWorker("openticket:clear-verify-message",0,async (instance,params,source) => {
+ const {guild,channel,user,filter,list} = params
+ instance.addEmbed(await embeds.getSafe("openticket:clear-verify-message").build(source,{guild,channel,user,filter,list}))
+ instance.addComponent(await buttons.getSafe("openticket:clear-continue").build(source,{guild,channel,user,filter,list}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //CLEAR MESSAGE
+ messages.add(new api.ODMessage("openticket:clear-message"))
+ messages.get("openticket:clear-message").workers.add(
+ new api.ODWorker("openticket:clear-message",0,async (instance,params,source) => {
+ const {guild,channel,user,filter,list} = params
+ instance.addEmbed(await embeds.getSafe("openticket:clear-message").build(source,{guild,channel,user,filter,list}))
+ instance.setEphemeral(true)
+ })
+ )
+
+ //CLEAR LOGS
+ messages.add(new api.ODMessage("openticket:clear-logs"))
+ messages.get("openticket:clear-logs").workers.add(
+ new api.ODWorker("openticket:clear-logs",0,async (instance,params,source) => {
+ const {guild,channel,user,filter,list} = params
+ instance.addEmbed(await embeds.getSafe("openticket:clear-logs").build(source,{guild,channel,user,filter,list}))
+ })
+ )
+}
+
+const autoMessages = () => {
+ //AUTOCLOSE MESSAGE
+ messages.add(new api.ODMessage("openticket:autoclose-message"))
+ messages.get("openticket:autoclose-message").workers.add(
+ new api.ODWorker("openticket:autoclose-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+ instance.addEmbed(await embeds.getSafe("openticket:autoclose-message").build(source,{guild,channel,user,ticket}))
+ if (generalConfig.data.system.enableTicketCloseButtons) instance.addComponent(await buttons.getSafe("openticket:reopen-ticket").build("autoclose-message",{guild,channel,user,ticket}))
+ if (generalConfig.data.system.enableTicketDeleteButtons) instance.addComponent(await buttons.getSafe("openticket:delete-ticket").build("autoclose-message",{guild,channel,user,ticket}))
+ })
+ )
+
+ //AUTODELETE MESSAGE
+ messages.add(new api.ODMessage("openticket:autodelete-message"))
+ messages.get("openticket:autodelete-message").workers.add(
+ new api.ODWorker("openticket:autodelete-message",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket} = params
+ instance.addEmbed(await embeds.getSafe("openticket:autodelete-message").build(source,{guild,channel,user,ticket}))
+ })
+ )
+
+ //AUTOCLOSE ENABLE
+ messages.add(new api.ODMessage("openticket:autoclose-enable"))
+ messages.get("openticket:autoclose-enable").workers.add(
+ new api.ODWorker("openticket:autoclose-enable",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason,time} = params
+ instance.addEmbed(await embeds.getSafe("openticket:autoclose-enable").build(source,{guild,channel,user,ticket,reason,time}))
+ })
+ )
+
+ //AUTODELETE ENABLE
+ messages.add(new api.ODMessage("openticket:autodelete-enable"))
+ messages.get("openticket:autodelete-enable").workers.add(
+ new api.ODWorker("openticket:autodelete-enable",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason,time} = params
+ instance.addEmbed(await embeds.getSafe("openticket:autodelete-enable").build(source,{guild,channel,user,ticket,reason,time}))
+ })
+ )
+
+ //AUTOCLOSE DISABLE
+ messages.add(new api.ODMessage("openticket:autoclose-disable"))
+ messages.get("openticket:autoclose-disable").workers.add(
+ new api.ODWorker("openticket:autoclose-disable",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:autoclose-disable").build(source,{guild,channel,user,ticket,reason}))
+ })
+ )
+
+ //AUTODELETE DISABLE
+ messages.add(new api.ODMessage("openticket:autodelete-disable"))
+ messages.get("openticket:autodelete-disable").workers.add(
+ new api.ODWorker("openticket:autodelete-disable",0,async (instance,params,source) => {
+ const {guild,channel,user,ticket,reason} = params
+ instance.addEmbed(await embeds.getSafe("openticket:autodelete-disable").build(source,{guild,channel,user,ticket,reason}))
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/builders/modals.ts b/src/builders/modals.ts
new file mode 100644
index 0000000..6412467
--- /dev/null
+++ b/src/builders/modals.ts
@@ -0,0 +1,173 @@
+///////////////////////////////////////
+//MODAL BUILDERS
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const modals = openticket.builders.modals
+const lang = openticket.languages
+
+export const registerAllModals = async () => {
+ ticketModals()
+}
+const ticketModals = () => {
+ //TICKET QUESTIONS
+ modals.add(new api.ODModal("openticket:ticket-questions"))
+ modals.get("openticket:ticket-questions").workers.add(
+ new api.ODWorker("openticket:ticket-questions",0,async (instance,params,source) => {
+ const {option} = params
+
+ instance.setCustomId("od:ticket-questions_"+option.id.value+"_"+source)
+ instance.setTitle(option.exists("openticket:name") ? option.get("openticket:name").value : option.id.value)
+ const questionIds = option.get("openticket:questions").value
+ questionIds.forEach((id) => {
+ const question = openticket.questions.get(id)
+ if (!question) return
+ if (question instanceof api.ODShortQuestion) instance.addQuestion({
+ customId:question.id.value,
+ label:question.get("openticket:name").value,
+ style:"short",
+ required:question.get("openticket:required").value,
+ placeholder:(question.get("openticket:placeholder").value) ? question.get("openticket:placeholder").value : undefined,
+ minLength:(question.get("openticket:length-enabled").value) ? question.get("openticket:length-min").value : undefined,
+ maxLength:(question.get("openticket:length-enabled").value) ? question.get("openticket:length-max").value : undefined
+ })
+ else if (question instanceof api.ODParagraphQuestion) instance.addQuestion({
+ customId:question.id.value,
+ label:question.get("openticket:name").value,
+ style:"paragraph",
+ required:question.get("openticket:required").value,
+ placeholder:(question.get("openticket:placeholder").value) ? question.get("openticket:placeholder").value : undefined,
+ minLength:(question.get("openticket:length-enabled").value) ? question.get("openticket:length-min").value : undefined,
+ maxLength:(question.get("openticket:length-enabled").value) ? question.get("openticket:length-max").value : undefined
+ })
+ })
+ })
+ )
+
+ //CLOSE TICKET REASON
+ modals.add(new api.ODModal("openticket:close-ticket-reason"))
+ modals.get("openticket:close-ticket-reason").workers.add(
+ new api.ODWorker("openticket:close-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:close-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.close"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.closePlaceholder")
+ })
+ })
+ )
+
+ //REOPEN TICKET REASON
+ modals.add(new api.ODModal("openticket:reopen-ticket-reason"))
+ modals.get("openticket:reopen-ticket-reason").workers.add(
+ new api.ODWorker("openticket:reopen-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:reopen-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.reopen"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.reopenPlaceholder")
+ })
+ })
+ )
+
+ //DELETE TICKET REASON
+ modals.add(new api.ODModal("openticket:delete-ticket-reason"))
+ modals.get("openticket:delete-ticket-reason").workers.add(
+ new api.ODWorker("openticket:delete-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:delete-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.delete"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.deletePlaceholder")
+ })
+ })
+ )
+
+ //CLAIM TICKET REASON
+ modals.add(new api.ODModal("openticket:claim-ticket-reason"))
+ modals.get("openticket:claim-ticket-reason").workers.add(
+ new api.ODWorker("openticket:claim-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:claim-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.claim"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.claimPlaceholder")
+ })
+ })
+ )
+
+ //UNCLAIM TICKET REASON
+ modals.add(new api.ODModal("openticket:unclaim-ticket-reason"))
+ modals.get("openticket:unclaim-ticket-reason").workers.add(
+ new api.ODWorker("openticket:unclaim-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:unclaim-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.unclaim"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.unclaimPlaceholder")
+ })
+ })
+ )
+
+ //PIN TICKET REASON
+ modals.add(new api.ODModal("openticket:pin-ticket-reason"))
+ modals.get("openticket:pin-ticket-reason").workers.add(
+ new api.ODWorker("openticket:pin-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:pin-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.pin"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.pinPlaceholder")
+ })
+ })
+ )
+
+ //UNPIN TICKET REASON
+ modals.add(new api.ODModal("openticket:unpin-ticket-reason"))
+ modals.get("openticket:unpin-ticket-reason").workers.add(
+ new api.ODWorker("openticket:unpin-ticket-reason",0,async (instance,params,source) => {
+ const {ticket} = params
+
+ instance.setCustomId("od:unpin-ticket-reason_"+ticket.id.value+"_"+source)
+ instance.setTitle(lang.getTranslation("actions.buttons.unpin"))
+ instance.addQuestion({
+ customId:"reason",
+ label:lang.getTranslation("params.uppercase.reason"),
+ style:"paragraph",
+ required:true,
+ placeholder:lang.getTranslation("actions.modal.unpinPlaceholder")
+ })
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/commands/add.ts b/src/commands/add.ts
new file mode 100644
index 0000000..4ad48b9
--- /dev/null
+++ b/src/commands/add.ts
@@ -0,0 +1,87 @@
+///////////////////////////////////////
+//ADD COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //ADD COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:add",generalConfig.data.prefix,"add"))
+ openticket.responders.commands.get("openticket:add").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.add
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:add",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const data = instance.options.getUser("user",true)
+ const reason = instance.options.getString("reason",false)
+
+ //return when user already added to ticket
+ const participants = await openticket.tickets.getAllTicketParticipants(ticket)
+ if (!participants || participants.find((p) => p.user.id == data.id)){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"This user is already able to access the ticket!",layout:"simple"}))
+ return cancel()
+ }
+
+ //start adding user to ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:add-ticket-user").run(source,{guild,channel,user,ticket,reason,sendMessage:false,data})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:add-message").build(source,{guild,channel,user,ticket,reason,data}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'add' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/autoclose.ts b/src/commands/autoclose.ts
new file mode 100644
index 0000000..e731e96
--- /dev/null
+++ b/src/commands/autoclose.ts
@@ -0,0 +1,98 @@
+///////////////////////////////////////
+//AUTOCLOSE COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //AUTOCLOSE COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:autoclose",generalConfig.data.prefix,/^autoclose/))
+ openticket.responders.commands.get("openticket:autoclose").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.autoclose
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:autoclose",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+ //return when already closed
+ if (ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already closed!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const scope = instance.options.getSubCommand()
+ if (!scope || (scope != "disable" && scope != "enable")) return
+
+ if (scope == "disable"){
+ const reason = instance.options.getString("reason",false)
+ ticket.get("openticket:autoclose-enabled").value = false
+ ticket.get("openticket:autoclose-hours").value = 0
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:autoclose-disable").build(source,{guild,channel,user,ticket,reason}))
+
+ }else if (scope == "enable"){
+ const time = instance.options.getNumber("time",true)
+ const reason = instance.options.getString("reason",false)
+ ticket.get("openticket:autoclose-enabled").value = true
+ ticket.get("openticket:autoclose-hours").value = time
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:autoclose-enable").build(source,{guild,channel,user,ticket,reason,time}))
+ }
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ const scope = instance.options.getSubCommand()
+ const reason = instance.options.getString("reason",false)
+ openticket.log(instance.user.displayName+" used the 'autoclose "+scope+"' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source},
+ {key:"reason",value:reason ?? "/"},
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/autodelete.ts b/src/commands/autodelete.ts
new file mode 100644
index 0000000..4744804
--- /dev/null
+++ b/src/commands/autodelete.ts
@@ -0,0 +1,93 @@
+///////////////////////////////////////
+//AUTODELETE COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //AUTODELETE COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:autodelete",generalConfig.data.prefix,/^autodelete/))
+ openticket.responders.commands.get("openticket:autodelete").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.autodelete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:autodelete",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const scope = instance.options.getSubCommand()
+ if (!scope || (scope != "disable" && scope != "enable")) return
+
+ if (scope == "disable"){
+ const reason = instance.options.getString("reason",false)
+ ticket.get("openticket:autodelete-enabled").value = false
+ ticket.get("openticket:autodelete-days").value = 0
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:autodelete-disable").build(source,{guild,channel,user,ticket,reason}))
+
+ }else if (scope == "enable"){
+ const time = instance.options.getNumber("time",true)
+ const reason = instance.options.getString("reason",false)
+ ticket.get("openticket:autodelete-enabled").value = true
+ ticket.get("openticket:autodelete-days").value = time
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:autodelete-enable").build(source,{guild,channel,user,ticket,reason,time}))
+ }
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ const scope = instance.options.getSubCommand()
+ const reason = instance.options.getString("reason",false)
+ openticket.log(instance.user.displayName+" used the 'autodelete "+scope+"' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source},
+ {key:"reason",value:reason ?? "/"},
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/blacklist.ts b/src/commands/blacklist.ts
new file mode 100644
index 0000000..f0d3a6e
--- /dev/null
+++ b/src/commands/blacklist.ts
@@ -0,0 +1,127 @@
+///////////////////////////////////////
+//BLACKLIST COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //BLACKLIST COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:blacklist",generalConfig.data.prefix,/^blacklist/))
+ openticket.responders.commands.get("openticket:blacklist").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.blacklist
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:blacklist",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+ const scope = instance.options.getSubCommand()
+ if (!scope || (scope != "add" && scope != "get" && scope != "remove" && scope != "view")) return
+
+ if (scope == "view"){
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:blacklist-view").build(source,{guild,channel,user}))
+
+ }else if (scope == "get"){
+ const data = instance.options.getUser("user",true)
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:blacklist-get").build(source,{guild,channel,user,data}))
+
+ }else if (scope == "add"){
+ const data = instance.options.getUser("user",true)
+ const reason = instance.options.getString("reason",false)
+
+ openticket.blacklist.add(new api.ODBlacklist(data.id,reason),true)
+ openticket.log(instance.user.displayName+" added "+data.displayName+" to blacklist!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"method",value:source},
+ {key:"reason",value:reason ?? "/"}
+ ])
+
+ //manage stats
+ openticket.stats.get("openticket:global").setStat("openticket:users-blacklisted",1,"increase")
+ openticket.stats.get("openticket:user").setStat("openticket:users-blacklisted",user.id,1,"increase")
+
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:blacklist-add").build(source,{guild,channel,user,data,reason}))
+
+ }else if (scope == "remove"){
+ const data = instance.options.getUser("user",true)
+ const reason = instance.options.getString("reason",false)
+
+ openticket.blacklist.remove(data.id)
+ openticket.log(instance.user.displayName+" removed "+data.displayName+" from blacklist!","info",[
+ {key:"user",value:user.username},
+ {key:"userid",value:user.id,hidden:true},
+ {key:"channelid",value:channel.id,hidden:true},
+ {key:"method",value:source},
+ {key:"reason",value:reason ?? "/"}
+ ])
+
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:blacklist-remove").build(source,{guild,channel,user,data,reason}))
+ }
+ }),
+ new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild) return
+
+ const scope = instance.options.getSubCommand()
+ if (!scope || (scope != "add" && scope != "remove")) return
+
+ const data = instance.options.getUser("user",true)
+ const reason = instance.options.getString("reason",false)
+
+ //to logs
+ if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.blacklisting.logs){
+ const logChannel = openticket.posts.get("openticket:logs")
+ if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:blacklist-logs").build(source,{guild,channel,user,mode:scope,data,reason}))
+ }
+
+ //to dm
+ if (generalConfig.data.system.messages.blacklisting.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:blacklist-dm").build(source,{guild,channel,user,mode:scope,data,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ const scope = instance.options.getSubCommand()
+ openticket.log(instance.user.displayName+" used the 'blacklist "+scope+"' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/claim.ts b/src/commands/claim.ts
new file mode 100644
index 0000000..84316f7
--- /dev/null
+++ b/src/commands/claim.ts
@@ -0,0 +1,138 @@
+///////////////////////////////////////
+//CLAIM COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //CLAIM COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:claim",generalConfig.data.prefix,"claim"))
+ openticket.responders.commands.get("openticket:claim").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.claim
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:claim",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already claimed
+ if (ticket.get("openticket:claimed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already claimed!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const claimUser = instance.options.getUser("user",false) ?? user
+ const reason = instance.options.getString("reason",false)
+
+ //start claiming ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:claim-ticket").run(source,{guild,channel,user:claimUser,ticket,reason,sendMessage:false})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:claim-message").build(source,{guild,channel,user:claimUser,ticket,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'claim' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //CLAIM TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:claim-ticket",/^od:claim-ticket/))
+ openticket.responders.buttons.get("openticket:claim-ticket").workers.add(
+ new api.ODWorker("openticket:claim-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "unclaim-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:claim-ticket-ticket-message").activate(instance)
+ else await openticket.verifybars.get("openticket:claim-ticket-unclaim-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //CLAIM WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:claim-ticket-reason",/^od:claim-ticket-reason_/))
+ openticket.responders.modals.get("openticket:claim-ticket-reason").workers.add([
+ new api.ODWorker("openticket:claim-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"unclaim-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //claim with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:claim-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "unclaim-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:claim-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:claim-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:claim-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ }
+
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/clear.ts b/src/commands/clear.ts
new file mode 100644
index 0000000..61a0e7f
--- /dev/null
+++ b/src/commands/clear.ts
@@ -0,0 +1,122 @@
+///////////////////////////////////////
+//CLEAR COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //CLEAR COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:clear",generalConfig.data.prefix,"clear"))
+ openticket.responders.commands.get("openticket:clear").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.clear
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ //only allow global admins (ticket admins aren't allowed to clear tickets)
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild,{allowChannelUserScope:false,allowChannelRoleScope:false}))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:clear",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+
+ const tempFilter = instance.options.getString("filter",false)
+ const filter = (tempFilter) ? tempFilter.toLowerCase() as api.ODTicketClearFilter : "all"
+ const list: string[] = []
+ const ticketList = openticket.tickets.getAll().filter((ticket) => {
+ if (filter == "all") return true
+ else if (filter == "open" && ticket.get("openticket:open").value) return true
+ else if (filter == "closed" && ticket.get("openticket:closed").value) return true
+ else if (filter == "claimed" && ticket.get("openticket:claimed").value) return true
+ else if (filter == "pinned" && ticket.get("openticket:pinned").value) return true
+ else if (filter == "unclaimed" && !ticket.get("openticket:claimed").value) return true
+ else if (filter == "unpinned" && !ticket.get("openticket:pinned").value) return true
+ else if (filter == "autoclosed" && ticket.get("openticket:closed").value) return true
+ else return false
+ })
+ for (const ticket of ticketList){
+ const ticketChannel = await openticket.tickets.getTicketChannel(ticket)
+ if (ticketChannel) list.push("#"+ticketChannel.name)
+ }
+
+ //reply with clear verify
+ await instance.defer(true)
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:clear-verify-message").build(source,{guild,channel,user,filter,list}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'clear' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //CLEAR CONTINUE BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:clear-continue",/^od:clear-continue_/))
+ openticket.responders.buttons.get("openticket:clear-continue").workers.add(
+ new api.ODWorker("openticket:clear-continue",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild || channel.isDMBased()) return
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "slash" && originalSource != "text" && originalSource != "other") return
+ const filter = instance.interaction.customId.split("_")[2] as api.ODTicketClearFilter
+
+ //start ticket clear
+ instance.defer("update",true)
+ const list: string[] = []
+ const ticketList = openticket.tickets.getAll().filter((ticket) => {
+ if (filter == "all") return true
+ else if (filter == "open" && ticket.get("openticket:open").value) return true
+ else if (filter == "closed" && ticket.get("openticket:closed").value) return true
+ else if (filter == "claimed" && ticket.get("openticket:claimed").value) return true
+ else if (filter == "pinned" && ticket.get("openticket:pinned").value) return true
+ else if (filter == "unclaimed" && !ticket.get("openticket:claimed").value) return true
+ else if (filter == "unpinned" && !ticket.get("openticket:pinned").value) return true
+ else if (filter == "autoclosed" && ticket.get("openticket:closed").value) return true
+ else return false
+ })
+ for (const ticket of ticketList){
+ const ticketChannel = await openticket.tickets.getTicketChannel(ticket)
+ if (ticketChannel) list.push("#"+ticketChannel.name)
+ }
+
+ await openticket.actions.get("openticket:clear-tickets").run(originalSource,{guild,channel,user,filter,list:ticketList})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:clear-message").build(originalSource,{guild,channel,user,filter,list}))
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/commands/close.ts b/src/commands/close.ts
new file mode 100644
index 0000000..dc39dc6
--- /dev/null
+++ b/src/commands/close.ts
@@ -0,0 +1,137 @@
+///////////////////////////////////////
+//CLOSE COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //CLOSE COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:close",generalConfig.data.prefix,"close"))
+ openticket.responders.commands.get("openticket:close").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.close
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:close",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already closed
+ if (ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already closed!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const reason = instance.options.getString("reason",false)
+
+ //start closing ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:close-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:close-message").build(source,{guild,channel,user,ticket,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'close' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //CLOSE TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:close-ticket",/^od:close-ticket_/))
+ openticket.responders.buttons.get("openticket:close-ticket").workers.add(
+ new api.ODWorker("openticket:close-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "reopen-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:close-ticket-ticket-message").activate(instance)
+ else await openticket.verifybars.get("openticket:close-ticket-reopen-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //CLOSE WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:close-ticket-reason",/^od:close-ticket-reason_/))
+ openticket.responders.modals.get("openticket:close-ticket-reason").workers.add([
+ new api.ODWorker("openticket:close-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"reopen-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //close with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:close-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "reopen-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:close-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:close-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:close-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ }
+
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/delete.ts b/src/commands/delete.ts
new file mode 100644
index 0000000..e80f677
--- /dev/null
+++ b/src/commands/delete.ts
@@ -0,0 +1,149 @@
+///////////////////////////////////////
+//DELETE COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //DELETE COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:delete",generalConfig.data.prefix,"delete"))
+ openticket.responders.commands.get("openticket:delete").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.delete
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:delete",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const reason = instance.options.getString("reason",false)
+ const withoutTranscript = instance.options.getBoolean("notranscript",false) ?? false
+
+ //start deleting ticket
+ await instance.defer(false)
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:delete-message").build(source,{guild,channel,user,ticket,reason}))
+ await openticket.actions.get("openticket:delete-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false,withoutTranscript})
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'delete' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //DELETE TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:delete-ticket",/^od:delete-ticket/))
+ openticket.responders.buttons.get("openticket:delete-ticket").workers.add(
+ new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "reopen-message" && originalSource != "close-message" && originalSource != "autoclose-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:delete-ticket-ticket-message").activate(instance)
+ else if (originalSource == "close-message") await openticket.verifybars.get("openticket:delete-ticket-close-message").activate(instance)
+ else if (originalSource == "reopen-message") await openticket.verifybars.get("openticket:delete-ticket-reopen-message").activate(instance)
+ else if (originalSource == "autoclose-message") await openticket.verifybars.get("openticket:delete-ticket-autoclose-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //REOPEN WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:delete-ticket-reason",/^od:delete-ticket-reason_/))
+ openticket.responders.modals.get("openticket:delete-ticket-reason").workers.add([
+ new api.ODWorker("openticket:delete-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //delete with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true,withoutTranscript:false})
+ //update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
+ ticket.get("openticket:for-deletion").value = true
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "close-message"){
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false,withoutTranscript:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "reopen-message"){
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false,withoutTranscript:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "autoclose-message"){
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false,withoutTranscript:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ //don't await DELETE action => else it will update the message after the channel has been deleted
+ openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true,withoutTranscript:false})
+ }
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/help.ts b/src/commands/help.ts
new file mode 100644
index 0000000..36b7ec1
--- /dev/null
+++ b/src/commands/help.ts
@@ -0,0 +1,112 @@
+///////////////////////////////////////
+//HELP COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //HELP COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:help",generalConfig.data.prefix,"help"))
+ openticket.responders.commands.get("openticket:help").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.help
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:help",0,async (instance,params,source,cancel) => {
+ const preferSlashOverText = generalConfig.data.system.preferSlashOverText
+
+ let mode: "slash"|"text"
+ if (generalConfig.data.slashCommands && generalConfig.data.textCommands){
+ mode = (preferSlashOverText) ? "slash" : "text"
+
+ }else if (!generalConfig.data.slashCommands) mode = "text"
+ else mode = "slash"
+
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:help-menu").build(source,{mode,page:0}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'help' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //HELP MENU SWITCH BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:help-menu-switch",/^od:help-menu-switch_(slash|text)/))
+ openticket.responders.buttons.get("openticket:help-menu-switch").workers.add(
+ new api.ODWorker("openticket:update-help-menu",0,async (instance,params,source,cancel) => {
+ const mode = instance.interaction.customId.split("_")[1] as "slash"|"text"
+ const pageButton = instance.getMessageComponent("button",/^od:help-menu-page_([0-9]+)/)
+ const currentPage = (pageButton && pageButton.customId) ? Number(pageButton.customId.split("_")[1]) : 0
+
+ const newMode = (mode == "slash") ? "text" : "slash"
+
+ const msg = await openticket.builders.messages.getSafe("openticket:help-menu").build("button",{mode:newMode,page:currentPage})
+ await instance.update(msg)
+ })
+ )
+
+ //HELP MENU PREVIOUS BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:help-menu-previous",/^od:help-menu-previous/))
+ openticket.responders.buttons.get("openticket:help-menu-previous").workers.add(
+ new api.ODWorker("openticket:update-help-menu",0,async (instance,params,source,cancel) => {
+ const switchButton = instance.getMessageComponent("button",/^od:help-menu-switch_(slash|text)/)
+ const pageButton = instance.getMessageComponent("button",/^od:help-menu-page_([0-9]+)/)
+ const currentPage = (pageButton && pageButton.customId) ? Number(pageButton.customId.split("_")[1]) : 0
+ const currentMode = (switchButton && switchButton.customId) ? switchButton.customId.split("_")[1] as "text"|"slash" : "slash"
+
+ const msg = await openticket.builders.messages.getSafe("openticket:help-menu").build("button",{mode:currentMode,page:currentPage-1})
+ await instance.update(msg)
+ })
+ )
+
+ //HELP MENU NEXT BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:help-menu-next",/^od:help-menu-next/))
+ openticket.responders.buttons.get("openticket:help-menu-next").workers.add(
+ new api.ODWorker("openticket:update-help-menu",0,async (instance,params,source,cancel) => {
+ const switchButton = instance.getMessageComponent("button",/^od:help-menu-switch_(slash|text)/)
+ const pageButton = instance.getMessageComponent("button",/^od:help-menu-page_([0-9]+)/)
+ const currentPage = (pageButton && pageButton.customId) ? Number(pageButton.customId.split("_")[1]) : 0
+ const currentMode = (switchButton && switchButton.customId) ? switchButton.customId.split("_")[1] as "text"|"slash" : "slash"
+
+ const msg = await openticket.builders.messages.getSafe("openticket:help-menu").build("button",{mode:currentMode,page:currentPage+1})
+ await instance.update(msg)
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/commands/move.ts b/src/commands/move.ts
new file mode 100644
index 0000000..a33cb55
--- /dev/null
+++ b/src/commands/move.ts
@@ -0,0 +1,92 @@
+///////////////////////////////////////
+//MOVE COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //MOVE COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:move",generalConfig.data.prefix,"move"))
+ openticket.responders.commands.get("openticket:move").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.move
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:move",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const id = instance.options.getString("id",true)
+ const reason = instance.options.getString("reason",false)
+
+ const option = openticket.options.get(id)
+ //return if unknown option
+ if (!option || !(option instanceof api.ODTicketOption)){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Unknown Option",layout:"simple"}))
+ return cancel()
+ }
+ //return if option is the same
+ if (ticket.option.id.value == option.id.value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"This ticket is already the same as the chosen option!",layout:"simple"}))
+ return cancel()
+ }
+
+ //start moving ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:move-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false,data:option})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:move-message").build(source,{guild,channel,user,ticket,reason,data:option}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'move' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/panel.ts b/src/commands/panel.ts
new file mode 100644
index 0000000..72cf050
--- /dev/null
+++ b/src/commands/panel.ts
@@ -0,0 +1,82 @@
+///////////////////////////////////////
+//STATS COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //PANEL COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:panel",generalConfig.data.prefix,/^panel/))
+ openticket.responders.commands.get("openticket:panel").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.panel
+
+ //command is disabled
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:panel",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ const id = instance.options.getString("id",true)
+ const panel = openticket.panels.get(id)
+
+ if (!panel){
+ //invalid panel
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-panel-unknown").build(source,{guild,channel,user}))
+ return cancel()
+ }
+
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:panel-ready").build(source,{guild,channel,user,panel}))
+ const panelMessage = await instance.channel.send((await openticket.builders.messages.getSafe("openticket:panel").build(source,{guild,channel,user,panel})).message)
+
+ //add panel to database on auto-update
+ if (instance.options.getBoolean("auto-update",false)){
+ const globalDatabase = openticket.databases.get("openticket:global")
+ globalDatabase.set("openticket:panel-update",panelMessage.channel.id+"_"+panelMessage.id,panel.id.value)
+ }
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'panel' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/pin.ts b/src/commands/pin.ts
new file mode 100644
index 0000000..64d5c2b
--- /dev/null
+++ b/src/commands/pin.ts
@@ -0,0 +1,137 @@
+///////////////////////////////////////
+//PIN COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //PIN COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:pin",generalConfig.data.prefix,"pin"))
+ openticket.responders.commands.get("openticket:pin").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.pin
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:pin",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when already pinned
+ if (ticket.get("openticket:pinned").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is already pinned!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const reason = instance.options.getString("reason",false)
+
+ //start pinning ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:pin-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:pin-message").build(source,{guild,channel,user,ticket,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'pin' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //PIN TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:pin-ticket",/^od:pin-ticket/))
+ openticket.responders.buttons.get("openticket:pin-ticket").workers.add(
+ new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "unpin-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:pin-ticket-ticket-message").activate(instance)
+ else await openticket.verifybars.get("openticket:pin-ticket-unpin-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //PIN WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:pin-ticket-reason",/^od:pin-ticket-reason_/))
+ openticket.responders.modals.get("openticket:pin-ticket-reason").workers.add([
+ new api.ODWorker("openticket:pin-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"unpin-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //pin with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:pin-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "unpin-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:pin-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:pin-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:pin-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ }
+
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/remove.ts b/src/commands/remove.ts
new file mode 100644
index 0000000..f984372
--- /dev/null
+++ b/src/commands/remove.ts
@@ -0,0 +1,87 @@
+///////////////////////////////////////
+//REMOVE COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //REMOVE COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:remove",generalConfig.data.prefix,"remove"))
+ openticket.responders.commands.get("openticket:remove").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.remove
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:remove",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const data = instance.options.getUser("user",true)
+ const reason = instance.options.getString("reason",false)
+
+ //return when user is not a participant of the ticket (admins & creator can't be removed)
+ const participants = await openticket.tickets.getAllTicketParticipants(ticket)
+ if (!participants || !participants.find((p) => p.user.id == data.id && p.role == "participant")){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Unable to remove this user from the ticket!",layout:"simple"}))
+ return cancel()
+ }
+
+ //start removing user from ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:remove-ticket-user").run(source,{guild,channel,user,ticket,reason,sendMessage:false,data})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:remove-message").build(source,{guild,channel,user,ticket,reason,data}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'remove' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/rename.ts b/src/commands/rename.ts
new file mode 100644
index 0000000..e5fafb5
--- /dev/null
+++ b/src/commands/rename.ts
@@ -0,0 +1,80 @@
+///////////////////////////////////////
+//RENAME COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //RENAME COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:rename",generalConfig.data.prefix,"rename"))
+ openticket.responders.commands.get("openticket:rename").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.rename
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:rename",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const name = instance.options.getString("name",true)
+ const reason = instance.options.getString("reason",false)
+
+ //start renaming ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:rename-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false,data:name})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:rename-message").build(source,{guild,channel,user,ticket,reason,data:name}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'rename' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/reopen.ts b/src/commands/reopen.ts
new file mode 100644
index 0000000..82ccb36
--- /dev/null
+++ b/src/commands/reopen.ts
@@ -0,0 +1,142 @@
+///////////////////////////////////////
+//REOPEN COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //REOPEN COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:reopen",generalConfig.data.prefix,"reopen"))
+ openticket.responders.commands.get("openticket:reopen").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.reopen
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:reopen",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not closed
+ if (!ticket.get("openticket:closed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is not closed yet!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const reason = instance.options.getString("reason",false)
+
+ //start reopening ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:reopen-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:reopen-message").build(source,{guild,channel,user,ticket,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'reopen' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //REOPEN TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:reopen-ticket",/^od:reopen-ticket/))
+ openticket.responders.buttons.get("openticket:reopen-ticket").workers.add(
+ new api.ODWorker("openticket:reopen-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "close-message" && originalSource != "autoclose-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:reopen-ticket-ticket-message").activate(instance)
+ else if (originalSource == "close-message") await openticket.verifybars.get("openticket:reopen-ticket-close-message").activate(instance)
+ else await openticket.verifybars.get("openticket:reopen-ticket-autoclose-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //REOPEN WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:reopen-ticket-reason",/^od:reopen-ticket-reason_/))
+ openticket.responders.modals.get("openticket:reopen-ticket-reason").workers.add([
+ new api.ODWorker("openticket:reopen-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"close-message"|"autoclose-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //reopen with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "close-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "autoclose-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:reopen-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ }
+
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/role.ts b/src/commands/role.ts
new file mode 100644
index 0000000..88ea4f6
--- /dev/null
+++ b/src/commands/role.ts
@@ -0,0 +1,41 @@
+///////////////////////////////////////
+//ROLE BUTTON (not command)
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerButtonResponders = async () => {
+ //ROLE OPTION BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:role-option",/^od:role-option_/))
+ openticket.responders.buttons.get("openticket:role-option").workers.add(
+ new api.ODWorker("openticket:role-option",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //get option
+ const optionId = instance.interaction.customId.split("_")[2]
+ const option = openticket.options.get(optionId)
+ if (!option || !(option instanceof api.ODRoleOption)){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-option-unknown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //reaction role
+ await instance.defer("reply",true)
+ const res = await openticket.actions.get("openticket:reaction-role").run("panel-button",{guild,user,option,overwriteMode:null})
+ if (!res.result || !res.role){
+ //error
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild,channel:instance.channel,user,error:"Unable to receive role update data from worker!",layout:"advanced"}))
+ return cancel()
+ }
+ if (generalConfig.data.system.replyOnReactionRole) await instance.reply(await openticket.builders.messages.getSafe("openticket:reaction-role").build("panel-button",{guild,user,role:res.role,result:res.result}))
+ })
+ )
+}
\ No newline at end of file
diff --git a/src/commands/stats.ts b/src/commands/stats.ts
new file mode 100644
index 0000000..1c35760
--- /dev/null
+++ b/src/commands/stats.ts
@@ -0,0 +1,107 @@
+///////////////////////////////////////
+//STATS COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //STATS COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:stats",generalConfig.data.prefix,/^stats/))
+ openticket.responders.commands.get("openticket:stats").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.stats
+
+ //command is disabled
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }
+
+ //reset subcommand is owner/developer only
+ if (instance.options.getSubCommand() == "reset"){
+ if (!openticket.permissions.hasPermissions("owner",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["owner","developer"]}))
+ return cancel()
+ }else return
+ }
+
+ //permissions for normal scopes
+ if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:stats",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+ const scope = instance.options.getSubCommand()
+ if (!scope || (scope != "global" && scope != "ticket" && scope != "user" && scope != "reset")) return
+
+ if (scope == "global"){
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:stats-global").build(source,{guild,channel,user}))
+
+ }else if (scope == "ticket"){
+ const id = instance.options.getChannel("ticket",false)?.id ?? channel.id
+ const ticket = openticket.tickets.get(id)
+
+ if (ticket) await instance.reply(await openticket.builders.messages.getSafe("openticket:stats-ticket").build(source,{guild,channel,user,scopeData:ticket}))
+ else await instance.reply(await openticket.builders.messages.getSafe("openticket:stats-ticket-unknown").build(source,{guild,channel,user,id}))
+
+ }else if (scope == "user"){
+ const statsUser = instance.options.getUser("user",false) ?? user
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:stats-user").build(source,{guild,channel,user,scopeData:statsUser}))
+
+ }else if (scope == "reset"){
+ const reason = instance.options.getString("reason",false)
+ openticket.stats.reset()
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:stats-reset").build(source,{guild,channel,user,reason}))
+
+ }
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ const scope = instance.options.getSubCommand()
+ let data: string
+ if (scope == "ticket"){
+ data = instance.options.getChannel("ticket",false)?.id ?? instance.channel.id
+ }else if (scope == "user"){
+ data = instance.options.getUser("user",false)?.id ?? instance.user.id
+ }else data = "/"
+ openticket.log(instance.user.displayName+" used the 'stats "+scope+"' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source},
+ {key:"data",value:data},
+ ])
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/ticket.ts b/src/commands/ticket.ts
new file mode 100644
index 0000000..ffa00ea
--- /dev/null
+++ b/src/commands/ticket.ts
@@ -0,0 +1,269 @@
+///////////////////////////////////////
+//TICKET COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //TICKET COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:ticket",generalConfig.data.prefix,/^ticket/))
+ openticket.responders.commands.get("openticket:ticket").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.ticket
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:ticket",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //get option
+ const optionId = instance.options.getString("id",true)
+ const option = openticket.options.get(optionId)
+ if (!option || !(option instanceof api.ODTicketOption)){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-option-unknown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //check ticket permissions
+ const res = await openticket.actions.get("openticket:create-ticket-permissions").run(source,{guild,user,option})
+ if (!res.valid){
+ //error
+ if (res.reason == "blacklist") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-blacklisted").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ else if (res.reason == "cooldown") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-cooldown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,until:res.cooldownUntil}))
+ else if (res.reason == "global-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global"}))
+ else if (res.reason == "global-user-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"}))
+ else if (res.reason == "option-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"}))
+ else if (res.reason == "option-user-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"}))
+ else instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"}))
+ return cancel()
+ }
+
+ //start ticket creation
+ if (option.exists("openticket:questions") && option.get("openticket:questions").value.length > 0){
+ //send modal
+ instance.modal(await openticket.builders.modals.getSafe("openticket:ticket-questions").build(source,{guild,channel,user,option}))
+ }else{
+ //create ticket
+ await instance.defer(true)
+ const res = await openticket.actions.get("openticket:create-ticket").run(source,{guild,user,answers:[],option})
+ if (!res.channel || !res.ticket){
+ //error
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild,channel:instance.channel,user,error:"Unable to receive ticket or channel from callback! #1",layout:"advanced"}))
+ return cancel()
+ }
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:ticket-created").build(source,{guild,channel:res.channel,user,ticket:res.ticket}))
+ }
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'ticket' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //TICKET OPTION BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:ticket-option",/^od:ticket-option_/))
+ openticket.responders.buttons.get("openticket:ticket-option").workers.add(
+ new api.ODWorker("openticket:ticket-option",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //get option
+ const optionId = instance.interaction.customId.split("_")[2]
+ const option = openticket.options.get(optionId)
+ if (!option || !(option instanceof api.ODTicketOption)){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-option-unknown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //check ticket permissions
+ const res = await openticket.actions.get("openticket:create-ticket-permissions").run("panel-button",{guild,user,option})
+ if (!res.valid){
+ //error
+ if (res.reason == "blacklist") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-blacklisted").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ else if (res.reason == "cooldown") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-cooldown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,until:res.cooldownUntil}))
+ else if (res.reason == "global-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global"}))
+ else if (res.reason == "global-user-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"}))
+ else if (res.reason == "option-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"}))
+ else if (res.reason == "option-user-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"}))
+ else instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"}))
+ return cancel()
+ }
+
+ //start ticket creation
+ if (option.exists("openticket:questions") && option.get("openticket:questions").value.length > 0){
+ //send modal
+ instance.modal(await openticket.builders.modals.getSafe("openticket:ticket-questions").build("panel-button",{guild,channel,user,option}))
+ }else{
+ //create ticket
+ await instance.defer("reply",true)
+ const res = await openticket.actions.get("openticket:create-ticket").run("panel-button",{guild,user,answers:[],option})
+ if (!res.channel || !res.ticket){
+ //error
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild,channel:instance.channel,user,error:"Unable to receive ticket or channel from callback! #1",layout:"advanced"}))
+ return cancel()
+ }
+ if (generalConfig.data.system.replyOnTicketCreation) await instance.reply(await openticket.builders.messages.getSafe("openticket:ticket-created").build("panel-button",{guild,channel:res.channel,user,ticket:res.ticket}))
+ }
+ })
+ )
+}
+
+export const registerDropdownResponders = async () => {
+ //PANEL DROPDOWN TICKETS DROPDOWN RESPONDER
+ openticket.responders.dropdowns.add(new api.ODDropdownResponder("openticket:panel-dropdown-tickets",/^od:panel-dropdown_/))
+ openticket.responders.dropdowns.get("openticket:panel-dropdown-tickets").workers.add(
+ new api.ODWorker("openticket:panel-dropdown-tickets",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //get option
+ const optionId = instance.values.getStringValues()[0].split("_")[2]
+ const option = openticket.options.get(optionId)
+ if (!option || !(option instanceof api.ODTicketOption)){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-option-unknown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ return cancel()
+ }
+
+ //check ticket permissions
+ const res = await openticket.actions.get("openticket:create-ticket-permissions").run("panel-dropdown",{guild,user,option})
+ if (!res.valid){
+ //error
+ if (res.reason == "blacklist") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-blacklisted").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user}))
+ else if (res.reason == "cooldown") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-cooldown").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,until:res.cooldownUntil}))
+ else if (res.reason == "global-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global"}))
+ else if (res.reason == "global-user-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"}))
+ else if (res.reason == "option-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"}))
+ else if (res.reason == "option-user-limit") instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"}))
+ else instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"}))
+ return cancel()
+ }
+
+ //start ticket creation
+ if (option.exists("openticket:questions") && option.get("openticket:questions").value.length > 0){
+ //send modal
+ instance.modal(await openticket.builders.modals.getSafe("openticket:ticket-questions").build("panel-dropdown",{guild,channel,user,option}))
+ }else{
+ //create ticket
+ await instance.defer("reply",true)
+ const res = await openticket.actions.get("openticket:create-ticket").run("panel-dropdown",{guild,user,answers:[],option})
+ if (!res.channel || !res.ticket){
+ //error
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild,channel:instance.channel,user,error:"Unable to receive ticket or channel from callback! #1",layout:"advanced"}))
+ return cancel()
+ }
+ if (generalConfig.data.system.replyOnTicketCreation) await instance.reply(await openticket.builders.messages.getSafe("openticket:ticket-created").build("panel-dropdown",{guild,channel:res.channel,user,ticket:res.ticket}))
+ }
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //TICKET QUESTIONS RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:ticket-questions",/^od:ticket-questions_/))
+ openticket.responders.modals.get("openticket:ticket-questions").workers.add([
+ new api.ODWorker("openticket:ticket-questions",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) throw new api.ODSystemError("The 'Ticket Questions' modal Requires a channel for responding!")
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("panel-button"|"panel-dropdown"|"slash"|"text"|"other")
+
+ //get option
+ const optionId = instance.interaction.customId.split("_")[1]
+ const option = openticket.options.get(optionId)
+ if (!option || !(option instanceof api.ODTicketOption)){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-option-unknown").build(source,{guild:instance.guild,channel,user:instance.user}))
+ return cancel()
+ }
+
+ //get answers
+ const answers: {id:string,name:string,type:"short"|"paragraph",value:string|null}[] = []
+ option.get("openticket:questions").value.forEach((id) => {
+ const question = openticket.questions.get(id)
+ if (!question) return
+ if (question instanceof api.ODShortQuestion){
+ answers.push({
+ id,
+ name:question.exists("openticket:name") ? question.get("openticket:name")?.value : id,
+ type:"short",
+ value:instance.values.getTextField(id,false)
+ })
+ }else if (question instanceof api.ODParagraphQuestion){
+ answers.push({
+ id,
+ name:question.exists("openticket:name") ? question.get("openticket:name")?.value : id,
+ type:"paragraph",
+ value:instance.values.getTextField(id,false)
+ })
+ }
+ })
+
+ //create ticket
+ await instance.defer("reply",true)
+ const res = await openticket.actions.get("openticket:create-ticket").run(originalSource,{guild,user,answers,option})
+ if (!res.channel || !res.ticket){
+ //error
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild,channel,user,error:"Unable to receive ticket or channel from callback! #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (generalConfig.data.system.replyOnTicketCreation) await instance.reply(await openticket.builders.messages.getSafe("openticket:ticket-created").build(originalSource,{guild,channel:res.channel,user,ticket:res.ticket}))
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/unclaim.ts b/src/commands/unclaim.ts
new file mode 100644
index 0000000..784fa8a
--- /dev/null
+++ b/src/commands/unclaim.ts
@@ -0,0 +1,136 @@
+///////////////////////////////////////
+//UNCLAIM COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //UNCLAIM COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:unclaim",generalConfig.data.prefix,"unclaim"))
+ openticket.responders.commands.get("openticket:unclaim").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.unclaim
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:unclaim",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not claimed
+ if (!ticket.get("openticket:claimed").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is not claimed yet!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const reason = instance.options.getString("reason",false)
+
+ //start unclaiming ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:unclaim-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:unclaim-message").build(source,{guild,channel,user,ticket,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'unclaim' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //UNCLAIM TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:unclaim-ticket",/^od:unclaim-ticket/))
+ openticket.responders.buttons.get("openticket:unclaim-ticket").workers.add(
+ new api.ODWorker("openticket:unclaim-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "claim-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:unclaim-ticket-ticket-message").activate(instance)
+ else await openticket.verifybars.get("openticket:unclaim-ticket-claim-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //UNCLAIM WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:unclaim-ticket-reason",/^od:unclaim-ticket-reason_/))
+ openticket.responders.modals.get("openticket:unclaim-ticket-reason").workers.add([
+ new api.ODWorker("openticket:unclaim-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"claim-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //unclaim with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unclaim-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "claim-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unclaim-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:unclaim-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unclaim-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ }
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/commands/unpin.ts b/src/commands/unpin.ts
new file mode 100644
index 0000000..c39daf2
--- /dev/null
+++ b/src/commands/unpin.ts
@@ -0,0 +1,136 @@
+///////////////////////////////////////
+//UNPIN COMMAND
+///////////////////////////////////////
+import {openticket, api, utilities} from "../index"
+import * as discord from "discord.js"
+
+const generalConfig = openticket.configs.get("openticket:general")
+
+export const registerCommandResponders = async () => {
+ //UNPIN COMMAND RESPONDER
+ openticket.responders.commands.add(new api.ODCommandResponder("openticket:unpin",generalConfig.data.prefix,"unpin"))
+ openticket.responders.commands.get("openticket:unpin").workers.add([
+ new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
+ const permissionMode = generalConfig.data.system.permissions.unpin
+
+ if (permissionMode == "none"){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else if (permissionMode == "everyone") return
+ else if (permissionMode == "admin"){
+ if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
+ return cancel()
+ }else return
+ }else{
+ if (!instance.guild || !instance.member){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
+ return cancel()
+ }
+ const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
+ if (!role){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
+ return cancel()
+ }
+ if (!role.members.has(instance.member.id)){
+ //no permissions
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
+ return cancel()
+ }else return
+ }
+ }),
+ new api.ODWorker("openticket:unpin",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!guild){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(channel.id)
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return cancel()
+ }
+ //return when not pinned yet
+ if (!ticket.get("openticket:pinned").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:"Ticket is not pinned yet!",layout:"simple"}))
+ return cancel()
+ }
+ //return when busy
+ if (ticket.get("openticket:busy").value){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
+ return cancel()
+ }
+
+ const reason = instance.options.getString("reason",false)
+
+ //start unpinning ticket
+ await instance.defer(false)
+ await openticket.actions.get("openticket:unpin-ticket").run(source,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.reply(await openticket.builders.messages.getSafe("openticket:unpin-message").build(source,{guild,channel,user,ticket,reason}))
+ }),
+ new api.ODWorker("openticket:logs",-1,(instance,params,source,cancel) => {
+ openticket.log(instance.user.displayName+" used the 'unpin' command!","info",[
+ {key:"user",value:instance.user.username},
+ {key:"userid",value:instance.user.id,hidden:true},
+ {key:"channelid",value:instance.channel.id,hidden:true},
+ {key:"method",value:source}
+ ])
+ })
+ ])
+}
+
+export const registerButtonResponders = async () => {
+ //UNPIN TICKET BUTTON RESPONDER
+ openticket.responders.buttons.add(new api.ODButtonResponder("openticket:unpin-ticket",/^od:unpin-ticket/))
+ openticket.responders.buttons.get("openticket:unpin-ticket").workers.add(
+ new api.ODWorker("openticket:unpin-ticket",0,async (instance,params,source,cancel) => {
+ const originalSource = instance.interaction.customId.split("_")[1]
+ if (originalSource != "ticket-message" && originalSource != "pin-message") return
+
+ if (originalSource == "ticket-message") await openticket.verifybars.get("openticket:unpin-ticket-ticket-message").activate(instance)
+ else await openticket.verifybars.get("openticket:unpin-ticket-pin-message").activate(instance)
+ })
+ )
+}
+
+export const registerModalResponders = async () => {
+ //UNPIN WITH REASON MODAL RESPONDER
+ openticket.responders.modals.add(new api.ODModalResponder("openticket:unpin-ticket-reason",/^od:unpin-ticket-reason_/))
+ openticket.responders.modals.get("openticket:unpin-ticket-reason").workers.add([
+ new api.ODWorker("openticket:unpin-ticket-reason",0,async (instance,params,source,cancel) => {
+ const {guild,channel,user} = instance
+ if (!channel) return
+ if (!guild){
+ //error
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build(source,{channel,user:instance.user}))
+ return cancel()
+ }
+ const ticket = openticket.tickets.get(instance.interaction.customId.split("_")[1])
+ if (!ticket || channel.isDMBased()){
+ instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
+ return
+ }
+
+ const originalSource = instance.interaction.customId.split("_")[2] as ("ticket-message"|"pin-message"|"other")
+ const reason = instance.values.getTextField("reason",true)
+
+ //unpin with reason
+ if (originalSource == "ticket-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unpin-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
+ }else if (originalSource == "pin-message"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unpin-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:false})
+ await instance.update(await openticket.builders.messages.getSafe("openticket:unpin-message").build("other",{guild,channel,user,ticket,reason}))
+ }else if (originalSource == "other"){
+ await instance.defer("update",false)
+ await openticket.actions.get("openticket:unpin-ticket").run(originalSource,{guild,channel,user,ticket,reason,sendMessage:true})
+ }
+ })
+ ])
+}
\ No newline at end of file
diff --git a/src/core/api/api.ts b/src/core/api/api.ts
new file mode 100644
index 0000000..387de94
--- /dev/null
+++ b/src/core/api/api.ts
@@ -0,0 +1,60 @@
+//MAIN MODULE
+export * from "./main"
+
+//BASE MODULES
+export * from "./modules/base"
+export * from "./modules/event"
+export * from "./modules/config"
+export * from "./modules/database"
+export * from "./modules/language"
+export * from "./modules/flag"
+export * from "./modules/console"
+export * from "./modules/defaults"
+export * from "./modules/plugin"
+export * from "./modules/checker"
+export * from "./modules/client"
+export * from "./modules/worker"
+export * from "./modules/builder"
+export * from "./modules/responder"
+export * from "./modules/action"
+export * from "./modules/permission"
+export * from "./modules/helpmenu"
+export * from "./modules/session"
+export * from "./modules/stat"
+export * from "./modules/code"
+export * from "./modules/cooldown"
+export * from "./modules/post"
+export * from "./modules/verifybar"
+export * from "./modules/startscreen"
+
+//OPENTICKET DEFAULT MODULES
+export * from "./defaults/base"
+export * from "./defaults/event"
+export * from "./defaults/config"
+export * from "./defaults/database"
+export * from "./defaults/checker"
+export * from "./defaults/client"
+export * from "./defaults/language"
+export * from "./defaults/builder"
+export * from "./defaults/responder"
+export * from "./defaults/action"
+export * from "./defaults/flag"
+export * from "./defaults/permission"
+export * from "./defaults/helpmenu"
+export * from "./defaults/session"
+export * from "./defaults/stat"
+export * from "./defaults/worker"
+export * from "./defaults/code"
+export * from "./defaults/cooldown"
+export * from "./defaults/post"
+export * from "./defaults/startscreen"
+export * from "./defaults/console"
+
+//OPENTICKET MODULES
+export * from "./openticket/question"
+export * from "./openticket/option"
+export * from "./openticket/panel"
+export * from "./openticket/ticket"
+export * from "./openticket/blacklist"
+export * from "./openticket/transcript"
+export * from "./openticket/role"
\ No newline at end of file
diff --git a/src/core/api/defaults/action.ts b/src/core/api/defaults/action.ts
new file mode 100644
index 0000000..c8d68a8
--- /dev/null
+++ b/src/core/api/defaults/action.ts
@@ -0,0 +1,154 @@
+///////////////////////////////////////
+//DEFAULT ACTION MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODAction, ODActionManager } from "../modules/action"
+import { ODWorkerManager_Default } from "./worker"
+import * as discord from "discord.js"
+import { ODRoleOption, ODTicketOption } from "../openticket/option"
+import { ODTicket, ODTicketClearFilter } from "../openticket/ticket"
+import { ODTranscriptCompiler, ODTranscriptCompilerCompileResult } from "../openticket/transcript"
+import { ODMessageBuildSentResult } from "../modules/builder"
+import { ODRole, OTRoleUpdateMode, OTRoleUpdateResult } from "../openticket/role"
+
+/**## ODActionManagerIds_Default `type`
+ * This type is an array of ids available in the `ODActionManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODActionManagerIds_Default {
+ "openticket:create-ticket-permissions":{
+ source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",
+ params:{guild:discord.Guild,user:discord.User,option:ODTicketOption},
+ result:{valid:boolean,reason:"blacklist"|"cooldown"|"global-limit"|"global-user-limit"|"option-limit"|"option-user-limit"|null,cooldownUntil?:Date},
+ workers:"openticket:check-blacklist"|"openticket:check-cooldown"|"openticket:check-global-limits"|"openticket:check-option-limits"|"openticket:valid"
+ },
+ "openticket:create-transcript":{
+ source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket},
+ result:{compiler:ODTranscriptCompiler, success:boolean, result:ODTranscriptCompilerCompileResult, errorReason:string|null, pendingMessage:ODMessageBuildSentResult|null, participants:{user:discord.User,role:"creator"|"participant"|"admin"}[]},
+ workers:"openticket:select-compiler"|"openticket:init-transcript"|"openticket:compile-transcript"|"openticket:ready-transcript"|"openticket:logs"
+ },
+ "openticket:create-ticket":{
+ source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",
+ params:{guild:discord.Guild,user:discord.User,option:ODTicketOption,answers:{id:string,name:string,type:"short"|"paragraph",value:string|null}[]},
+ result:{channel:discord.GuildTextBasedChannel,ticket:ODTicket},
+ workers:"openticket:create-ticket"|"openticket:send-ticket-message"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:close-ticket":{
+ source:"slash"|"text"|"ticket-message"|"reopen-message"|"autoclose"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean},
+ result:{},
+ workers:"openticket:close-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:delete-ticket":{
+ source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean,withoutTranscript:boolean},
+ result:{},
+ workers:"openticket:delete-ticket"|"openticket:discord-logs"|"openticket:delete-channel"|"openticket:logs"
+ },
+ "openticket:reopen-ticket":{
+ source:"slash"|"text"|"ticket-message"|"close-message"|"autoclose-message"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean},
+ result:{},
+ workers:"openticket:reopen-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:claim-ticket":{
+ source:"slash"|"text"|"ticket-message"|"unclaim-message"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean},
+ result:{},
+ workers:"openticket:claim-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:unclaim-ticket":{
+ source:"slash"|"text"|"ticket-message"|"claim-message"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean},
+ result:{},
+ workers:"openticket:unclaim-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:pin-ticket":{
+ source:"slash"|"text"|"ticket-message"|"unpin-message"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean},
+ result:{},
+ workers:"openticket:pin-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:unpin-ticket":{
+ source:"slash"|"text"|"ticket-message"|"pin-message"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean},
+ result:{},
+ workers:"openticket:unpin-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:rename-ticket":{
+ source:"slash"|"text"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean,data:string},
+ result:{},
+ workers:"openticket:rename-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:move-ticket":{
+ source:"slash"|"text"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean,data:ODTicketOption},
+ result:{},
+ workers:"openticket:move-ticket"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:add-ticket-user":{
+ source:"slash"|"text"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean,data:discord.User},
+ result:{},
+ workers:"openticket:add-ticket-user"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:remove-ticket-user":{
+ source:"slash"|"text"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,sendMessage:boolean,data:discord.User},
+ result:{},
+ workers:"openticket:remove-ticket-user"|"openticket:discord-logs"|"openticket:logs"
+ },
+ "openticket:reaction-role":{
+ source:"panel-button"|"other",
+ params:{guild:discord.Guild,user:discord.User,option:ODRoleOption,overwriteMode:OTRoleUpdateMode|null},
+ result:{result:OTRoleUpdateResult[],role:ODRole},
+ workers:"openticket:reaction-role"|"openticket:logs"
+ },
+ "openticket:clear-tickets":{
+ source:"slash"|"text"|"other",
+ params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:ODTicket[]},
+ result:{list:string[]},
+ workers:"openticket:clear-tickets"|"openticket:discord-logs"|"openticket:logs"
+ }
+}
+
+/**## ODActionManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODActionManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.actions`!
+ */
+export class ODActionManager_Default extends ODActionManager {
+ get(id:ActionId): ODAction_Default
+ get(id:ODValidId): ODAction|null
+
+ get(id:ODValidId): ODAction|null {
+ return super.get(id)
+ }
+
+ remove(id:ActionId): ODAction_Default
+ remove(id:ODValidId): ODAction|null
+
+ remove(id:ODValidId): ODAction|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODActionManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODAction_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODAction class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODAction`'s!
+ */
+export class ODAction_Default extends ODAction {
+ declare workers: ODWorkerManager_Default
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/base.ts b/src/core/api/defaults/base.ts
new file mode 100644
index 0000000..fceda6e
--- /dev/null
+++ b/src/core/api/defaults/base.ts
@@ -0,0 +1,45 @@
+///////////////////////////////////////
+//BASE MODULE
+///////////////////////////////////////
+import { ODVersion, ODVersionManager, ODValidId } from "../modules/base"
+
+/**## ODVersionManagerIds_Default `type`
+ * This type is an array of ids available in the `ODVersionManager` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODVersionManagerIds_Default {
+ "openticket:version":ODVersion,
+ "openticket:last-version":ODVersion,
+ "openticket:api":ODVersion,
+ "openticket:transcripts":ODVersion,
+ "openticket:livestatus":ODVersion
+}
+
+/**## ODFlagManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFlagManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.flags`!
+ */
+export class ODVersionManager_Default extends ODVersionManager {
+ get(id:VersionId): ODVersionManagerIds_Default[VersionId]
+ get(id:ODValidId): ODVersion|null
+
+ get(id:ODValidId): ODVersion|null {
+ return super.get(id)
+ }
+
+ remove(id:VersionId): ODVersionManagerIds_Default[VersionId]
+ remove(id:ODValidId): ODVersion|null
+
+ remove(id:ODValidId): ODVersion|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODVersionManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/builder.ts b/src/core/api/defaults/builder.ts
new file mode 100644
index 0000000..0620071
--- /dev/null
+++ b/src/core/api/defaults/builder.ts
@@ -0,0 +1,532 @@
+///////////////////////////////////////
+//DEFAULT BUILDER MODULE
+///////////////////////////////////////
+import { ODValidButtonColor, ODValidId } from "../modules/base"
+import { ODBuilderManager, ODButton, ODButtonInstance, ODButtonManager, ODDropdown, ODDropdownInstance, ODDropdownManager, ODEmbed, ODEmbedInstance, ODEmbedManager, ODFile, ODFileInstance, ODFileManager, ODMessage, ODMessageInstance, ODMessageManager, ODModal, ODModalInstance, ODModalManager } from "../modules/builder"
+import { ODWorkerManager_Default } from "./worker"
+import { ODTicket, ODTicketClearFilter } from "../openticket/ticket"
+import { ODPermissionEmbedType } from "../defaults/permission"
+import { ODTextCommandErrorInvalidOption, ODTextCommandErrorMissingOption, ODTextCommandErrorUnknownCommand } from "../modules/client"
+import { ODPanel } from "../openticket/panel"
+import { ODRoleOption, ODTicketOption, ODWebsiteOption } from "../openticket/option"
+import { ODVerifyBar } from "../modules/verifybar"
+import * as discord from "discord.js"
+import { ODTranscriptCompiler, ODTranscriptCompilerCompileResult } from "../openticket/transcript"
+import { ODRole, OTRoleUpdateResult } from "../openticket/role"
+
+/**## ODBuilderManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODBuilderManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders`!
+ */
+export class ODBuilderManager_Default extends ODBuilderManager {
+ declare buttons: ODButtonManager_Default
+ declare dropdowns: ODDropdownManager_Default
+ declare files: ODFileManager_Default
+ declare embeds: ODEmbedManager_Default
+ declare messages: ODMessageManager_Default
+ declare modals: ODModalManager_Default
+}
+
+/**## ODButtonManagerIds_Default `type`
+ * This type is an array of ids available in the `ODButtonManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODButtonManagerIds_Default {
+ "openticket:verifybar-success":{source:"verifybar"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,customData?:string,customColor?:ODValidButtonColor,customLabel?:string,customEmoji?:string},workers:"openticket:verifybar-success"},
+ "openticket:verifybar-failure":{source:"verifybar"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,customData?:string,customColor?:ODValidButtonColor,customLabel?:string,customEmoji?:string},workers:"openticket:verifybar-failure"},
+
+ "openticket:error-ticket-deprecated-transcript":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{},workers:"openticket:error-ticket-deprecated-transcript"},
+
+ "openticket:help-menu-previous":{source:"text"|"slash"|"button"|"other",params:{mode:"slash"|"text",page:number},workers:"openticket:help-menu-previous"},
+ "openticket:help-menu-next":{source:"text"|"slash"|"button"|"other",params:{mode:"slash"|"text",page:number},workers:"openticket:help-menu-next"},
+ "openticket:help-menu-page":{source:"text"|"slash"|"button"|"other",params:{mode:"slash"|"text",page:number},workers:"openticket:help-menu-page"}
+ "openticket:help-menu-switch":{source:"text"|"slash"|"button"|"other",params:{mode:"slash"|"text",page:number},workers:"openticket:help-menu-switch"},
+
+ "openticket:ticket-option":{source:"slash"|"text"|"auto-update"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel,option:ODTicketOption},workers:"openticket:ticket-option"},
+ "openticket:website-option":{source:"slash"|"text"|"auto-update"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel,option:ODWebsiteOption},workers:"openticket:website-option"},
+ "openticket:role-option":{source:"slash"|"text"|"auto-update"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel,option:ODRoleOption},workers:"openticket:role-option"}
+
+ "openticket:visit-ticket":{source:"ticket-created"|"dm"|"logs"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:visit-ticket"},
+
+ "openticket:close-ticket":{source:"ticket-message"|"reopen-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:close-ticket"},
+ "openticket:delete-ticket":{source:"ticket-message"|"close-message"|"autoclose-message"|"reopen-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:delete-ticket"},
+ "openticket:reopen-ticket":{source:"ticket-message"|"close-message"|"autoclose-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:reopen-ticket"},
+ "openticket:claim-ticket":{source:"ticket-message"|"unclaim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:claim-ticket"},
+ "openticket:unclaim-ticket":{source:"ticket-message"|"claim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:unclaim-ticket"},
+ "openticket:pin-ticket":{source:"ticket-message"|"unpin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:pin-ticket"},
+ "openticket:unpin-ticket":{source:"ticket-message"|"pin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:unpin-ticket"},
+
+ "openticket:transcript-html-visit":{source:"channel"|"creator-dm"|"participant-dm"|"active-admin-dm"|"every-admin-dm"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{url:string}>,result:ODTranscriptCompilerCompileResult<{url:string}>},workers:"openticket:transcript-html-visit"},
+ "openticket:transcript-error-retry":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler,reason:string|null},workers:"openticket:transcript-error-retry"},
+ "openticket:transcript-error-continue":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler,reason:string|null},workers:"openticket:transcript-error-continue"},
+
+ "openticket:clear-continue":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-continue"},
+}
+
+/**## ODButtonManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODButtonManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders.buttons`!
+ */
+export class ODButtonManager_Default extends ODButtonManager {
+ get(id:ButtonId): ODButton_Default
+ get(id:ODValidId): ODButton|null
+
+ get(id:ODValidId): ODButton|null {
+ return super.get(id)
+ }
+
+ remove(id:ButtonId): ODButton_Default
+ remove(id:ODValidId): ODButton|null
+
+ remove(id:ODValidId): ODButton|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODButtonManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getSafe(id:ButtonId): ODButton_Default
+ getSafe(id:ODValidId): ODButton
+
+ getSafe(id:ODValidId): ODButton {
+ return super.getSafe(id)
+ }
+}
+
+/**## ODButton_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODButton class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODButton`'s!
+ */
+export class ODButton_Default extends ODButton {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODDropdownManagerIds_Default `type`
+ * This type is an array of ids available in the `ODDropdownManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODDropdownManagerIds_Default {
+ "openticket:panel-dropdown-tickets":{source:"slash"|"text"|"auto-update"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel,options:ODTicketOption[]},workers:"openticket:panel-dropdown-tickets"}
+}
+
+/**## ODDropdownManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODDropdownManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders.dropdowns`!
+ */
+export class ODDropdownManager_Default extends ODDropdownManager {
+ get(id:DropdownId): ODDropdown_Default
+ get(id:ODValidId): ODDropdown|null
+
+ get(id:ODValidId): ODDropdown|null {
+ return super.get(id)
+ }
+
+ remove(id:DropdownId): ODDropdown_Default
+ remove(id:ODValidId): ODDropdown|null
+
+ remove(id:ODValidId): ODDropdown|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODDropdownManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getSafe(id:DropdownId): ODDropdown_Default
+ getSafe(id:ODValidId): ODDropdown
+
+ getSafe(id:ODValidId): ODDropdown {
+ return super.getSafe(id)
+ }
+}
+
+/**## ODDropdown_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODDropdown class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODDropdown`'s!
+ */
+export class ODDropdown_Default extends ODDropdown {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODFileManagerIds_Default `type`
+ * This type is an array of ids available in the `ODFileManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODFileManagerIds_Default {
+ "openticket:text-transcript":{source:"channel"|"creator-dm"|"participant-dm"|"active-admin-dm"|"every-admin-dm"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler,result:ODTranscriptCompilerCompileResult},workers:"openticket:text-transcript"}
+}
+
+/**## ODFileManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFileManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders.files`!
+ */
+export class ODFileManager_Default extends ODFileManager {
+ get(id:FileId): ODFile_Default
+ get(id:ODValidId): ODFile|null
+
+ get(id:ODValidId): ODFile|null {
+ return super.get(id)
+ }
+
+ remove(id:FileId): ODFile_Default
+ remove(id:ODValidId): ODFile|null
+
+ remove(id:ODValidId): ODFile|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODFileManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getSafe(id:FileId): ODFile_Default
+ getSafe(id:ODValidId): ODFile
+
+ getSafe(id:ODValidId): ODFile {
+ return super.getSafe(id)
+ }
+}
+
+/**## ODFile_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFile class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODFile`'s!
+ */
+export class ODFile_Default extends ODFile {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODEmbedManagerIds_Default `type`
+ * This type is an array of ids available in the `ODEmbedManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODEmbedManagerIds_Default {
+ "openticket:error":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:string,layout:"simple"|"advanced"},workers:"openticket:error"},
+ "openticket:error-option-missing":{source:"slash"|"text"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:ODTextCommandErrorMissingOption},workers:"openticket:error-option-missing"},
+ "openticket:error-option-invalid":{source:"slash"|"text"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:ODTextCommandErrorInvalidOption},workers:"openticket:error-option-invalid"},
+ "openticket:error-unknown-command":{source:"slash"|"text"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:ODTextCommandErrorUnknownCommand},workers:"openticket:error-unknown-command"},
+ "openticket:error-no-permissions":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,permissions:ODPermissionEmbedType[]},workers:"openticket:error-no-permissions"},
+ "openticket:error-no-permissions-cooldown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,until?:Date},workers:"openticket:error-no-permissions-cooldown"},
+ "openticket:error-no-permissions-blacklisted":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-no-permissions-blacklisted"},
+ "openticket:error-no-permissions-limits":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,limit:"global"|"global-user"|"option"|"option-user"},workers:"openticket:error-no-permissions-limits"},
+ "openticket:error-responder-timeout":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-responder-timeout"},
+ "openticket:error-ticket-unknown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-ticket-unknown"},
+ "openticket:error-ticket-deprecated":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-ticket-deprecated"},
+ "openticket:error-option-unknown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-option-unknown"},
+ "openticket:error-panel-unknown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-panel-unknown"},
+ "openticket:error-not-in-guild":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-not-in-guild"},
+ "openticket:error-channel-rename":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"ticket-pin"|"ticket-unpin"|"ticket-rename"|"ticket-move"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,originalName:string,newName:string},workers:"openticket:error-channel-rename"},
+ "openticket:error-ticket-busy":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-ticket-busy"},
+
+ "openticket:help-menu":{source:"text"|"slash"|"button"|"other",params:{mode:"slash"|"text",page:number},workers:"openticket:help-menu"},
+
+ "openticket:stats-global":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:stats-global"},
+ "openticket:stats-ticket":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,scopeData:ODTicket},workers:"openticket:stats-ticket"},
+ "openticket:stats-user":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,scopeData:discord.User},workers:"openticket:stats-user"|"openticket:easter-egg"},
+ "openticket:stats-reset":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,reason:string|null},workers:"openticket:stats-reset"},
+ "openticket:stats-ticket-unknown":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,id:string},workers:"openticket:stats-ticket-unknown"},
+
+ "openticket:panel":{source:"slash"|"text"|"auto-update"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel},workers:"openticket:panel"},
+ "openticket:ticket-created":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-created"},
+ "openticket:ticket-created-dm":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-created-dm"},
+ "openticket:ticket-created-logs":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-created-logs"},
+ "openticket:ticket-message":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-message"},
+ "openticket:close-message":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"autoclose"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:close-message"},
+ "openticket:reopen-message":{source:"slash"|"text"|"ticket-message"|"close-message"|"autoclose-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:reopen-message"},
+ "openticket:delete-message":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:delete-message"},
+ "openticket:claim-message":{source:"slash"|"text"|"ticket-message"|"unclaim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:claim-message"},
+ "openticket:unclaim-message":{source:"slash"|"text"|"ticket-message"|"claim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:unclaim-message"},
+ "openticket:pin-message":{source:"slash"|"text"|"ticket-message"|"unpin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:pin-message"},
+ "openticket:unpin-message":{source:"slash"|"text"|"ticket-message"|"pin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:unpin-message"},
+ "openticket:rename-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:string},workers:"openticket:rename-message"},
+ "openticket:move-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:ODTicketOption},workers:"openticket:move-message"},
+ "openticket:add-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:discord.User},workers:"openticket:add-message"},
+ "openticket:remove-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:discord.User},workers:"openticket:remove-message"},
+ "openticket:ticket-action-dm":{source:"slash"|"text"|"ticket-message"|"close-message"|"reopen-message"|"delete-message"|"claim-message"|"unclaim-message"|"pin-message"|"unpin-message"|"autoclose-message"|"autoclose"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"close"|"reopen"|"delete"|"claim"|"unclaim"|"pin"|"unpin"|"rename"|"move"|"add"|"remove",ticket:ODTicket,reason:string|null,additionalData:null|string|discord.User|ODTicketOption},workers:"openticket:ticket-action-dm"},
+ "openticket:ticket-action-logs":{source:"slash"|"text"|"ticket-message"|"close-message"|"reopen-message"|"delete-message"|"claim-message"|"unclaim-message"|"pin-message"|"unpin-message"|"autoclose-message"|"autoclose"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"close"|"reopen"|"delete"|"claim"|"unclaim"|"pin"|"unpin"|"rename"|"move"|"add"|"remove",ticket:ODTicket,reason:string|null,additionalData:null|string|discord.User|ODTicketOption},workers:"openticket:ticket-action-logs"},
+
+ "openticket:blacklist-view":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:blacklist-view"},
+ "openticket:blacklist-get":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,data:discord.User},workers:"openticket:blacklist-get"},
+ "openticket:blacklist-add":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,data:discord.User,reason:string|null},workers:"openticket:blacklist-add"},
+ "openticket:blacklist-remove":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,data:discord.User,reason:string|null},workers:"openticket:blacklist-remove"}
+ "openticket:blacklist-dm":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"add"|"remove",data:discord.User,reason:string|null},workers:"openticket:blacklist-dm"},
+ "openticket:blacklist-logs":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"add"|"remove",data:discord.User,reason:string|null},workers:"openticket:blacklist-logs"},
+
+ "openticket:transcript-text-ready":{source:"channel"|"creator-dm"|"participant-dm"|"active-admin-dm"|"every-admin-dm"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{contents:string}>,result:ODTranscriptCompilerCompileResult<{contents:string}>},workers:"openticket:transcript-text-ready"},
+ "openticket:transcript-html-ready":{source:"channel"|"creator-dm"|"participant-dm"|"active-admin-dm"|"every-admin-dm"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{url:string}>,result:ODTranscriptCompilerCompileResult<{url:string}>},workers:"openticket:transcript-html-ready"},
+ "openticket:transcript-html-progress":{source:"channel"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{url:string}>,remaining:number},workers:"openticket:transcript-html-progress"},
+ "openticket:transcript-error":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler,reason:string|null},workers:"openticket:transcript-error"},
+
+ "openticket:reaction-role":{source:"panel-button"|"other",params:{guild:discord.Guild,user:discord.User,role:ODRole,result:OTRoleUpdateResult[]},workers:"openticket:reaction-role"},
+ "openticket:clear-verify-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-verify-message"},
+ "openticket:clear-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-message"},
+ "openticket:clear-logs":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-logs"},
+
+ "openticket:autoclose-message":{source:"timeout"|"leave"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:autoclose-message"},
+ "openticket:autodelete-message":{source:"timeout"|"leave"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:autodelete-message"},
+ "openticket:autoclose-enable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,time:number,reason:string|null},workers:"openticket:autoclose-enable"},
+ "openticket:autodelete-enable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,time:number,reason:string|null},workers:"openticket:autodelete-enable"},
+ "openticket:autoclose-disable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:autoclose-disable"},
+ "openticket:autodelete-disable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:autodelete-disable"},
+}
+
+/**## ODEmbedManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODEmbedManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders.embeds`!
+ */
+export class ODEmbedManager_Default extends ODEmbedManager {
+ get(id:EmbedId): ODEmbed_Default
+ get(id:ODValidId): ODEmbed|null
+
+ get(id:ODValidId): ODEmbed|null {
+ return super.get(id)
+ }
+
+ remove(id:EmbedId): ODEmbed_Default
+ remove(id:ODValidId): ODEmbed|null
+
+ remove(id:ODValidId): ODEmbed|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODEmbedManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getSafe(id:EmbedId): ODEmbed_Default
+ getSafe(id:ODValidId): ODEmbed
+
+ getSafe(id:ODValidId): ODEmbed {
+ return super.getSafe(id)
+ }
+}
+
+/**## ODEmbed_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODEmbed class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODEmbed`'s!
+ */
+export class ODEmbed_Default extends ODEmbed {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODMessageManagerIds_Default `type`
+ * This type is an array of ids available in the `ODMessageManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODMessageManagerIds_Default {
+ "openticket:verifybar-ticket-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-ticket-message"},
+ "openticket:verifybar-close-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-close-message"},
+ "openticket:verifybar-reopen-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-reopen-message"},
+ "openticket:verifybar-claim-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-claim-message"},
+ "openticket:verifybar-unclaim-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-unclaim-message"},
+ "openticket:verifybar-pin-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-pin-message"},
+ "openticket:verifybar-unpin-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-unpin-message"}
+ "openticket:verifybar-autoclose-message":{source:"verifybar",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message},workers:"openticket:verifybar-autoclose-message"}
+
+ "openticket:error":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:string,layout:"simple"|"advanced"},workers:"openticket:error"},
+ "openticket:error-option-missing":{source:"slash"|"text"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:ODTextCommandErrorMissingOption},workers:"openticket:error-option-missing"},
+ "openticket:error-option-invalid":{source:"slash"|"text"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:ODTextCommandErrorInvalidOption},workers:"openticket:error-option-invalid"},
+ "openticket:error-unknown-command":{source:"slash"|"text"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,error:ODTextCommandErrorUnknownCommand},workers:"openticket:error-unknown-command"},
+ "openticket:error-no-permissions":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,permissions:ODPermissionEmbedType[]},workers:"openticket:error-no-permissions"},
+ "openticket:error-no-permissions-cooldown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,until?:Date},workers:"openticket:error-no-permissions-cooldown"},
+ "openticket:error-no-permissions-blacklisted":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-no-permissions-blacklisted"},
+ "openticket:error-no-permissions-limits":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,limit:"global"|"global-user"|"option"|"option-user"},workers:"openticket:error-no-permissions-limits"},
+ "openticket:error-responder-timeout":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-responder-timeout"},
+ "openticket:error-ticket-unknown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-ticket-unknown"},
+ "openticket:error-ticket-deprecated":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-ticket-deprecated"},
+ "openticket:error-option-unknown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-option-unknown"},
+ "openticket:error-panel-unknown":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-panel-unknown"},
+ "openticket:error-not-in-guild":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-not-in-guild"},
+ "openticket:error-channel-rename":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"ticket-pin"|"ticket-unpin"|"ticket-rename"|"ticket-move"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,originalName:string,newName:string},workers:"openticket:error-channel-rename"},
+ "openticket:error-ticket-busy":{source:"slash"|"text"|"button"|"dropdown"|"modal"|"other",params:{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:error-ticket-busy"},
+
+ "openticket:help-menu":{source:"slash"|"text"|"button"|"other",params:{mode:"slash"|"text",page:number},workers:"openticket:help-menu"},
+
+ "openticket:stats-global":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:stats-global"},
+ "openticket:stats-ticket":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,scopeData:ODTicket},workers:"openticket:stats-ticket"},
+ "openticket:stats-user":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,scopeData:discord.User},workers:"openticket:stats-user"|"openticket:easter-egg"},
+ "openticket:stats-reset":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,reason:string|null},workers:"openticket:stats-reset"},
+ "openticket:stats-ticket-unknown":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,id:string},workers:"openticket:stats-ticket-unknown"},
+
+ "openticket:panel":{source:"slash"|"text"|"auto-update"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel},workers:"openticket:panel-layout"|"openticket:panel-components"},
+ "openticket:panel-ready":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,panel:ODPanel},workers:"openticket:panel-ready"},
+
+ "openticket:ticket-created":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-created"},
+ "openticket:ticket-created-dm":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-created-dm"},
+ "openticket:ticket-created-logs":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-created-logs"},
+ "openticket:ticket-message":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:ticket-message-layout"|"openticket:ticket-message-components"|"openticket:ticket-message-disable-components"},
+ "openticket:close-message":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"autoclose"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:close-message"},
+ "openticket:reopen-message":{source:"slash"|"text"|"ticket-message"|"close-message"|"autoclose-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:reopen-message"},
+ "openticket:delete-message":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:delete-message"},
+ "openticket:claim-message":{source:"slash"|"text"|"ticket-message"|"unclaim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:claim-message"},
+ "openticket:unclaim-message":{source:"slash"|"text"|"ticket-message"|"claim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:unclaim-message"},
+ "openticket:pin-message":{source:"slash"|"text"|"ticket-message"|"unpin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:pin-message"},
+ "openticket:unpin-message":{source:"slash"|"text"|"ticket-message"|"pin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:unpin-message"},
+ "openticket:rename-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:string},workers:"openticket:rename-message"},
+ "openticket:move-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:ODTicketOption},workers:"openticket:move-message"},
+ "openticket:add-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:discord.User},workers:"openticket:add-message"},
+ "openticket:remove-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null,data:discord.User},workers:"openticket:remove-message"},
+ "openticket:ticket-action-dm":{source:"slash"|"text"|"ticket-message"|"close-message"|"reopen-message"|"delete-message"|"claim-message"|"unclaim-message"|"pin-message"|"unpin-message"|"autoclose-message"|"autoclose"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"close"|"reopen"|"delete"|"claim"|"unclaim"|"pin"|"unpin"|"rename"|"move"|"add"|"remove",ticket:ODTicket,reason:string|null,additionalData:null|string|discord.User|ODTicketOption},workers:"openticket:ticket-action-dm"},
+ "openticket:ticket-action-logs":{source:"slash"|"text"|"ticket-message"|"close-message"|"reopen-message"|"delete-message"|"claim-message"|"unclaim-message"|"pin-message"|"unpin-message"|"autoclose-message"|"autoclose"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"close"|"reopen"|"delete"|"claim"|"unclaim"|"pin"|"unpin"|"rename"|"move"|"add"|"remove",ticket:ODTicket,reason:string|null,additionalData:null|string|discord.User|ODTicketOption},workers:"openticket:ticket-action-logs"},
+
+ "openticket:blacklist-view":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User},workers:"openticket:blacklist-view"},
+ "openticket:blacklist-get":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,data:discord.User},workers:"openticket:blacklist-get"},
+ "openticket:blacklist-add":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,data:discord.User,reason:string|null},workers:"openticket:blacklist-add"},
+ "openticket:blacklist-remove":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,data:discord.User,reason:string|null},workers:"openticket:blacklist-remove"},
+ "openticket:blacklist-dm":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"add"|"remove",data:discord.User,reason:string|null},workers:"openticket:blacklist-dm"},
+ "openticket:blacklist-logs":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,mode:"add"|"remove",data:discord.User,reason:string|null},workers:"openticket:blacklist-logs"},
+
+ "openticket:transcript-text-ready":{source:"channel"|"creator-dm"|"participant-dm"|"active-admin-dm"|"every-admin-dm"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{contents:string}>,result:ODTranscriptCompilerCompileResult<{contents:string}>},workers:"openticket:transcript-text-ready"},
+ "openticket:transcript-html-ready":{source:"channel"|"creator-dm"|"participant-dm"|"active-admin-dm"|"every-admin-dm"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{url:string}>,result:ODTranscriptCompilerCompileResult<{url:string}>},workers:"openticket:transcript-html-ready"},
+ "openticket:transcript-html-progress":{source:"channel"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler<{url:string}>,remaining:number},workers:"openticket:transcript-html-progress"},
+ "openticket:transcript-error":{source:"slash"|"text"|"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"autodelete"|"clear"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,compiler:ODTranscriptCompiler,reason:string|null},workers:"openticket:transcript-error"},
+
+ "openticket:reaction-role":{source:"panel-button"|"other",params:{guild:discord.Guild,user:discord.User,role:ODRole,result:OTRoleUpdateResult[]},workers:"openticket:reaction-role"},
+ "openticket:clear-verify-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-verify-message"},
+ "openticket:clear-message":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-message"},
+ "openticket:clear-logs":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,filter:ODTicketClearFilter,list:string[]},workers:"openticket:clear-logs"},
+
+ "openticket:autoclose-message":{source:"timeout"|"leave"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:autoclose-message"},
+ "openticket:autodelete-message":{source:"timeout"|"leave"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:autodelete-message"},
+ "openticket:autoclose-enable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,time:number,reason:string|null},workers:"openticket:autoclose-enable"},
+ "openticket:autodelete-enable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,time:number,reason:string|null},workers:"openticket:autodelete-enable"},
+ "openticket:autoclose-disable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:autoclose-disable"},
+ "openticket:autodelete-disable":{source:"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.GuildTextBasedChannel,user:discord.User,ticket:ODTicket,reason:string|null},workers:"openticket:autodelete-disable"},
+}
+
+/**## ODMessageManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODMessageManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders.messages`!
+ */
+export class ODMessageManager_Default extends ODMessageManager {
+ get(id:MessageId): ODMessage_Default
+ get(id:ODValidId): ODMessage|null
+
+ get(id:ODValidId): ODMessage|null {
+ return super.get(id)
+ }
+
+ remove(id:MessageId): ODMessage_Default
+ remove(id:ODValidId): ODMessage|null
+
+ remove(id:ODValidId): ODMessage|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODMessageManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getSafe(id:MessageId): ODMessage_Default
+ getSafe(id:ODValidId): ODMessage
+
+ getSafe(id:ODValidId): ODMessage {
+ return super.getSafe(id)
+ }
+}
+
+/**## ODMessage_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODMessage class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODMessage`'s!
+ */
+export class ODMessage_Default extends ODMessage {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODModalManagerIds_Default `type`
+ * This type is an array of ids available in the `ODModalManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODModalManagerIds_Default {
+ "openticket:ticket-questions":{source:"panel-button"|"panel-dropdown"|"slash"|"text"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,option:ODTicketOption},workers:"openticket:ticket-questions"}
+ "openticket:close-ticket-reason":{source:"ticket-message"|"reopen-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:close-ticket-reason"}
+ "openticket:reopen-ticket-reason":{source:"ticket-message"|"close-message"|"autoclose-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:reopen-ticket-reason"}
+ "openticket:delete-ticket-reason":{source:"ticket-message"|"reopen-message"|"close-message"|"autoclose-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:delete-ticket-reason"}
+ "openticket:claim-ticket-reason":{source:"ticket-message"|"unclaim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:claim-ticket-reason"}
+ "openticket:unclaim-ticket-reason":{source:"ticket-message"|"claim-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:unclaim-ticket-reason"}
+ "openticket:pin-ticket-reason":{source:"ticket-message"|"unpin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:pin-ticket-reason"}
+ "openticket:unpin-ticket-reason":{source:"ticket-message"|"pin-message"|"other",params:{guild:discord.Guild,channel:discord.TextBasedChannel,user:discord.User,ticket:ODTicket},workers:"openticket:unpin-ticket-reason"}
+}
+
+/**## ODModalManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODModalManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.builders.modals`!
+ */
+export class ODModalManager_Default extends ODModalManager {
+ get(id:ModalId): ODModal_Default
+ get(id:ODValidId): ODModal|null
+
+ get(id:ODValidId): ODModal|null {
+ return super.get(id)
+ }
+
+ remove(id:ModalId): ODModal_Default
+ remove(id:ODValidId): ODModal|null
+
+ remove(id:ODValidId): ODModal|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODModalManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getSafe(id:ModalId): ODModal_Default
+ getSafe(id:ODValidId): ODModal
+
+ getSafe(id:ODValidId): ODModal {
+ return super.getSafe(id)
+ }
+}
+
+/**## ODModal_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODModal class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODModal`'s!
+ */
+export class ODModal_Default extends ODModal {
+ declare workers: ODWorkerManager_Default
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/checker.ts b/src/core/api/defaults/checker.ts
new file mode 100644
index 0000000..69e6d53
--- /dev/null
+++ b/src/core/api/defaults/checker.ts
@@ -0,0 +1,378 @@
+///////////////////////////////////////
+//DEFAULT CONFIG CHECKER MODULE
+///////////////////////////////////////
+import { ODLanguageManager_Default } from "../api"
+import { ODValidId } from "../modules/base"
+import { ODCheckerManager, ODChecker, ODCheckerTranslationRegister, ODCheckerRenderer, ODCheckerFunctionManager, ODCheckerResult, ODCheckerFunction } from "../modules/checker"
+import ansis from "ansis"
+
+/**## ODCheckerManagerIds_Default `type`
+ * This type is an array of ids available in the `ODCheckerManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODCheckerManagerIds_Default {
+ "openticket:general":ODChecker,
+ "openticket:options":ODChecker,
+ "openticket:messages":ODChecker,
+ "openticket:transcripts":ODChecker
+}
+
+/**## ODCheckerManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCheckerManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.checkers`!
+ */
+export class ODCheckerManager_Default extends ODCheckerManager {
+ declare translation: ODCheckerTranslationRegister_Default
+ declare renderer: ODCheckerRenderer_Default
+ declare functions: ODCheckerFunctionManager_Default
+
+ get(id:CheckerId): ODCheckerManagerIds_Default[CheckerId]
+ get(id:ODValidId): ODChecker|null
+
+ get(id:ODValidId): ODChecker|null {
+ return super.get(id)
+ }
+
+ remove(id:CheckerId): ODCheckerManagerIds_Default[CheckerId]
+ remove(id:ODValidId): ODChecker|null
+
+ remove(id:ODValidId): ODChecker|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODCheckerManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODCheckerRenderer_Default `default_class`
+ * This is a special class that adds type definitions & features to the ODCheckerRenderer class.
+ * It contains the code that renders the default config checker.
+ *
+ * This default class is made for the global variable `openticket.checkers.renderer`!
+ */
+export class ODCheckerRenderer_Default extends ODCheckerRenderer {
+ extraHeaderText: string[] = []
+ extraFooterText: string[] = []
+ extraTopText: string[] = []
+ extraBottomText: string[] = []
+
+ horizontalFiller: string = "="
+ verticalFiller: string = "|"
+ descriptionSeparator: string = " => "
+ footerTipPrefix: string = "=> "
+
+ disableHeader: boolean = false
+ disableFooter: boolean = false
+
+ getComponents(compact:boolean, renderEmpty:boolean, translation:ODCheckerTranslationRegister_Default, data:ODCheckerResult): string[] {
+ const tm = translation
+ const t = {
+ headerOpenticket:tm.get("other","openticket:header-openticket") ?? "OPEN TICKET",
+ headerConfigchecker:tm.get("other","openticket:header-configchecker") ?? "CONFIG CHECKER",
+ headerDescription:tm.get("other","openticket:header-description") ?? "check for errors in you config files!",
+ footerError:tm.get("other","openticket:footer-error") ?? "the bot won't start until all {0}'s are fixed!",
+ footerWarning:tm.get("other","openticket:footer-warning") ?? "it's recommended to fix all {0}'s before starting!",
+ footerSupport:tm.get("other","openticket:footer-support") ?? "SUPPORT: {0} - DOCS: {1}",
+ error:tm.get("other","openticket:type-error") ?? "[ERROR]",
+ warning:tm.get("other","openticket:type-warning") ?? "[WARNING]",
+ info:tm.get("other","openticket:type-info") ?? "[INFO]",
+ compactInfo:tm.get("other","openticket:compact-information") ?? "use {0} for more information!",
+ dataPath:tm.get("other","openticket:data-path") ?? "path",
+ dataDocs:tm.get("other","openticket:data-docs") ?? "docs",
+ dataMessage:tm.get("other","openticket:data-message") ?? "message"
+ }
+ const hasErrors = data.messages.filter((m) => m.type == "error").length > 0
+ const hasWarnings = data.messages.filter((m) => m.type == "warning").length > 0
+ const hasInfo = data.messages.filter((m) => m.type == "info").length > 0
+
+ if (!renderEmpty && !hasErrors && !hasWarnings && (!hasInfo || compact)) return []
+
+ const headerText = ansis.bold.hex("#f8ba00")(t.headerOpenticket)+" "+t.headerConfigchecker+" => "+ansis.hex("#f8ba00")(t.headerDescription)
+ const footerErrorText = (hasErrors) ? this.footerTipPrefix+ansis.gray(tm.insertTranslationParams(t.footerError,[ansis.bold.red(t.error)])) : ""
+ const footerWarningText = (hasWarnings) ? this.footerTipPrefix+ansis.gray(tm.insertTranslationParams(t.footerWarning,[ansis.bold.yellow(t.warning)])) : ""
+ const footerSupportText = tm.insertTranslationParams(t.footerSupport,[ansis.green("https://discord.dj-dj.be"),ansis.green("https://otdocs.dj-dj.be")])
+ const bottomCompactInfo = (compact) ? ansis.gray(tm.insertTranslationParams(t.compactInfo,[ansis.bold.green("npm start -- --checker")])) : ""
+
+ const finalHeader = [headerText,...this.extraHeaderText]
+ const finalFooter = [footerErrorText,footerWarningText,footerSupportText,...this.extraFooterText]
+ const finalTop = [...this.extraTopText]
+ const finalBottom = [bottomCompactInfo,...this.extraBottomText]
+ const borderLength = this.#getLongestLength([...finalHeader,...finalFooter])
+
+ const finalComponents: string[] = []
+
+ //header
+ if (!this.disableHeader){
+ finalHeader.forEach((text) => {
+ if (text.length < 1) return
+ finalComponents.push(this.#createBlockFromText(text,borderLength))
+ })
+ }
+ finalComponents.push(this.#getHorizontalDivider(borderLength+4))
+
+ //top
+ finalTop.forEach((text) => {
+ if (text.length < 1) return
+ finalComponents.push(this.verticalFiller+" "+text)
+ })
+ finalComponents.push(this.verticalFiller)
+
+ //messages
+ if (compact){
+ //use compact messages
+ data.messages.forEach((msg,index) => {
+ //compact mode doesn't render info
+ if (msg.type == "info") return
+
+ //check if translation available & use it if possible
+ const rawTranslation = tm.get("message",msg.messageId.value)
+ const translatedMessage = (rawTranslation) ? tm.insertTranslationParams(rawTranslation,msg.translationParams) : msg.message
+
+ if (msg.type == "error") finalComponents.push(this.verticalFiller+" "+ansis.bold.red(`${t.error} ${translatedMessage}`))
+ else if (msg.type == "warning") finalComponents.push(this.verticalFiller+" "+ansis.bold.yellow(`${t.warning} ${translatedMessage}`))
+
+ const pathSplitter = msg.path ? ":" : ""
+ finalComponents.push(this.verticalFiller+ansis.bold(this.descriptionSeparator)+ansis.cyan(`${ansis.magenta(msg.filepath+pathSplitter)} ${msg.path}`))
+ if (index != data.messages.length-1) finalComponents.push(this.verticalFiller)
+ })
+ }else{
+ //use full messages
+ data.messages.forEach((msg,index) => {
+ //check if translation available & use it if possible
+ const rawTranslation = tm.get("message",msg.messageId.value)
+ const translatedMessage = (rawTranslation) ? tm.insertTranslationParams(rawTranslation,msg.translationParams) : msg.message
+
+ if (msg.type == "error") finalComponents.push(this.verticalFiller+" "+ansis.bold.red(`${t.error} ${translatedMessage}`))
+ else if (msg.type == "warning") finalComponents.push(this.verticalFiller+" "+ansis.bold.yellow(`${t.warning} ${translatedMessage}`))
+ else if (msg.type == "info") finalComponents.push(this.verticalFiller+" "+ansis.bold.blue(`${t.info} ${translatedMessage}`))
+
+ const pathSplitter = msg.path ? ":" : ""
+ finalComponents.push(this.verticalFiller+" "+ansis.bold((t.dataPath)+this.descriptionSeparator)+ansis.cyan(`${ansis.magenta(msg.filepath+pathSplitter)} ${msg.path}`))
+ if (msg.locationDocs) finalComponents.push(this.verticalFiller+" "+ansis.bold(t.dataDocs+this.descriptionSeparator)+ansis.italic.gray(msg.locationDocs))
+ if (msg.messageDocs) finalComponents.push(this.verticalFiller+" "+ansis.bold(t.dataMessage+this.descriptionSeparator)+ansis.italic.gray(msg.messageDocs))
+ if (index != data.messages.length-1) finalComponents.push(this.verticalFiller)
+ })
+ }
+
+ //bottom
+ finalComponents.push(this.verticalFiller)
+ finalBottom.forEach((text) => {
+ if (text.length < 1) return
+ finalComponents.push(this.verticalFiller+" "+text)
+ })
+
+ //footer
+ finalComponents.push(this.#getHorizontalDivider(borderLength+4))
+ if (!this.disableFooter){
+ finalFooter.forEach((text) => {
+ if (text.length < 1) return
+ finalComponents.push(this.#createBlockFromText(text,borderLength))
+ })
+ finalComponents.push(this.#getHorizontalDivider(borderLength+4))
+ }
+
+ //return all components
+ return finalComponents
+ }
+ /**Get the length of the longest string in the array. */
+ #getLongestLength(text:string[]): number {
+ let finalLength = 0
+ text.forEach((t) => {
+ const l = ansis.strip(t).length
+ if (l > finalLength) finalLength = l
+ })
+
+ return finalLength
+ }
+ /**Get a horizontal divider used between different parts of the config checker result. */
+ #getHorizontalDivider(width:number): string {
+ if (width > 2) width = width-2
+ else return this.verticalFiller+this.verticalFiller
+ let divider = this.verticalFiller + this.horizontalFiller.repeat(width) + this.verticalFiller
+ return divider
+ }
+ /**Create a block of text with a vertical divider on the left & right side. */
+ #createBlockFromText(text:string,width:number): string {
+ if (width < 3) return this.verticalFiller+this.verticalFiller
+ let newWidth = width-ansis.strip(text).length+1
+ let final = this.verticalFiller+" "+text+" ".repeat(newWidth)+this.verticalFiller
+ return final
+ }
+}
+
+/**## ODCheckerTranslationRegisterOtherIds_Default `type`
+ * This type is an array of ids available in the `ODCheckerTranslationRegister_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export type ODCheckerTranslationRegisterOtherIds_Default = (
+ "openticket:header-openticket"|
+ "openticket:header-configchecker"|
+ "openticket:header-description"|
+ "openticket:type-error"|
+ "openticket:type-warning"|
+ "openticket:type-info"|
+ "openticket:data-path"|
+ "openticket:data-docs"|
+ "openticket:data-message"|
+ "openticket:compact-information"|
+ "openticket:footer-error"|
+ "openticket:footer-warning"|
+ "openticket:footer-support"
+)
+
+/**## ODCheckerTranslationRegisterMessageIds_Default `type`
+ * This type is an array of ids available in the `ODCheckerTranslationRegister_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export type ODCheckerTranslationRegisterMessageIds_Default = (
+ "openticket:invalid-type"|
+ "openticket:property-missing"|
+ "openticket:property-optional"|
+ "openticket:object-disabled"|
+ "openticket:null-invalid"|
+ "openticket:switch-invalid-type"|
+ "openticket:object-switch-invalid-type"|
+
+ "openticket:string-too-short"|
+ "openticket:string-too-long"|
+ "openticket:string-length-invalid"|
+ "openticket:string-starts-with"|
+ "openticket:string-ends-with"|
+ "openticket:string-contains"|
+ "openticket:string-choices"|
+ "openticket:string-regex"|
+
+ "openticket:number-too-short"|
+ "openticket:number-too-long"|
+ "openticket:number-length-invalid"|
+ "openticket:number-too-small"|
+ "openticket:number-too-large"|
+ "openticket:number-not-equal"|
+ "openticket:number-step"|
+ "openticket:number-step-offset"|
+ "openticket:number-starts-with"|
+ "openticket:number-ends-with"|
+ "openticket:number-contains"|
+ "openticket:number-choices"|
+ "openticket:number-float"|
+ "openticket:number-negative"|
+ "openticket:number-positive"|
+ "openticket:number-zero"|
+
+ "openticket:boolean-true"|
+ "openticket:boolean-false"|
+
+ "openticket:array-empty-disabled"|
+ "openticket:array-empty-required"|
+ "openticket:array-too-short"|
+ "openticket:array-too-long"|
+ "openticket:array-length-invalid"|
+ "openticket:array-invalid-types"|
+ "openticket:array-double"|
+
+ "openticket:discord-invalid-id"|
+ "openticket:discord-invalid-id-options"|
+ "openticket:discord-invalid-token"|
+ "openticket:color-invalid"|
+ "openticket:emoji-too-short"|
+ "openticket:emoji-too-long"|
+ "openticket:emoji-custom"|
+ "openticket:emoji-invalid"|
+ "openticket:url-invalid"|
+ "openticket:url-invalid-http"|
+ "openticket:url-invalid-protocol"|
+ "openticket:url-invalid-hostname"|
+ "openticket:url-invalid-extension"|
+ "openticket:url-invalid-path"|
+ "openticket:id-not-unique"|
+ "openticket:id-non-existent"|
+
+ "openticket:invalid-language"|
+ "openticket:invalid-button"|
+ "openticket:unused-option"|
+ "openticket:unused-question"|
+ "openticket:dropdown-option"
+)
+
+/**## ODCheckerTranslationRegister_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCheckerTranslationRegister class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.checkers.translation`!
+ */
+export class ODCheckerTranslationRegister_Default extends ODCheckerTranslationRegister {
+ get(type:"other", id:ODCheckerTranslationRegisterOtherIds_Default): string
+ get(type:"message", id:ODCheckerTranslationRegisterMessageIds_Default): string
+ get(type:"message"|"other", id:string): string|null
+
+ get(type:"message"|"other", id:string): string|null {
+ return super.get(type,id)
+ }
+
+ set(type:"other", id:ODCheckerTranslationRegisterOtherIds_Default, translation:string): boolean
+ set(type:"message", id:ODCheckerTranslationRegisterMessageIds_Default, translation:string): boolean
+ set(type:"message"|"other", id:string, translation:string): boolean
+
+ set(type:"message"|"other", id:string, translation:string): boolean {
+ return super.set(type,id,translation)
+ }
+
+ delete(type:"other", id:ODCheckerTranslationRegisterOtherIds_Default): boolean
+ delete(type:"message", id:ODCheckerTranslationRegisterMessageIds_Default): boolean
+ delete(type:"message"|"other", id:string): boolean
+
+ delete(type:"message"|"other", id:string): boolean {
+ return super.delete(type,id)
+ }
+
+ quickTranslate(manager:ODLanguageManager_Default, translationId:string, type:"other"|"message", id:ODCheckerTranslationRegisterOtherIds_Default|ODCheckerTranslationRegisterMessageIds_Default)
+ quickTranslate(manager:ODLanguageManager_Default, translationId:string, type:"other"|"message", id:string)
+
+ quickTranslate(manager:ODLanguageManager_Default, translationId:string, type:"other"|"message", id:ODCheckerTranslationRegisterOtherIds_Default|ODCheckerTranslationRegisterMessageIds_Default|string){
+ super.quickTranslate(manager,translationId,type,id)
+ }
+}
+
+/**## ODCheckerFunctionManagerIds_Default `type`
+ * This type is an array of ids available in the `ODCheckerFunctionManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODCheckerFunctionManagerIds_Default {
+ "openticket:unused-options":ODCheckerFunction,
+ "openticket:dropdown-options":ODCheckerFunction
+}
+
+/**## ODCheckerFunctionManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCheckerFunctionManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.checkers.functions`!
+ */
+export class ODCheckerFunctionManager_Default extends ODCheckerFunctionManager {
+ get(id:CheckerFunctionId): ODCheckerManagerIds_Default[CheckerFunctionId]
+ get(id:ODValidId): ODCheckerFunction|null
+
+ get(id:ODValidId): ODCheckerFunction|null {
+ return super.get(id)
+ }
+
+ remove(id:CheckerFunctionId): ODCheckerManagerIds_Default[CheckerFunctionId]
+ remove(id:ODValidId): ODCheckerFunction|null
+
+ remove(id:ODValidId): ODCheckerFunction|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODCheckerFunctionManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/client.ts b/src/core/api/defaults/client.ts
new file mode 100644
index 0000000..d03d26f
--- /dev/null
+++ b/src/core/api/defaults/client.ts
@@ -0,0 +1,147 @@
+///////////////////////////////////////
+//DEFAULT CLIENT MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODClientManager, ODSlashCommand, ODTextCommand, ODSlashCommandManager, ODTextCommandManager, ODSlashCommandInteractionCallback, ODTextCommandInteractionCallback } from "../modules/client"
+
+/**## ODClientManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODClientManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.client`!
+ */
+export class ODClientManager_Default extends ODClientManager {
+ declare slashCommands: ODSlashCommandManager_Default
+ declare textCommands: ODTextCommandManager_Default
+}
+
+/**## ODSlashCommandManagerIds_Default `type`
+ * This type is an array of ids available in the `ODSlashCommandManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODSlashCommandManagerIds_Default {
+ "openticket:help":ODSlashCommand,
+ "openticket:panel":ODSlashCommand,
+ "openticket:ticket":ODSlashCommand,
+ "openticket:close":ODSlashCommand,
+ "openticket:delete":ODSlashCommand,
+ "openticket:reopen":ODSlashCommand,
+ "openticket:claim":ODSlashCommand,
+ "openticket:unclaim":ODSlashCommand,
+ "openticket:pin":ODSlashCommand,
+ "openticket:unpin":ODSlashCommand,
+ "openticket:move":ODSlashCommand,
+ "openticket:rename":ODSlashCommand,
+ "openticket:add":ODSlashCommand,
+ "openticket:remove":ODSlashCommand,
+ "openticket:blacklist":ODSlashCommand,
+ "openticket:stats":ODSlashCommand,
+ "openticket:clear":ODSlashCommand,
+ "openticket:autoclose":ODSlashCommand,
+ "openticket:autodelete":ODSlashCommand,
+}
+
+/**## ODSlashCommandManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODSlashCommandManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.client.slashCommands`!
+ */
+export class ODSlashCommandManager_Default extends ODSlashCommandManager {
+ get(id:SlashCommandId): ODSlashCommandManagerIds_Default[SlashCommandId]
+ get(id:ODValidId): ODSlashCommand|null
+
+ get(id:ODValidId): ODSlashCommand|null {
+ return super.get(id)
+ }
+
+ remove(id:SlashCommandId): ODSlashCommandManagerIds_Default[SlashCommandId]
+ remove(id:ODValidId): ODSlashCommand|null
+
+ remove(id:ODValidId): ODSlashCommand|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODSlashCommandManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ onInteraction(commandName:keyof ODSlashCommandManagerIds_Default, callback:ODSlashCommandInteractionCallback): void
+ onInteraction(commandName:string|RegExp, callback:ODSlashCommandInteractionCallback): void
+
+ onInteraction(commandName:string|RegExp, callback:ODSlashCommandInteractionCallback): void {
+ return super.onInteraction(commandName,callback)
+ }
+}
+
+/**## ODTextCommandManagerIds_Default `type`
+ * This type is an array of ids available in the `ODTextCommandManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODTextCommandManagerIds_Default {
+ "openticket:help":ODTextCommand,
+ "openticket:panel":ODTextCommand,
+ "openticket:close":ODTextCommand,
+ "openticket:delete":ODTextCommand,
+ "openticket:reopen":ODTextCommand,
+ "openticket:claim":ODTextCommand,
+ "openticket:unclaim":ODTextCommand,
+ "openticket:pin":ODTextCommand,
+ "openticket:unpin":ODTextCommand,
+ "openticket:move":ODTextCommand,
+ "openticket:rename":ODTextCommand,
+ "openticket:add":ODTextCommand,
+ "openticket:remove":ODTextCommand,
+ "openticket:blacklist-view":ODTextCommand,
+ "openticket:blacklist-add":ODTextCommand,
+ "openticket:blacklist-remove":ODTextCommand,
+ "openticket:blacklist-get":ODTextCommand,
+ "openticket:stats-global":ODTextCommand,
+ "openticket:stats-reset":ODTextCommand,
+ "openticket:stats-ticket":ODTextCommand,
+ "openticket:stats-user":ODTextCommand,
+ "openticket:clear":ODTextCommand,
+ "openticket:autoclose-disable":ODTextCommand,
+ "openticket:autoclose-enable":ODTextCommand,
+ "openticket:autodelete-disable":ODTextCommand,
+ "openticket:autodelete-enable":ODTextCommand
+}
+
+/**## ODTextCommandManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODTextCommandManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.client.textCommands`!
+ */
+export class ODTextCommandManager_Default extends ODTextCommandManager {
+ get(id:TextCommandId): ODTextCommandManagerIds_Default[TextCommandId]
+ get(id:ODValidId): ODTextCommand|null
+
+ get(id:ODValidId): ODTextCommand|null {
+ return super.get(id)
+ }
+
+ remove(id:TextCommandId): ODTextCommandManagerIds_Default[TextCommandId]
+ remove(id:ODValidId): ODTextCommand|null
+
+ remove(id:ODValidId): ODTextCommand|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODTextCommandManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ onInteraction(prefix:string, id:keyof ODTextCommandManagerIds_Default, callback:ODTextCommandInteractionCallback): void
+ onInteraction(commandPrefix:string, commandName:string|RegExp, callback:ODTextCommandInteractionCallback): void
+
+ onInteraction(commandPrefix:string, commandName:string|RegExp, callback:ODTextCommandInteractionCallback): void {
+ return super.onInteraction(commandPrefix,commandName,callback)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/code.ts b/src/core/api/defaults/code.ts
new file mode 100644
index 0000000..4275298
--- /dev/null
+++ b/src/core/api/defaults/code.ts
@@ -0,0 +1,56 @@
+///////////////////////////////////////
+//DEFAULT CODE MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODCode, ODCodeManager } from "../modules/code"
+
+/**## ODCodeManagerIds_Default `type`
+ * This type is an array of ids available in the `ODCodeManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODCodeManagerIds_Default {
+ "openticket:command-error-handling":ODCode,
+ "openticket:start-listening-interactions":ODCode,
+ "openticket:panel-database-cleaner":ODCode,
+ "openticket:suffix-database-cleaner":ODCode,
+ "openticket:option-database-cleaner":ODCode,
+ "openticket:user-database-cleaner":ODCode,
+ "openticket:ticket-database-cleaner":ODCode,
+ "openticket:panel-auto-update":ODCode,
+ "openticket:ticket-saver":ODCode,
+ "openticket:blacklist-saver":ODCode,
+ "openticket:auto-role-on-join":ODCode,
+ "openticket:autoclose-timeout":ODCode,
+ "openticket:autoclose-leave":ODCode,
+ "openticket:autodelete-timeout":ODCode,
+ "openticket:autodelete-leave":ODCode
+}
+
+/**## ODCodeManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCodeManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.code`!
+ */
+export class ODCodeManager_Default extends ODCodeManager {
+ get(id:CodeId): ODCodeManagerIds_Default[CodeId]
+ get(id:ODValidId): ODCode|null
+
+ get(id:ODValidId): ODCode|null {
+ return super.get(id)
+ }
+
+ remove(id:CodeId): ODCodeManagerIds_Default[CodeId]
+ remove(id:ODValidId): ODCode|null
+
+ remove(id:ODValidId): ODCode|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODCodeManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/config.ts b/src/core/api/defaults/config.ts
new file mode 100644
index 0000000..e4db760
--- /dev/null
+++ b/src/core/api/defaults/config.ts
@@ -0,0 +1,470 @@
+///////////////////////////////////////
+//DEFAULT CONFIG MODULE
+///////////////////////////////////////
+import { ODValidButtonColor, ODValidId } from "../modules/base"
+import * as discord from "discord.js"
+import { ODConfigManager, ODConfig, ODJsonConfig } from "../modules/config"
+import { ODClientActivityStatus, ODClientActivityType } from "../modules/client"
+import { OTRoleUpdateMode } from "../openticket/role"
+
+/**## ODConfigManagerIds_Default `type`
+ * This type is an array of ids available in the `ODConfigManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODConfigManagerIds_Default {
+ "openticket:general":ODJsonConfig_DefaultGeneral,
+ "openticket:options":ODJsonConfig_DefaultOptions,
+ "openticket:panels":ODJsonConfig_DefaultPanels,
+ "openticket:questions":ODJsonConfig_DefaultQuestions,
+ "openticket:transcripts":ODJsonConfig_DefaultTranscripts
+}
+
+/**## ODConfigManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODConfigManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.configs`!
+ */
+export class ODConfigManager_Default extends ODConfigManager {
+ get(id:ConfigId): ODConfigManagerIds_Default[ConfigId]
+ get(id:ODValidId): ODConfig|null
+
+ get(id:ODValidId): ODConfig|null {
+ return super.get(id)
+ }
+
+ remove(id:ConfigId): ODConfigManagerIds_Default[ConfigId]
+ remove(id:ODValidId): ODConfig|null
+
+ remove(id:ODValidId): ODConfig|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODConfigManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODJsonConfig_DefaultStatusType `interface`
+ * This interface is an object which has all properties for the status object in the `general.json` config!
+ */
+export interface ODJsonConfig_DefaultStatusType {
+ enabled:boolean,
+ type:Exclude,
+ text:string,
+ status:ODClientActivityStatus
+}
+
+/**## ODJsonConfig_DefaultMessageSettingsType `interface`
+ * This interface is an object which has all properties for the system/messages/... object in the `general.json` config!
+ */
+export interface ODJsonConfig_DefaultMessageSettingsType {
+ dm:boolean,
+ logs:boolean
+}
+
+/**## ODJsonConfig_DefaultCmdPermissionSettingsType `type`
+ * This type is a collection of command permission settings for the system/permissions/... object in the `general.json` config!
+ */
+export type ODJsonConfig_DefaultCmdPermissionSettingsType = "admin"|"everyone"|"none"|string
+
+/**## ODJsonConfig_DefaultGeneral `default_class`
+ * This is a special class that adds type definitions & typescript to the ODJsonConfig class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `general.json` config!
+ */
+export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
+ declare data: {
+ _INFO:{
+ support:string,
+ discord:string,
+ version:string
+ },
+
+ token:string,
+ tokenFromENV:boolean,
+
+ mainColor:discord.ColorResolvable,
+ language:string,
+ prefix:string,
+ serverId:string,
+ globalAdmins:string[],
+
+ slashCommands:boolean,
+ textCommands:boolean,
+
+ status:ODJsonConfig_DefaultStatusType,
+
+ system:{
+ removeParticipantsOnClose:boolean,
+ replyOnTicketCreation:boolean,
+ replyOnReactionRole:boolean,
+ useTranslatedConfigChecker:boolean,
+ preferSlashOverText:boolean,
+ sendErrorOnUnknownCommand:boolean,
+ questionFieldsInCodeBlock:boolean,
+ disableVerifyBars:boolean,
+ useRedErrorEmbeds:boolean,
+ emojiStyle:"before"|"after"|"double"|"disabled",
+
+ enableTicketClaimButtons:boolean,
+ enableTicketCloseButtons:boolean,
+ enableTicketPinButtons:boolean,
+ enableTicketDeleteButtons:boolean,
+ enableTicketActionWithReason:boolean,
+ enableDeleteWithoutTranscript:boolean,
+
+ logs:{
+ enabled:boolean,
+ channel:string
+ },
+
+ limits:{
+ enabled:boolean,
+ globalMaximum:number,
+ userMaximum:number
+ },
+
+ permissions:{
+ help:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ panel:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ ticket:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ close:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ delete:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ reopen:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ claim:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ unclaim:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ pin:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ unpin:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ move:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ rename:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ add:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ remove:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ blacklist:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ stats:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ clear:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ autoclose:ODJsonConfig_DefaultCmdPermissionSettingsType,
+ autodelete:ODJsonConfig_DefaultCmdPermissionSettingsType
+ },
+
+ messages:{
+ creation:ODJsonConfig_DefaultMessageSettingsType,
+ closing:ODJsonConfig_DefaultMessageSettingsType,
+ deleting:ODJsonConfig_DefaultMessageSettingsType,
+ reopening:ODJsonConfig_DefaultMessageSettingsType,
+ claiming:ODJsonConfig_DefaultMessageSettingsType,
+ pinning:ODJsonConfig_DefaultMessageSettingsType,
+ adding:ODJsonConfig_DefaultMessageSettingsType,
+ removing:ODJsonConfig_DefaultMessageSettingsType,
+ renaming:ODJsonConfig_DefaultMessageSettingsType,
+ moving:ODJsonConfig_DefaultMessageSettingsType,
+ blacklisting:ODJsonConfig_DefaultMessageSettingsType,
+ roleAdding:ODJsonConfig_DefaultMessageSettingsType,
+ roleRemoving:ODJsonConfig_DefaultMessageSettingsType
+ }
+ }
+ }
+}
+
+/**## ODJsonConfig_DefaultOptionType `interface`
+ * This interface is an object which has all basic properties for options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionType {
+ id:string,
+ name:string,
+ description:string,
+ type:"ticket"|"website"|"role",
+ button:{
+ emoji:string,
+ label:string
+ }
+}
+
+/**## ODJsonConfig_DefaultOptionButtonSettingsType `interface`
+ * This interface is an object which has all button settings for ticket options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionButtonSettingsType {
+ emoji:string,
+ label:string,
+ color:ODValidButtonColor
+}
+
+/**## ODJsonConfig_DefaultOptionEmbedSettingsType `interface`
+ * This interface is an object which has all message embed settings for ticket options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionEmbedSettingsType {
+ enabled:boolean,
+ title:string,
+ description:string,
+ customColor:string,
+
+ image:string,
+ thumbnail:string,
+ fields:{name:string, value:string, inline:boolean}[],
+ timestamp:boolean
+}
+
+/**## ODJsonConfig_DefaultOptionPingSettingsType `interface`
+ * This interface is an object which has all message ping settings for ticket options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionPingSettingsType {
+ "@here":boolean,
+ "@everyone":boolean,
+ custom:string[]
+}
+
+/**## ODJsonConfig_DefaultOptionTicketType `interface`
+ * This interface is an object which has all ticket properties for options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionTicketType extends ODJsonConfig_DefaultOptionType {
+ type:"ticket",
+ button:ODJsonConfig_DefaultOptionButtonSettingsType,
+ ticketAdmins:string[],
+ readonlyAdmins:string[],
+ allowCreationByBlacklistedUsers:boolean,
+ questions:string[],
+ channel:{
+ prefix:string,
+ suffix:"user-name"|"user-id"|"random-number"|"random-hex"|"counter-dynamic"|"counter-fixed",
+ category:string,
+ closedCategory:string,
+ backupCategory:string,
+ claimedCategory:{user:string, category:string}[],
+ description:string
+ },
+ dmMessage:{
+ enabled:boolean,
+ text:string,
+ embed:ODJsonConfig_DefaultOptionEmbedSettingsType
+ },
+ ticketMessage:{
+ enabled:boolean,
+ text:string,
+ embed:ODJsonConfig_DefaultOptionEmbedSettingsType,
+ ping:ODJsonConfig_DefaultOptionPingSettingsType
+ },
+ autoclose:{
+ enableInactiveHours:boolean,
+ inactiveHours:number,
+ enableUserLeave:boolean,
+ disableOnClaim:boolean
+ },
+ autodelete:{
+ enableInactiveDays:boolean,
+ inactiveDays:number,
+ enableUserLeave:boolean,
+ disableOnClaim:boolean
+ },
+ cooldown:{
+ enabled:boolean,
+ cooldownMinutes:number
+ },
+ limits:{
+ enabled:boolean,
+ globalMaximum:number,
+ userMaximum:number
+ }
+}
+
+/**## ODJsonConfig_DefaultOptionWebsiteType `interface`
+ * This interface is an object which has all website properties for options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionWebsiteType extends ODJsonConfig_DefaultOptionType {
+ type:"website",
+ url:string
+}
+
+/**## ODJsonConfig_DefaultOptionRoleType `interface`
+ * This interface is an object which has all reaction role properties for options in the `options.json` config!
+ */
+export interface ODJsonConfig_DefaultOptionRoleType extends ODJsonConfig_DefaultOptionType {
+ type:"role",
+ button:ODJsonConfig_DefaultOptionButtonSettingsType,
+ roles:string[],
+ mode:OTRoleUpdateMode,
+ removeRolesOnAdd:string[],
+ addOnMemberJoin:boolean
+}
+
+/**## ODJsonConfig_DefaultOptions `default_class`
+ * This is a special class that adds type definitions & typescript to the ODJsonConfig class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `options.json` config!
+ */
+export class ODJsonConfig_DefaultOptions extends ODJsonConfig {
+ declare data: (
+ ODJsonConfig_DefaultOptionTicketType|
+ ODJsonConfig_DefaultOptionWebsiteType|
+ ODJsonConfig_DefaultOptionRoleType
+ )[]
+}
+
+/**## ODJsonConfig_DefaultPanelEmbedSettingsType `interface`
+ * This interface is an object which has all message embed settings for panels in the `panels.json` config!
+ */
+export interface ODJsonConfig_DefaultPanelEmbedSettingsType {
+ enabled:boolean,
+ title:string,
+ description:string,
+
+ customColor:string,
+ url:string,
+
+ image:string,
+ thumbnail:string,
+
+ footer:string,
+ fields:{name:string,value:string,inline:boolean}[],
+ timestamp:boolean
+}
+
+/**## ODJsonConfig_DefaultPanelType `interface`
+ * This interface is an object which has all properties for panels in the `panels.json` config!
+ */
+export interface ODJsonConfig_DefaultPanelType {
+ id:string,
+ name:string,
+ dropdown:boolean,
+ options:string[],
+
+ text:string,
+ embed:ODJsonConfig_DefaultPanelEmbedSettingsType,
+ settings:{
+ dropdownPlaceholder:string,
+
+ enableMaxTicketsWarningInText:boolean,
+ enableMaxTicketsWarningInEmbed:boolean,
+
+ describeOptionsLayout:"simple"|"normal"|"detailed",
+ describeOptionsCustomTitle:string,
+ describeOptionsInText:boolean,
+ describeOptionsInEmbedFields:boolean,
+ describeOptionsInEmbedDescription:boolean
+ }
+}
+
+/**## ODJsonConfig_DefaultPanels `default_class`
+ * This is a special class that adds type definitions & typescript to the ODJsonConfig class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `panels.json` config!
+ */
+export class ODJsonConfig_DefaultPanels extends ODJsonConfig {
+ declare data: ODJsonConfig_DefaultPanelType[]
+}
+
+/**## ODJsonConfig_DefaultShortQuestionType `interface`
+ * This interface is an object which has all properties for short questions in the `questions.json` config!
+ */
+export interface ODJsonConfig_DefaultShortQuestionType {
+ id:string,
+ name:string,
+ type:"short",
+
+ required:boolean,
+ placeholder:string,
+ length:{
+ enabled:boolean,
+ min:number,
+ max:number
+ }
+}
+
+/**## ODJsonConfig_DefaultParagraphQuestionType `interface`
+ * This interface is an object which has all properties for paragraph questions in the `questions.json` config!
+ */
+export interface ODJsonConfig_DefaultParagraphQuestionType {
+ id:string,
+ name:string,
+ type:"paragraph",
+
+ required:boolean,
+ placeholder:string,
+ length:{
+ enabled:boolean,
+ min:number,
+ max:number
+ }
+}
+
+/**## ODJsonConfig_DefaultQuestions `default_class`
+ * This is a special class that adds type definitions & typescript to the ODJsonConfig class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `questions.json` config!
+ */
+export class ODJsonConfig_DefaultQuestions extends ODJsonConfig {
+ declare data: (
+ ODJsonConfig_DefaultShortQuestionType|
+ ODJsonConfig_DefaultParagraphQuestionType
+ )[]
+}
+
+/**## ODJsonConfig_DefaultTranscripts `default_class`
+ * This is a special class that adds type definitions & typescript to the ODJsonConfig class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `transcripts.json` config!
+ */
+export class ODJsonConfig_DefaultTranscripts extends ODJsonConfig {
+ declare data: {
+ general:{
+ enabled:boolean,
+
+ enableChannel:boolean,
+ enableCreatorDM:boolean,
+ enableParticipantDM:boolean,
+ enableActiveAdminDM:boolean,
+ enableEveryAdminDM:boolean,
+
+ channel:string,
+ mode:"html"|"text"
+ },
+ embedSettings:{
+ customColor:string,
+ listAllParticipants:boolean,
+ includeTicketStats:boolean
+ },
+ textTranscriptStyle:{
+ layout:"simple"|"normal"|"detailed",
+ includeStats:boolean,
+ includeIds:boolean,
+ includeEmbeds:boolean,
+ includeFiles:boolean,
+ includeBotMessages:boolean,
+
+ fileMode:"custom"|"channel-name"|"channel-id"|"user-name"|"user-id",
+ customFileName:string
+ },
+ htmlTranscriptStyle:{
+ background:{
+ enableCustomBackground:boolean,
+ backgroundColor:string,
+ backgroundImage:string
+ },
+ header:{
+ enableCustomHeader:boolean,
+ backgroundColor:string,
+ decoColor:string,
+ textColor:string
+ },
+ stats:{
+ enableCustomStats:false,
+ backgroundColor:string,
+ keyTextColor:string,
+ valueTextColor:string,
+ hideBackgroundColor:string,
+ hideTextColor:string
+ },
+ favicon:{
+ enableCustomFavicon:boolean,
+ imageUrl:string
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/console.ts b/src/core/api/defaults/console.ts
new file mode 100644
index 0000000..58f6feb
--- /dev/null
+++ b/src/core/api/defaults/console.ts
@@ -0,0 +1,42 @@
+///////////////////////////////////////
+//DEFAULT CONSOLE MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODLiveStatusUrlSource, ODLiveStatusManager, ODLiveStatusSource } from "../modules/console"
+
+/**## ODLiveStatusManagerIds_Default `type`
+ * This type is an array of ids available in the `ODLiveStatusManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODLiveStatusManagerIds_Default {
+ "openticket:default-djdj-dev":ODLiveStatusUrlSource
+}
+
+/**## ODLiveStatusManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODLiveStatusManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.livestatus`!
+ */
+export class ODLiveStatusManager_Default extends ODLiveStatusManager {
+ get(id:LiveStatusId): ODLiveStatusManagerIds_Default[LiveStatusId]
+ get(id:ODValidId): ODLiveStatusSource|null
+
+ get(id:ODValidId): ODLiveStatusSource|null {
+ return super.get(id)
+ }
+
+ remove(id:LiveStatusId): ODLiveStatusManagerIds_Default[LiveStatusId]
+ remove(id:ODValidId): ODLiveStatusSource|null
+
+ remove(id:ODValidId): ODLiveStatusSource|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODLiveStatusManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/cooldown.ts b/src/core/api/defaults/cooldown.ts
new file mode 100644
index 0000000..0a0c1a2
--- /dev/null
+++ b/src/core/api/defaults/cooldown.ts
@@ -0,0 +1,42 @@
+///////////////////////////////////////
+//DEFAULT COOLDOWN MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODCooldown, ODCooldownManager } from "../modules/cooldown"
+
+/**## ODCooldownManagerIds_Default `type`
+ * This type is an array of ids available in the `ODCooldownManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODCooldownManagerIds_Default {
+
+}
+
+/**## ODCooldownManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCooldownManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.cooldowns`!
+ */
+export class ODCooldownManager_Default extends ODCooldownManager {
+ get(id:CooldownId): ODCooldownManagerIds_Default[CooldownId]
+ get(id:ODValidId): ODCooldown|null
+
+ get(id:ODValidId): ODCooldown|null {
+ return super.get(id)
+ }
+
+ remove(id:CooldownId): ODCooldownManagerIds_Default[CooldownId]
+ remove(id:ODValidId): ODCooldown|null
+
+ remove(id:ODValidId): ODCooldown|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODCooldownManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/database.ts b/src/core/api/defaults/database.ts
new file mode 100644
index 0000000..1805d90
--- /dev/null
+++ b/src/core/api/defaults/database.ts
@@ -0,0 +1,256 @@
+///////////////////////////////////////
+//DEFAULT DATABASE MODULE
+///////////////////////////////////////
+import { ODValidId, ODValidJsonType } from "../modules/base"
+import { ODDatabaseManager, ODDatabase, ODFormattedJsonDatabase } from "../modules/database"
+import { ODTicketJson } from "../openticket/ticket"
+import { ODOptionJson } from "../openticket/option"
+
+/**## ODDatabaseManagerIds_Default `type`
+ * This type is an array of ids available in the `ODDatabaseManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODDatabaseManagerIds_Default {
+ "openticket:global":ODFormattedJsonDatabase_DefaultGlobal,
+ "openticket:stats":ODFormattedJsonDatabase,
+ "openticket:tickets":ODFormattedJsonDatabase_DefaultTickets,
+ "openticket:users":ODFormattedJsonDatabase_DefaultUsers,
+ "openticket:options":ODFormattedJsonDatabase_DefaultOptions,
+}
+
+/**## ODDatabaseManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODDatabaseManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.databases`!
+ */
+export class ODDatabaseManager_Default extends ODDatabaseManager {
+ get(id:DatabaseId): ODDatabaseManagerIds_Default[DatabaseId]
+ get(id:ODValidId): ODDatabase|null
+
+ get(id:ODValidId): ODDatabase|null {
+ return super.get(id)
+ }
+
+ remove(id:DatabaseId): ODDatabaseManagerIds_Default[DatabaseId]
+ remove(id:ODValidId): ODDatabase|null
+
+ remove(id:ODValidId): ODDatabase|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODDatabaseManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODFormattedJsonDatabaseIds_DefaultGlobal `type`
+ * This type is an array of ids available in the `ODFormattedJsonDatabase_DefaultGlobal` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODFormattedJsonDatabaseIds_DefaultGlobal {
+ "openticket:panel-update":string,
+ "openticket:option-suffix-counter":number,
+ "openticket:option-suffix-history":string[],
+ "openticket:last-version":string
+}
+
+/**## ODFormattedJsonDatabase_DefaultGlobal `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFormattedJsonDatabase class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `global.json` database!
+ */
+export class ODFormattedJsonDatabase_DefaultGlobal extends ODFormattedJsonDatabase {
+ set(category:CategoryId, key:string, value:ODFormattedJsonDatabaseIds_DefaultGlobal[CategoryId]): boolean
+ set(category:string, key:string, value:ODValidJsonType): boolean
+
+ set(category:string, key:string, value:ODValidJsonType): boolean {
+ return super.set(category,key,value)
+ }
+
+ get(category:CategoryId, key:string): ODFormattedJsonDatabaseIds_DefaultGlobal[CategoryId]|undefined
+ get(category:string, key:string): ODValidJsonType|undefined
+
+ get(category:string, key:string): ODValidJsonType|undefined {
+ return super.get(category,key)
+ }
+
+ delete(category:CategoryId, key:string): boolean
+ delete(category:string, key:string): boolean
+
+ delete(category:string, key:string): boolean {
+ return super.delete(category,key)
+ }
+
+ exists(category:keyof ODFormattedJsonDatabaseIds_DefaultGlobal, key:string): boolean
+ exists(category:string, key:string): boolean
+
+ exists(category:string, key:string): boolean {
+ return super.exists(category,key)
+ }
+
+ getCategory(category:CategoryId): {key:string, value:ODFormattedJsonDatabaseIds_DefaultGlobal[CategoryId]}[]|undefined
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined
+
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined {
+ return super.getCategory(category)
+ }
+}
+
+/**## ODFormattedJsonDatabaseIds_DefaultTickets `type`
+ * This type is an array of ids available in the `ODDatabaseManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODFormattedJsonDatabaseIds_DefaultTickets {
+ "openticket:ticket":ODTicketJson
+}
+
+/**## ODFormattedJsonDatabase_DefaultTickets `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFormattedJsonDatabase class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `tickets.json` database!
+ */
+export class ODFormattedJsonDatabase_DefaultTickets extends ODFormattedJsonDatabase {
+ set(category:CategoryId, key:string, value:ODFormattedJsonDatabaseIds_DefaultTickets[CategoryId]): boolean
+ set(category:string, key:string, value:ODValidJsonType): boolean
+
+ set(category:string, key:string, value:ODValidJsonType): boolean {
+ return super.set(category,key,value)
+ }
+
+ get(category:CategoryId, key:string): ODFormattedJsonDatabaseIds_DefaultTickets[CategoryId]|undefined
+ get(category:string, key:string): ODValidJsonType|undefined
+
+ get(category:string, key:string): ODValidJsonType|undefined {
+ return super.get(category,key)
+ }
+
+ delete(category:CategoryId, key:string): boolean
+ delete(category:string, key:string): boolean
+
+ delete(category:string, key:string): boolean {
+ return super.delete(category,key)
+ }
+
+ exists(category:keyof ODFormattedJsonDatabaseIds_DefaultTickets, key:string): boolean
+ exists(category:string, key:string): boolean
+
+ exists(category:string, key:string): boolean {
+ return super.exists(category,key)
+ }
+
+ getCategory(category:CategoryId): {key:string, value:ODFormattedJsonDatabaseIds_DefaultTickets[CategoryId]}[]|undefined
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined
+
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined {
+ return super.getCategory(category)
+ }
+}
+
+/**## ODFormattedJsonDatabaseIds_DefaultUsers `type`
+ * This type is an array of ids available in the `ODDatabaseManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODFormattedJsonDatabaseIds_DefaultUsers {
+ "openticket:blacklist":ODTicketJson
+}
+
+/**## ODFormattedJsonDatabase_DefaultUsers `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFormattedJsonDatabase class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `users.json` database!
+ */
+export class ODFormattedJsonDatabase_DefaultUsers extends ODFormattedJsonDatabase {
+ set(category:CategoryId, key:string, value:ODFormattedJsonDatabaseIds_DefaultUsers[CategoryId]): boolean
+ set(category:string, key:string, value:ODValidJsonType): boolean
+
+ set(category:string, key:string, value:ODValidJsonType): boolean {
+ return super.set(category,key,value)
+ }
+
+ get(category:CategoryId, key:string): ODFormattedJsonDatabaseIds_DefaultUsers[CategoryId]|undefined
+ get(category:string, key:string): ODValidJsonType|undefined
+
+ get(category:string, key:string): ODValidJsonType|undefined {
+ return super.get(category,key)
+ }
+
+ delete(category:CategoryId, key:string): boolean
+ delete(category:string, key:string): boolean
+
+ delete(category:string, key:string): boolean {
+ return super.delete(category,key)
+ }
+
+ exists(category:keyof ODFormattedJsonDatabaseIds_DefaultUsers, key:string): boolean
+ exists(category:string, key:string): boolean
+
+ exists(category:string, key:string): boolean {
+ return super.exists(category,key)
+ }
+
+ getCategory(category:CategoryId): {key:string, value:ODFormattedJsonDatabaseIds_DefaultUsers[CategoryId]}[]|undefined
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined
+
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined {
+ return super.getCategory(category)
+ }
+}
+
+
+/**## ODFormattedJsonDatabaseIds_DefaultOptions `type`
+ * This type is an array of ids available in the `ODDatabaseManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODFormattedJsonDatabaseIds_DefaultOptions {
+ "openticket:used-option":ODOptionJson
+}
+
+/**## ODFormattedJsonDatabase_DefaultOptions `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFormattedJsonDatabase class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `options.json` database!
+ */
+export class ODFormattedJsonDatabase_DefaultOptions extends ODFormattedJsonDatabase {
+ set(category:CategoryId, key:string, value:ODFormattedJsonDatabaseIds_DefaultOptions[CategoryId]): boolean
+ set(category:string, key:string, value:ODValidJsonType): boolean
+
+ set(category:string, key:string, value:ODValidJsonType): boolean {
+ return super.set(category,key,value)
+ }
+
+ get(category:CategoryId, key:string): ODFormattedJsonDatabaseIds_DefaultOptions[CategoryId]|undefined
+ get(category:string, key:string): ODValidJsonType|undefined
+
+ get(category:string, key:string): ODValidJsonType|undefined {
+ return super.get(category,key)
+ }
+
+ delete(category:CategoryId, key:string): boolean
+ delete(category:string, key:string): boolean
+
+ delete(category:string, key:string): boolean {
+ return super.delete(category,key)
+ }
+
+ exists(category:keyof ODFormattedJsonDatabaseIds_DefaultOptions, key:string): boolean
+ exists(category:string, key:string): boolean
+
+ exists(category:string, key:string): boolean {
+ return super.exists(category,key)
+ }
+
+ getCategory(category:CategoryId): {key:string, value:ODFormattedJsonDatabaseIds_DefaultOptions[CategoryId]}[]|undefined
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined
+
+ getCategory(category:string): {key:string, value:ODValidJsonType}[]|undefined {
+ return super.getCategory(category)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/event.ts b/src/core/api/defaults/event.ts
new file mode 100644
index 0000000..c9b02b1
--- /dev/null
+++ b/src/core/api/defaults/event.ts
@@ -0,0 +1,331 @@
+///////////////////////////////////////
+//DEFAULT EVENT MODULE
+///////////////////////////////////////
+//BASE MODULES
+import { ODPromiseVoid, ODValidId } from "../modules/base"
+import { ODPluginClassManager, ODPluginEventManager, ODPluginManager } from "../modules/plugin"
+import { ODConsoleManager, ODError } from "../modules/console"
+import { ODCheckerResult, ODCheckerStorage } from "../modules/checker"
+import { ODDefaultsManager } from "../modules/defaults"
+import { ODLanguage } from "../modules/language"
+import { ODClientActivityManager } from "../modules/client"
+import { ODEvent, ODEventManager } from "../modules/event"
+import * as discord from "discord.js"
+
+//DEFAULT MODULES
+import { ODVersionManager_Default } from "./base"
+import { ODConfigManager_Default} from "./config"
+import { ODDatabaseManager_Default } from "./database"
+import { ODFlagManager_Default } from "./flag"
+import { ODSessionManager_Default } from "./session"
+import { ODLanguageManager_Default } from "./language"
+import { ODCheckerFunctionManager_Default, ODCheckerManager_Default, ODCheckerRenderer_Default, ODCheckerTranslationRegister_Default } from "./checker"
+import { ODClientManager_Default, ODSlashCommandManager_Default, ODTextCommandManager_Default } from "./client"
+import { ODBuilderManager_Default, ODButtonManager_Default, ODDropdownManager_Default, ODEmbedManager_Default, ODFileManager_Default, ODMessageManager_Default, ODModalManager_Default } from "./builder"
+import { ODButtonResponderManager_Default, ODCommandResponderManager_Default, ODDropdownResponderManager_Default, ODModalResponderManager_Default, ODResponderManager_Default } from "./responder"
+import { ODActionManager_Default } from "./action"
+import { ODPermissionManager_Default } from "./permission"
+import { ODHelpMenuManager_Default } from "./helpmenu"
+import { ODStatsManager_Default } from "./stat"
+import { ODCodeManager_Default } from "./code"
+import { ODCooldownManager_Default } from "./cooldown"
+import { ODPostManager_Default } from "./post"
+import { ODVerifyBarManager_Default } from "./verifybar"
+import { ODStartScreenManager_Default } from "./startscreen"
+import { ODLiveStatusManager_Default } from "./console"
+
+//OPEN TICKET MODULES
+import { ODOptionManager, ODTicketOption } from "../openticket/option"
+import { ODPanel, ODPanelManager } from "../openticket/panel"
+import { ODTicket, ODTicketClearFilter, ODTicketManager } from "../openticket/ticket"
+import { ODQuestionManager } from "../openticket/question"
+import { ODBlacklistManager } from "../openticket/blacklist"
+import { ODTranscriptManager_Default } from "../openticket/transcript"
+import { ODRole, ODRoleManager } from "../openticket/role"
+
+/**## ODEventIds_Default `type`
+ * This type is an array of ids available in the `ODEvent_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODEventIds_Default {
+ //error handling
+ "onErrorHandling": ODEvent_Default<(error:Error, origin:NodeJS.UncaughtExceptionOrigin) => ODPromiseVoid>
+ "afterErrorHandling": ODEvent_Default<(error:Error, origin:NodeJS.UncaughtExceptionOrigin, message:ODError) => ODPromiseVoid>
+
+ //plugins
+ "afterPluginsLoaded": ODEvent_Default<(plugins:ODPluginManager) => ODPromiseVoid>
+ "onPluginClassLoad": ODEvent_Default<(classes:ODPluginClassManager, plugins:ODPluginManager) => ODPromiseVoid>
+ "afterPluginClassesLoaded": ODEvent_Default<(classes:ODPluginClassManager, plugins:ODPluginManager) => ODPromiseVoid>
+ "onPluginEventLoad": ODEvent_Default<(classes:ODPluginEventManager, plugins:ODPluginManager) => ODPromiseVoid>
+ "afterPluginEventsLoaded": ODEvent_Default<(classes:ODPluginEventManager, plugins:ODPluginManager) => ODPromiseVoid>
+
+
+ "onFlagLoad": ODEvent_Default<(flags:ODFlagManager_Default) => ODPromiseVoid>
+ "afterFlagsLoaded": ODEvent_Default<(flags:ODFlagManager_Default) => ODPromiseVoid>
+ "onFlagInit": ODEvent_Default<(flags:ODFlagManager_Default) => ODPromiseVoid>
+ "afterFlagsInitiated": ODEvent_Default<(flags:ODFlagManager_Default) => ODPromiseVoid>
+
+ //configs
+ "onConfigLoad": ODEvent_Default<(configs:ODConfigManager_Default) => ODPromiseVoid>
+ "afterConfigsLoaded": ODEvent_Default<(configs:ODConfigManager_Default) => ODPromiseVoid>
+
+ //databases
+ "onDatabaseLoad": ODEvent_Default<(databases:ODDatabaseManager_Default) => ODPromiseVoid>
+ "afterDatabasesLoaded": ODEvent_Default<(databases:ODDatabaseManager_Default) => ODPromiseVoid>
+
+ //languages
+ "onLanguageLoad": ODEvent_Default<(languages:ODLanguageManager_Default) => ODPromiseVoid>
+ "afterLanguagesLoaded": ODEvent_Default<(languages:ODLanguageManager_Default) => ODPromiseVoid>
+ "onLanguageSelect": ODEvent_Default<(languages:ODLanguageManager_Default) => ODPromiseVoid>
+ "afterLanguagesSelected": ODEvent_Default<(main:ODLanguage|null, backup:ODLanguage|null, languages:ODLanguageManager_Default) => ODPromiseVoid>
+
+ //sessions
+ "onSessionLoad": ODEvent_Default<(languages:ODSessionManager_Default) => ODPromiseVoid>
+ "afterSessionsLoaded": ODEvent_Default<(languages:ODSessionManager_Default) => ODPromiseVoid>
+
+ //config checkers
+ "onCheckerLoad": ODEvent_Default<(checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "afterCheckersLoaded": ODEvent_Default<(checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "onCheckerFunctionLoad": ODEvent_Default<(functions:ODCheckerFunctionManager_Default, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "afterCheckerFunctionsLoaded": ODEvent_Default<(functions:ODCheckerFunctionManager_Default, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "onCheckerExecute": ODEvent_Default<(checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "afterCheckersExecuted": ODEvent_Default<(result:ODCheckerResult, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "onCheckerTranslationLoad": ODEvent_Default<(translations:ODCheckerTranslationRegister_Default, enabled:boolean, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "afterCheckerTranslationsLoaded": ODEvent_Default<(translations:ODCheckerTranslationRegister_Default, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "onCheckerRender": ODEvent_Default<(renderer:ODCheckerRenderer_Default, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "afterCheckersRendered": ODEvent_Default<(renderer:ODCheckerRenderer_Default, checkers:ODCheckerManager_Default) => ODPromiseVoid>
+ "onCheckerQuit": ODEvent_Default<(checkers:ODCheckerManager_Default) => ODPromiseVoid>
+
+ //client configuration
+ "onClientLoad": ODEvent_Default<(client:ODClientManager_Default) => ODPromiseVoid>
+ "afterClientLoaded": ODEvent_Default<(client:ODClientManager_Default) => ODPromiseVoid>
+ "onClientInit": ODEvent_Default<(client:ODClientManager_Default) => ODPromiseVoid>
+ "afterClientInitiated": ODEvent_Default<(client:ODClientManager_Default) => ODPromiseVoid>
+ "onClientReady": ODEvent_Default<(client:ODClientManager_Default) => ODPromiseVoid>
+ "afterClientReady": ODEvent_Default<(client:ODClientManager_Default) => ODPromiseVoid>
+ "onClientActivityLoad": ODEvent_Default<(activity:ODClientActivityManager, client:ODClientManager_Default) => ODPromiseVoid>
+ "afterClientActivityLoaded": ODEvent_Default<(activity:ODClientActivityManager, client:ODClientManager_Default) => ODPromiseVoid>
+ "onClientActivityInit": ODEvent_Default<(activity:ODClientActivityManager, client:ODClientManager_Default) => ODPromiseVoid>
+ "afterClientActivityInitiated": ODEvent_Default<(activity:ODClientActivityManager, client:ODClientManager_Default) => ODPromiseVoid>
+
+ //client slash commands
+ "onSlashCommandLoad": ODEvent_Default<(slash:ODSlashCommandManager_Default, client:ODClientManager_Default) => ODPromiseVoid>
+ "afterSlashCommandsLoaded": ODEvent_Default<(slash:ODSlashCommandManager_Default, client:ODClientManager_Default) => ODPromiseVoid>
+ "onSlashCommandRegister": ODEvent_Default<(slash:ODSlashCommandManager_Default, client:ODClientManager_Default) => ODPromiseVoid>
+ "afterSlashCommandsRegistered": ODEvent_Default<(slash:ODSlashCommandManager_Default, client:ODClientManager_Default) => ODPromiseVoid>
+
+ //client text commands
+ "onTextCommandLoad": ODEvent_Default<(text:ODTextCommandManager_Default, client:ODClientManager_Default,) => ODPromiseVoid>
+ "afterTextCommandsLoaded": ODEvent_Default<(text:ODTextCommandManager_Default, client:ODClientManager_Default) => ODPromiseVoid>
+
+ //questions
+ "onQuestionLoad": ODEvent_Default<(questions:ODQuestionManager) => ODPromiseVoid>
+ "afterQuestionsLoaded": ODEvent_Default<(questions:ODQuestionManager) => ODPromiseVoid>
+
+ //options
+ "onOptionLoad": ODEvent_Default<(options:ODOptionManager) => ODPromiseVoid>
+ "afterOptionsLoaded": ODEvent_Default<(options:ODOptionManager) => ODPromiseVoid>
+
+ //panels
+ "onPanelLoad": ODEvent_Default<(panels:ODPanelManager) => ODPromiseVoid>
+ "afterPanelsLoaded": ODEvent_Default<(panels:ODPanelManager) => ODPromiseVoid>
+ "onPanelSpawn": ODEvent_Default<(panel:ODPanel) => ODPromiseVoid>
+ "afterPanelSpawned": ODEvent_Default<(panel:ODPanel) => ODPromiseVoid>
+
+ //tickets
+ "onTicketLoad": ODEvent_Default<(tickets:ODTicketManager) => ODPromiseVoid>
+ "afterTicketsLoaded": ODEvent_Default<(tickets:ODTicketManager) => ODPromiseVoid>
+
+ //ticket creation
+ "onTicketChannelCreation": ODEvent_Default<(option:ODTicketOption, user:discord.User) => ODPromiseVoid>
+ "afterTicketChannelCreated": ODEvent_Default<(option:ODTicketOption, channel:discord.GuildTextBasedChannel, user:discord.User) => ODPromiseVoid>
+ "onTicketChannelDeletion": ODEvent_Default<(ticket:ODTicket, channel:discord.GuildTextBasedChannel, user:discord.User) => ODPromiseVoid>
+ "afterTicketChannelDeleted": ODEvent_Default<(ticket:ODTicket, user:discord.User) => ODPromiseVoid>
+ "onTicketPermissionsCreated": ODEvent_Default<(option:ODTicketOption, permissions:ODPermissionManager_Default, channel:discord.GuildTextBasedChannel, user:discord.User) => ODPromiseVoid>
+ "afterTicketPermissionsCreated": ODEvent_Default<(option:ODTicketOption, permissions:ODPermissionManager_Default, channel:discord.GuildTextBasedChannel, user:discord.User) => ODPromiseVoid>
+ "onTicketMainMessageCreated": ODEvent_Default<(ticket:ODTicket, channel:discord.GuildTextBasedChannel, user:discord.User) => ODPromiseVoid>
+ "afterTicketMainMessageCreated": ODEvent_Default<(ticket:ODTicket, message:discord.Message, channel:discord.GuildTextBasedChannel, user:discord.User) => ODPromiseVoid>
+
+ //ticket actions
+ "onTicketCreate": ODEvent_Default<(creator:discord.User) => ODPromiseVoid>
+ "afterTicketCreated": ODEvent_Default<(ticket:ODTicket, creator:discord.User, channel:discord.GuildTextBasedChannel) => ODPromiseVoid>
+ "onTicketClose": ODEvent_Default<(ticket:ODTicket, closer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketClosed": ODEvent_Default<(ticket:ODTicket, closer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketReopen": ODEvent_Default<(ticket:ODTicket, reopener:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketReopened": ODEvent_Default<(ticket:ODTicket, reopener:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketDelete": ODEvent_Default<(ticket:ODTicket, deleter:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketDeleted": ODEvent_Default<(ticket:ODTicket, deleter:discord.User, reason:string|null) => ODPromiseVoid>
+ "onTicketMove": ODEvent_Default<(ticket:ODTicket, mover:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketMoved": ODEvent_Default<(ticket:ODTicket, mover:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketClaim": ODEvent_Default<(ticket:ODTicket, claimer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketClaimed": ODEvent_Default<(ticket:ODTicket, claimer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketUnclaim": ODEvent_Default<(ticket:ODTicket, unclaimer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketUnclaimed": ODEvent_Default<(ticket:ODTicket, unclaimer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketPin": ODEvent_Default<(ticket:ODTicket, pinner:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketPinned": ODEvent_Default<(ticket:ODTicket, pinner:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketUnpin": ODEvent_Default<(ticket:ODTicket, unpinner:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketUnpinned": ODEvent_Default<(ticket:ODTicket, unpinner:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketUserAdd": ODEvent_Default<(ticket:ODTicket, adder:discord.User, user:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketUserAdded": ODEvent_Default<(ticket:ODTicket, adder:discord.User, user:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketUserRemove": ODEvent_Default<(ticket:ODTicket, remover:discord.User, user:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketUserRemoved": ODEvent_Default<(ticket:ODTicket, remover:discord.User, user:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketRename": ODEvent_Default<(ticket:ODTicket, renamer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "afterTicketRenamed": ODEvent_Default<(ticket:ODTicket, renamer:discord.User, channel:discord.GuildTextBasedChannel, reason:string|null) => ODPromiseVoid>
+ "onTicketsClear": ODEvent_Default<(tickets:ODTicket[], clearer:discord.User, channel:discord.GuildTextBasedChannel, filter:ODTicketClearFilter) => ODPromiseVoid>
+ "afterTicketsCleared": ODEvent_Default<(tickets:ODTicket[], clearer:discord.User, channel:discord.GuildTextBasedChannel, filter:ODTicketClearFilter) => ODPromiseVoid>
+
+ //roles
+ "onRoleLoad": ODEvent_Default<(roles:ODRoleManager) => ODPromiseVoid>
+ "afterRolesLoaded": ODEvent_Default<(roles:ODRoleManager) => ODPromiseVoid>
+ "onRoleUpdate": ODEvent_Default<(user:discord.User,role:ODRole) => ODPromiseVoid>
+ "afterRolesUpdated": ODEvent_Default<(user:discord.User,role:ODRole) => ODPromiseVoid>
+
+ //blacklist
+ "onBlacklistLoad": ODEvent_Default<(blacklist:ODBlacklistManager) => ODPromiseVoid>
+ "afterBlacklistLoaded": ODEvent_Default<(blacklist:ODBlacklistManager) => ODPromiseVoid>
+
+ //transcripts
+ "onTranscriptCompilerLoad": ODEvent_Default<(transcripts:ODTranscriptManager_Default) => ODPromiseVoid>
+ "afterTranscriptCompilersLoaded": ODEvent_Default<(transcripts:ODTranscriptManager_Default) => ODPromiseVoid>
+ "onTranscriptHistoryLoad": ODEvent_Default<(transcripts:ODTranscriptManager_Default) => ODPromiseVoid>
+ "afterTranscriptHistoryLoaded": ODEvent_Default<(transcripts:ODTranscriptManager_Default) => ODPromiseVoid>
+
+ //transcript creation
+ "onTranscriptCreate": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "afterTranscriptCreated": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "onTranscriptInit": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "afterTranscriptInitiated": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "onTranscriptCompile": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "afterTranscriptCompiled": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "onTranscriptReady": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+ "afterTranscriptReady": ODEvent_Default<(transcripts:ODTranscriptManager_Default,ticket:ODTicket,channel:discord.TextChannel,user:discord.User) => ODPromiseVoid>
+
+ //builders
+ "onButtonBuilderLoad": ODEvent_Default<(buttons:ODButtonManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterButtonBuildersLoaded": ODEvent_Default<(buttons:ODButtonManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onDropdownBuilderLoad": ODEvent_Default<(dropdowns:ODDropdownManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterDropdownBuildersLoaded": ODEvent_Default<(dropdowns:ODDropdownManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onFileBuilderLoad": ODEvent_Default<(files:ODFileManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterFileBuildersLoaded": ODEvent_Default<(files:ODFileManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onEmbedBuilderLoad": ODEvent_Default<(embeds:ODEmbedManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterEmbedBuildersLoaded": ODEvent_Default<(embeds:ODEmbedManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onMessageBuilderLoad": ODEvent_Default<(messages:ODMessageManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterMessageBuildersLoaded": ODEvent_Default<(messages:ODMessageManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onModalBuilderLoad": ODEvent_Default<(modals:ODModalManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterModalBuildersLoaded": ODEvent_Default<(modals:ODModalManager_Default, builders:ODBuilderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+
+ //responders
+ "onCommandResponderLoad": ODEvent_Default<(commands:ODCommandResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterCommandRespondersLoaded": ODEvent_Default<(commands:ODCommandResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onButtonResponderLoad": ODEvent_Default<(buttons:ODButtonResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterButtonRespondersLoaded": ODEvent_Default<(buttons:ODButtonResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onDropdownResponderLoad": ODEvent_Default<(dropdowns:ODDropdownResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterDropdownRespondersLoaded": ODEvent_Default<(dropdowns:ODDropdownResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "onModalResponderLoad": ODEvent_Default<(modals:ODModalResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterModalRespondersLoaded": ODEvent_Default<(modals:ODModalResponderManager_Default, responders:ODResponderManager_Default, actions:ODActionManager_Default) => ODPromiseVoid>
+
+ //actions
+ "onActionLoad": ODEvent_Default<(actions:ODActionManager_Default) => ODPromiseVoid>
+ "afterActionsLoaded": ODEvent_Default<(actions:ODActionManager_Default) => ODPromiseVoid>
+
+ //verifybars
+ "onVerifyBarLoad": ODEvent_Default<(verifybars:ODVerifyBarManager_Default) => ODPromiseVoid>
+ "afterVerifyBarsLoaded": ODEvent_Default<(verifybars:ODVerifyBarManager_Default) => ODPromiseVoid>
+
+ //permissions
+ "onPermissionLoad": ODEvent_Default<(permissions:ODPermissionManager_Default) => ODPromiseVoid>
+ "afterPermissionsLoaded": ODEvent_Default<(permissions:ODPermissionManager_Default) => ODPromiseVoid>
+
+ //posts
+ "onPostLoad": ODEvent_Default<(posts:ODPostManager_Default) => ODPromiseVoid>
+ "afterPostsLoaded": ODEvent_Default<(posts:ODPostManager_Default) => ODPromiseVoid>
+ "onPostInit": ODEvent_Default<(posts:ODPostManager_Default) => ODPromiseVoid>
+ "afterPostsInitiated": ODEvent_Default<(posts:ODPostManager_Default) => ODPromiseVoid>
+
+ //cooldowns
+ "onCooldownLoad": ODEvent_Default<(cooldowns:ODCooldownManager_Default) => ODPromiseVoid>
+ "afterCooldownsLoaded": ODEvent_Default<(cooldowns:ODCooldownManager_Default) => ODPromiseVoid>
+ "onCooldownInit": ODEvent_Default<(cooldowns:ODCooldownManager_Default) => ODPromiseVoid>
+ "afterCooldownsInitiated": ODEvent_Default<(cooldowns:ODCooldownManager_Default) => ODPromiseVoid>
+
+ //help menu
+ "onHelpMenuCategoryLoad": ODEvent_Default<(menu:ODHelpMenuManager_Default) => ODPromiseVoid>
+ "afterHelpMenuCategoriesLoaded": ODEvent_Default<(menu:ODHelpMenuManager_Default) => ODPromiseVoid>
+ "onHelpMenuComponentLoad": ODEvent_Default<(menu:ODHelpMenuManager_Default) => ODPromiseVoid>
+ "afterHelpMenuComponentsLoaded": ODEvent_Default<(menu:ODHelpMenuManager_Default) => ODPromiseVoid>
+
+ //stats
+ "onStatScopeLoad": ODEvent_Default<(stats:ODStatsManager_Default) => ODPromiseVoid>
+ "afterStatScopesLoaded": ODEvent_Default<(stats:ODStatsManager_Default) => ODPromiseVoid>
+ "onStatLoad": ODEvent_Default<(stats:ODStatsManager_Default) => ODPromiseVoid>
+ "afterStatsLoaded": ODEvent_Default<(stats:ODStatsManager_Default) => ODPromiseVoid>
+ "onStatInit": ODEvent_Default<(stats:ODStatsManager_Default) => ODPromiseVoid>
+ "afterStatsInitiated": ODEvent_Default<(stats:ODStatsManager_Default) => ODPromiseVoid>
+
+ //code
+ "onCodeLoad": ODEvent_Default<(code:ODCodeManager_Default) => ODPromiseVoid>
+ "afterCodeLoaded": ODEvent_Default<(code:ODCodeManager_Default) => ODPromiseVoid>
+ "onCodeExecute": ODEvent_Default<(code:ODCodeManager_Default) => ODPromiseVoid>
+ "afterCodeExecuted": ODEvent_Default<(code:ODCodeManager_Default) => ODPromiseVoid>
+
+ //livestatus
+ "onLiveStatusSourceLoad": ODEvent_Default<(livestatus:ODLiveStatusManager_Default) => ODPromiseVoid>
+ "afterLiveStatusSourcesLoaded": ODEvent_Default<(livestatus:ODLiveStatusManager_Default) => ODPromiseVoid>
+
+ //startscreen
+ "onStartScreenLoad": ODEvent_Default<(startscreen:ODStartScreenManager_Default) => ODPromiseVoid>
+ "afterStartScreensLoaded": ODEvent_Default<(startscreen:ODStartScreenManager_Default) => ODPromiseVoid>
+ "onStartScreenRender": ODEvent_Default<(startscreen:ODStartScreenManager_Default) => ODPromiseVoid>
+ "afterStartScreensRendered": ODEvent_Default<(startscreen:ODStartScreenManager_Default) => ODPromiseVoid>
+}
+
+/**## ODEventManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODEvent class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.events`!
+ */
+export class ODEventManager_Default extends ODEventManager {
+ get(id:StartScreenId): ODEventIds_Default[StartScreenId]
+ get(id:ODValidId): ODEvent|null
+
+ get(id:ODValidId): ODEvent|null {
+ return super.get(id)
+ }
+
+ remove(id:StartScreenId): ODEventIds_Default[StartScreenId]
+ remove(id:ODValidId): ODEvent|null
+
+ remove(id:ODValidId): ODEvent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODEventIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODEventManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODEvent class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.events`!
+ */
+export class ODEvent_Default ODPromiseVoid)> extends ODEvent {
+ listen(callback:Callback): void {
+ return super.listen(callback)
+ }
+ listenOnce(callback:Callback): void {
+ return super.listenOnce(callback)
+ }
+ wait(): Promise>
+ wait(): Promise {
+ return super.wait()
+ }
+ emit(params:Parameters): Promise {
+ return super.emit(params)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/flag.ts b/src/core/api/defaults/flag.ts
new file mode 100644
index 0000000..0d4b835
--- /dev/null
+++ b/src/core/api/defaults/flag.ts
@@ -0,0 +1,53 @@
+///////////////////////////////////////
+//DEFAULT PROCESS MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODFlagManager, ODFlag } from "../modules/flag"
+
+/**## ODFlagManagerIds_Default `type`
+ * This type is an array of ids available in the `ODFlagManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODFlagManagerIds_Default {
+ "openticket:no-migration":ODFlag,
+ "openticket:dev-config":ODFlag,
+ "openticket:dev-database":ODFlag,
+ "openticket:debug":ODFlag,
+ "openticket:crash":ODFlag,
+ "openticket:no-transcripts":ODFlag,
+ "openticket:no-checker":ODFlag,
+ "openticket:checker":ODFlag,
+ "openticket:no-easter":ODFlag,
+ "openticket:no-plugins":ODFlag,
+ "openticket:soft-plugins":ODFlag,
+ "openticket:force-slash-update":ODFlag,
+}
+
+/**## ODFlagManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODFlagManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.flags`!
+ */
+export class ODFlagManager_Default extends ODFlagManager {
+ get(id:FlagId): ODFlagManagerIds_Default[FlagId]
+ get(id:ODValidId): ODFlag|null
+
+ get(id:ODValidId): ODFlag|null {
+ return super.get(id)
+ }
+
+ remove(id:FlagId): ODFlagManagerIds_Default[FlagId]
+ remove(id:ODValidId): ODFlag|null
+
+ remove(id:ODValidId): ODFlag|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODFlagManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/helpmenu.ts b/src/core/api/defaults/helpmenu.ts
new file mode 100644
index 0000000..7add16f
--- /dev/null
+++ b/src/core/api/defaults/helpmenu.ts
@@ -0,0 +1,323 @@
+///////////////////////////////////////
+//DEFAULT HELP MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODHelpMenuCategory, ODHelpMenuCommandComponent, ODHelpMenuComponent, ODHelpMenuManager } from "../modules/helpmenu"
+
+/**## ODHelpMenuManagerIds_Default `type`
+ * This type is an array of ids available in the `ODHelpMenuManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerIds_Default {
+ "openticket:general":ODHelpMenuCategory_DefaultGeneral,
+ "openticket:ticket-basic":ODHelpMenuCategory_DefaultTicketBasic,
+ "openticket:ticket-advanced":ODHelpMenuCategory_DefaultTicketAdvanced,
+ "openticket:ticket-user":ODHelpMenuCategory_DefaultTicketUser,
+ "openticket:admin":ODHelpMenuCategory_DefaultAdmin,
+ "openticket:advanced":ODHelpMenuCategory_DefaultAdvanced,
+ "openticket:extra":ODHelpMenuCategory_DefaultExtra
+}
+
+/**## ODHelpMenuManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.helpmenu`!
+ */
+export class ODHelpMenuManager_Default extends ODHelpMenuManager {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerIds_Default[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuCategory|null
+
+ get(id:ODValidId): ODHelpMenuCategory|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerIds_Default[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuCategory|null
+
+ remove(id:ODValidId): ODHelpMenuCategory|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultGeneral `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultGeneral` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultGeneral {
+ "openticket:help":ODHelpMenuCommandComponent,
+ "openticket:ticket":ODHelpMenuCommandComponent|null
+}
+
+/**## ODHelpMenuCategory_DefaultGeneral `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:general` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultGeneral extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultGeneral[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultGeneral[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultGeneral): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultTicketBasic `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultTicketBasic` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultTicketBasic {
+ "openticket:close":ODHelpMenuCommandComponent,
+ "openticket:delete":ODHelpMenuCommandComponent,
+ "openticket:reopen":ODHelpMenuCommandComponent
+}
+
+/**## ODHelpMenuCategory_DefaultTicketBasic `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:ticket` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultTicketBasic extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultTicketBasic[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultTicketBasic[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultTicketBasic): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultTicketAdvanced` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced {
+ "openticket:pin":ODHelpMenuCommandComponent,
+ "openticket:unpin":ODHelpMenuCommandComponent,
+ "openticket:move":ODHelpMenuCommandComponent,
+ "openticket:rename":ODHelpMenuCommandComponent
+}
+
+/**## ODHelpMenuCategory_DefaultTicketAdvanced `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:ticket` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultTicketAdvanced extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultTicketUser `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultTicketUser` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultTicketUser {
+ "openticket:claim":ODHelpMenuCommandComponent,
+ "openticket:unclaim":ODHelpMenuCommandComponent,
+ "openticket:add":ODHelpMenuCommandComponent,
+ "openticket:remove":ODHelpMenuCommandComponent
+}
+
+/**## ODHelpMenuCategory_DefaultTicketUser `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:ticket` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultTicketUser extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultTicketUser[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultTicketUser[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultTicketUser): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultAdmin `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultAdmin` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultAdmin {
+ "openticket:panel":ODHelpMenuCommandComponent,
+ "openticket:blacklist-view":ODHelpMenuCommandComponent,
+ "openticket:blacklist-add":ODHelpMenuCommandComponent,
+ "openticket:blacklist-remove":ODHelpMenuCommandComponent,
+ "openticket:blacklist-get":ODHelpMenuCommandComponent
+}
+
+/**## ODHelpMenuCategory_DefaultAdmin `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:admin` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultAdmin extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultAdmin[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultAdmin[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultAdmin): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultAdvanced `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultAdvanced` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultAdvanced {
+ "openticket:stats-global":ODHelpMenuCommandComponent,
+ "openticket:stats-reset":ODHelpMenuCommandComponent,
+ "openticket:stats-ticket":ODHelpMenuCommandComponent,
+ "openticket:stats-user":ODHelpMenuCommandComponent,
+ "openticket:autoclose-disable":ODHelpMenuCommandComponent,
+ "openticket:autoclose-enable":ODHelpMenuCommandComponent
+}
+
+/**## ODHelpMenuCategory_DefaultAdvanced `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:advanced` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultAdvanced extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultAdvanced[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultAdvanced[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultAdvanced): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODHelpMenuManagerCategoryIds_DefaultExtra `type`
+ * This type is an array of ids available in the `ODHelpMenuCategory_DefaultExtra` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODHelpMenuManagerCategoryIds_DefaultExtra {}
+
+/**## ODHelpMenuCategory_DefaultExtra `default_class`
+ * This is a special class that adds type definitions & typescript to the ODHelpMenuManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:general` category in `openticket.helpmenu`!
+ */
+export class ODHelpMenuCategory_DefaultExtra extends ODHelpMenuCategory {
+ get(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultExtra[HelpMenuCategoryId]
+ get(id:ODValidId): ODHelpMenuComponent|null
+
+ get(id:ODValidId): ODHelpMenuComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:HelpMenuCategoryId): ODHelpMenuManagerCategoryIds_DefaultExtra[HelpMenuCategoryId]
+ remove(id:ODValidId): ODHelpMenuComponent|null
+
+ remove(id:ODValidId): ODHelpMenuComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODHelpMenuManagerCategoryIds_DefaultExtra): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/language.ts b/src/core/api/defaults/language.ts
new file mode 100644
index 0000000..d8ad7ab
--- /dev/null
+++ b/src/core/api/defaults/language.ts
@@ -0,0 +1,510 @@
+///////////////////////////////////////
+//DEFAULT LANGUAGE MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODLanguageManager, ODLanguage } from "../modules/language"
+
+/**## ODLanguageManagerTranslations_Default `type`
+ * This type is an array of ids available in the `ODLanguageManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export type ODLanguageManagerTranslations_Default = (
+ "checker.system.headerOpenTicket"|
+ "checker.system.typeError"|
+ "checker.system.typeWarning"|
+ "checker.system.typeInfo"|
+ "checker.system.headerConfigChecker"|
+ "checker.system.headerDescription"|
+ "checker.system.footerError"|
+ "checker.system.footerWarning"|
+ "checker.system.footerSupport"|
+ "checker.system.compactInformation"|
+ "checker.system.dataPath"|
+ "checker.system.dataDocs"|
+ "checker.system.dataMessages"|
+ "checker.messages.invalidType"|
+ "checker.messages.propertyMissing"|
+ "checker.messages.propertyOptional"|
+ "checker.messages.objectDisabled"|
+ "checker.messages.nullInvalid"|
+ "checker.messages.switchInvalidType"|
+ "checker.messages.objectSwitchInvalid"|
+ "checker.messages.stringTooShort"|
+ "checker.messages.stringTooLong"|
+ "checker.messages.stringLengthInvalid"|
+ "checker.messages.stringStartsWith"|
+ "checker.messages.stringEndsWith"|
+ "checker.messages.stringContains"|
+ "checker.messages.stringChoices"|
+ "checker.messages.stringRegex"|
+ "checker.messages.numberTooShort"|
+ "checker.messages.numberTooLong"|
+ "checker.messages.numberLengthInvalid"|
+ "checker.messages.numberTooSmall"|
+ "checker.messages.numberTooLarge"|
+ "checker.messages.numberNotEqual"|
+ "checker.messages.numberStep"|
+ "checker.messages.numberStepOffset"|
+ "checker.messages.numberStartsWith"|
+ "checker.messages.numberEndsWith"|
+ "checker.messages.numberContains"|
+ "checker.messages.numberChoices"|
+ "checker.messages.numberFloat"|
+ "checker.messages.numberNegative"|
+ "checker.messages.numberPositive"|
+ "checker.messages.numberZero"|
+ "checker.messages.booleanTrue"|
+ "checker.messages.booleanFalse"|
+ "checker.messages.arrayEmptyDisabled"|
+ "checker.messages.arrayEmptyRequired"|
+ "checker.messages.arrayTooShort"|
+ "checker.messages.arrayTooLong"|
+ "checker.messages.arrayLengthInvalid"|
+ "checker.messages.arrayInvalidTypes"|
+ "checker.messages.arrayDouble"|
+ "checker.messages.discordInvalidId"|
+ "checker.messages.discordInvalidIdOptions"|
+ "checker.messages.discordInvalidToken"|
+ "checker.messages.colorInvalid"|
+ "checker.messages.emojiTooShort"|
+ "checker.messages.emojiTooLong"|
+ "checker.messages.emojiCustom"|
+ "checker.messages.emojiInvalid"|
+ "checker.messages.urlInvalid"|
+ "checker.messages.urlInvalidHttp"|
+ "checker.messages.urlInvalidProtocol"|
+ "checker.messages.urlInvalidHostname"|
+ "checker.messages.urlInvalidExtension"|
+ "checker.messages.urlInvalidPath"|
+ "checker.messages.idNotUnique"|
+ "checker.messages.idNonExistent"|
+ "checker.messages.invalidLanguage"|
+ "checker.messages.invalidButton"|
+ "checker.messages.unusedOption"|
+ "checker.messages.unusedQuestion"|
+ "checker.messages.dropdownOption"|
+ "actions.buttons.create"|
+ "actions.buttons.close"|
+ "actions.buttons.delete"|
+ "actions.buttons.reopen"|
+ "actions.buttons.claim"|
+ "actions.buttons.unclaim"|
+ "actions.buttons.pin"|
+ "actions.buttons.unpin"|
+ "actions.buttons.clear"|
+ "actions.buttons.helpSwitchSlash"|
+ "actions.buttons.helpSwitchText"|
+ "actions.buttons.helpPage"|
+ "actions.buttons.withReason"|
+ "actions.buttons.withoutTranscript"|
+
+ "actions.titles.created"|
+ "actions.titles.close"|
+ "actions.titles.delete"|
+ "actions.titles.reopen"|
+ "actions.titles.claim"|
+ "actions.titles.unclaim"|
+ "actions.titles.pin"|
+ "actions.titles.unpin"|
+ "actions.titles.rename"|
+ "actions.titles.move"|
+ "actions.titles.add"|
+ "actions.titles.remove"|
+
+ "actions.titles.help"|
+ "actions.titles.statsReset"|
+ "actions.titles.blacklistAdd"|
+ "actions.titles.blacklistRemove"|
+ "actions.titles.blacklistGet"|
+ "actions.titles.blacklistView"|
+ "actions.titles.blacklistAddDm"|
+ "actions.titles.blacklistRemoveDm"|
+ "actions.titles.clear"|
+ "actions.titles.roles"|
+
+ "actions.titles.autoclose"|
+ "actions.titles.autocloseEnabled"|
+ "actions.titles.autocloseDisabled"|
+ "actions.titles.autodelete"|
+ "actions.titles.autodeleteEnabled"|
+ "actions.titles.autodeleteDisabled"|
+
+ "actions.descriptions.create"|
+ "actions.descriptions.close"|
+ "actions.descriptions.delete"|
+ "actions.descriptions.reopen"|
+ "actions.descriptions.claim"|
+ "actions.descriptions.unclaim"|
+ "actions.descriptions.pin"|
+ "actions.descriptions.unpin"|
+ "actions.descriptions.rename"|
+ "actions.descriptions.move"|
+ "actions.descriptions.add"|
+ "actions.descriptions.remove"|
+
+ "actions.descriptions.helpExplanation"|
+ "actions.descriptions.statsReset"|
+ "actions.descriptions.statsError"|
+ "actions.descriptions.blacklistAdd"|
+ "actions.descriptions.blacklistRemove"|
+ "actions.descriptions.blacklistGetSuccess"|
+ "actions.descriptions.blacklistGetEmpty"|
+ "actions.descriptions.blacklistViewEmpty"|
+ "actions.descriptions.blacklistViewTip"|
+ "actions.descriptions.clearVerify"|
+ "actions.descriptions.clearReady"|
+ "actions.descriptions.rolesEmpty"|
+
+ "actions.descriptions.autocloseLeave"|
+ "actions.descriptions.autocloseTimeout"|
+ "actions.descriptions.autodeleteLeave"|
+ "actions.descriptions.autodeleteTimeout"|
+ "actions.descriptions.autocloseEnabled"|
+ "actions.descriptions.autocloseDisabled"|
+ "actions.descriptions.autodeleteEnabled"|
+ "actions.descriptions.autodeleteDisabled"|
+
+ "actions.descriptions.ticketMessageLimit"|
+ "actions.descriptions.ticketMessageAutoclose"|
+ "actions.descriptions.ticketMessageAutodelete"|
+ "actions.descriptions.panelReady"|
+
+ "actions.modal.closePlaceholder"|
+ "actions.modal.deletePlaceholder"|
+ "actions.modal.reopenPlaceholder"|
+ "actions.modal.claimPlaceholder"|
+ "actions.modal.unclaimPlaceholder"|
+ "actions.modal.pinPlaceholder"|
+ "actions.modal.unpinPlaceholder"|
+
+ "actions.logs.createLog"|
+ "actions.logs.closeLog"|
+ "actions.logs.closeDm"|
+ "actions.logs.deleteLog"|
+ "actions.logs.deleteDm"|
+ "actions.logs.reopenLog"|
+ "actions.logs.reopenDm"|
+ "actions.logs.claimLog"|
+ "actions.logs.claimDm"|
+ "actions.logs.unclaimLog"|
+ "actions.logs.unclaimDm"|
+ "actions.logs.pinLog"|
+ "actions.logs.pinDm"|
+ "actions.logs.unpinLog"|
+ "actions.logs.unpinDm"|
+ "actions.logs.renameLog"|
+ "actions.logs.renameDm"|
+ "actions.logs.moveLog"|
+ "actions.logs.moveDm"|
+ "actions.logs.addLog"|
+ "actions.logs.addDm"|
+ "actions.logs.removeLog"|
+ "actions.logs.removeDm"|
+
+ "actions.logs.blacklistAddLog"|
+ "actions.logs.blacklistRemoveLog"|
+ "actions.logs.blacklistAddDm"|
+ "actions.logs.blacklistRemoveDm"|
+ "actions.logs.clearLog"|
+
+ "transcripts.success.visit"|
+ "transcripts.success.ready"|
+ "transcripts.success.textFileDescription"|
+ "transcripts.success.htmlProgress"|
+
+ "transcripts.success.createdChannel"|
+ "transcripts.success.createdCreator"|
+ "transcripts.success.createdParticipant"|
+ "transcripts.success.createdActiveAdmin"|
+ "transcripts.success.createdEveryAdmin"|
+ "transcripts.success.createdOther"|
+
+ "transcripts.errors.retry"|
+ "transcripts.errors.continue"|
+ "transcripts.errors.backup"|
+ "transcripts.errors.error"|
+
+ "errors.titles.internalError"|
+ "errors.titles.optionMissing"|
+ "errors.titles.optionInvalid"|
+ "errors.titles.unknownCommand"|
+ "errors.titles.noPermissions"|
+ "errors.titles.unknownTicket"|
+ "errors.titles.deprecatedTicket"|
+ "errors.titles.unknownOption"|
+ "errors.titles.unknownPanel"|
+ "errors.titles.notInGuild"|
+ "errors.titles.channelRename"|
+ "errors.titles.busy"|
+
+ "errors.descriptions.askForInfo"|
+ "errors.descriptions.askForInfoResolve"|
+ "errors.descriptions.internalError"|
+ "errors.descriptions.optionMissing"|
+ "errors.descriptions.optionInvalid"|
+ "errors.descriptions.optionInvalidChoose"|
+ "errors.descriptions.unknownCommand"|
+ "errors.descriptions.noPermissions"|
+ "errors.descriptions.noPermissionsList"|
+ "errors.descriptions.noPermissionsCooldown"|
+ "errors.descriptions.noPermissionsBlacklist"|
+ "errors.descriptions.noPermissionsLimitGlobal"|
+ "errors.descriptions.noPermissionsLimitGlobalUser"|
+ "errors.descriptions.noPermissionsLimitOption"|
+ "errors.descriptions.noPermissionsLimitOptionUser"|
+ "errors.descriptions.unknownTicket"|
+ "errors.descriptions.deprecatedTicket"|
+ "errors.descriptions.notInGuild"|
+ "errors.descriptions.channelRename"|
+ "errors.descriptions.channelRenameSource"|
+ "errors.descriptions.busy"|
+
+ "errors.optionInvalidReasons.stringRegex"|
+ "errors.optionInvalidReasons.stringMinLength"|
+ "errors.optionInvalidReasons.stringMaxLength"|
+ "errors.optionInvalidReasons.numberInvalid"|
+ "errors.optionInvalidReasons.numberMin"|
+ "errors.optionInvalidReasons.numberMax"|
+ "errors.optionInvalidReasons.numberDecimal"|
+ "errors.optionInvalidReasons.numberNegative"|
+ "errors.optionInvalidReasons.numberPositive"|
+ "errors.optionInvalidReasons.numberZero"|
+ "errors.optionInvalidReasons.channelNotFound"|
+ "errors.optionInvalidReasons.userNotFound"|
+ "errors.optionInvalidReasons.roleNotFound"|
+ "errors.optionInvalidReasons.memberNotFound"|
+ "errors.optionInvalidReasons.mentionableNotFound"|
+ "errors.optionInvalidReasons.channelType"|
+ "errors.optionInvalidReasons.notInGuild"|
+
+ "errors.permissions.developer"|
+ "errors.permissions.owner"|
+ "errors.permissions.admin"|
+ "errors.permissions.moderator"|
+ "errors.permissions.support"|
+ "errors.permissions.member"|
+ "errors.permissions.discord-administrator"|
+
+ "errors.actionInvalid.close"|
+ "errors.actionInvalid.reopen"|
+ "errors.actionInvalid.claim"|
+ "errors.actionInvalid.unclaim"|
+ "errors.actionInvalid.pin"|
+ "errors.actionInvalid.unpin"|
+ "errors.actionInvalid.add"|
+ "errors.actionInvalid.remove"|
+
+ "params.uppercase.ticket"|
+ "params.uppercase.tickets"|
+ "params.uppercase.reason"|
+ "params.uppercase.creator"|
+ "params.uppercase.remaining"|
+ "params.uppercase.added"|
+ "params.uppercase.removed"|
+ "params.uppercase.filter"|
+ "params.uppercase.claimedBy"|
+ "params.uppercase.method"|
+ "params.uppercase.type"|
+ "params.uppercase.blacklisted"|
+ "params.uppercase.panel"|
+ "params.uppercase.command"|
+ "params.uppercase.system"|
+ "params.uppercase.true"|
+ "params.uppercase.false"|
+ "params.uppercase.syntax"|
+ "params.uppercase.originalName"|
+ "params.uppercase.newName"|
+ "params.uppercase.until"|
+ "params.uppercase.validOptions"|
+ "params.uppercase.validPanels"|
+ "params.uppercase.autoclose"|
+ "params.uppercase.autodelete"|
+ "params.uppercase.startupDate"|
+ "params.uppercase.version"|
+ "params.uppercase.name"|
+ "params.uppercase.role"|
+ "params.uppercase.status"|
+ "params.uppercase.claimed"|
+ "params.uppercase.pinned"|
+ "params.uppercase.creationDate"|
+
+ "params.lowercase.text"|
+ "params.lowercase.html"|
+ "params.lowercase.command"|
+ "params.lowercase.modal"|
+ "params.lowercase.button"|
+ "params.lowercase.dropdown"|
+ "params.lowercase.method"|
+
+ "commands.reason"|
+ "commands.help"|
+ "commands.panel"|
+ "commands.panelId"|
+ "commands.panelAutoUpdate"|
+ "commands.ticket"|
+ "commands.ticketId"|
+ "commands.close"|
+ "commands.delete"|
+ "commands.deleteNoTranscript"|
+ "commands.reopen"|
+ "commands.claim"|
+ "commands.claimUser"|
+ "commands.unclaim"|
+ "commands.pin"|
+ "commands.unpin"|
+ "commands.move"|
+ "commands.moveId"|
+ "commands.rename"|
+ "commands.renameName"|
+ "commands.add"|
+ "commands.addUser"|
+ "commands.remove"|
+ "commands.removeUser"|
+ "commands.blacklist"|
+ "commands.blacklistView"|
+ "commands.blacklistAdd"|
+ "commands.blacklistRemove"|
+ "commands.blacklistGet"|
+ "commands.blacklistGetUser"|
+ "commands.stats"|
+ "commands.statsReset"|
+ "commands.statsGlobal"|
+ "commands.statsUser"|
+ "commands.statsUserUser"|
+ "commands.statsTicket"|
+ "commands.statsTicketTicket"|
+ "commands.clear"|
+ "commands.clearFilter"|
+
+ "commands.clearFilters.all"|
+ "commands.clearFilters.open"|
+ "commands.clearFilters.close"|
+ "commands.clearFilters.claim"|
+ "commands.clearFilters.unclaim"|
+ "commands.clearFilters.pin"|
+ "commands.clearFilters.unpin"|
+ "commands.clearFilters.autoclose"|
+
+ "commands.autoclose"|
+ "commands.autocloseDisable"|
+ "commands.autocloseEnable"|
+ "commands.autocloseEnableTime"|
+ "commands.autodelete"|
+ "commands.autodeleteDisable"|
+ "commands.autodeleteEnable"|
+ "commands.autodeleteEnableTime"|
+
+ "helpMenu.help"|
+ "helpMenu.ticket"|
+ "helpMenu.close"|
+ "helpMenu.delete"|
+ "helpMenu.reopen"|
+ "helpMenu.pin"|
+ "helpMenu.unpin"|
+ "helpMenu.move"|
+ "helpMenu.rename"|
+ "helpMenu.claim"|
+ "helpMenu.unclaim"|
+ "helpMenu.add"|
+ "helpMenu.remove"|
+ "helpMenu.panel"|
+ "helpMenu.blacklistView"|
+ "helpMenu.blacklistAdd"|
+ "helpMenu.blacklistRemove"|
+ "helpMenu.blacklistGet"|
+ "helpMenu.statsGlobal"|
+ "helpMenu.statsTicket"|
+ "helpMenu.statsUser"|
+ "helpMenu.statsReset"|
+ "helpMenu.autocloseDisable"|
+ "helpMenu.autocloseEnable"|
+ "helpMenu.autodeleteDisable"|
+ "helpMenu.autodeleteEnable"|
+
+ "stats.scopes.global"|
+ "stats.scopes.system"|
+ "stats.scopes.user"|
+ "stats.scopes.ticket"|
+ "stats.scopes.participants"|
+
+ "stats.properties.ticketsCreated"|
+ "stats.properties.ticketsClosed"|
+ "stats.properties.ticketsDeleted"|
+ "stats.properties.ticketsReopened"|
+ "stats.properties.ticketsAutoclosed"|
+ "stats.properties.ticketsClaimed"|
+ "stats.properties.ticketsPinned"|
+ "stats.properties.ticketsMoved"|
+ "stats.properties.usersBlacklisted"|
+ "stats.properties.transcriptsCreated"
+)
+
+/**## ODLanguageManagerIds_Default `type`
+ * This type is an array of ids available in the `ODLanguageManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODLanguageManagerIds_Default {
+ "openticket:custom":ODLanguage,
+ "openticket:english":ODLanguage,
+ "openticket:dutch":ODLanguage,
+ "openticket:portuguese":ODLanguage,
+ "openticket:czech":ODLanguage,
+ //ADD NEW LANGUAGES HERE!!!
+}
+
+/**## ODLanguageManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODLanguageManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.languages`!
+ */
+export class ODLanguageManager_Default extends ODLanguageManager {
+ get(id:LanguageId): ODLanguageManagerIds_Default[LanguageId]
+ get(id:ODValidId): ODLanguage|null
+
+ get(id:ODValidId): ODLanguage|null {
+ return super.get(id)
+ }
+
+ remove(id:LanguageId): ODLanguageManagerIds_Default[LanguageId]
+ remove(id:ODValidId): ODLanguage|null
+
+ remove(id:ODValidId): ODLanguage|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODLanguageManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getTranslation(id:ODLanguageManagerTranslations_Default): string
+ getTranslation(id:string): string|null
+
+ getTranslation(id:string): string|null {
+ return super.getTranslation(id)
+ }
+
+ setCurrentLanguage(id:keyof ODLanguageManagerIds_Default): void
+ setCurrentLanguage(id:ODValidId): void
+
+ setCurrentLanguage(id:ODValidId): void {
+ return super.setCurrentLanguage(id)
+ }
+
+ setBackupLanguage(id:keyof ODLanguageManagerIds_Default): void
+ setBackupLanguage(id:ODValidId): void
+
+ setBackupLanguage(id:ODValidId): void {
+ return super.setBackupLanguage(id)
+ }
+
+ getTranslationWithParams(id:ODLanguageManagerTranslations_Default, params:string[]): string
+ getTranslationWithParams(id:string, params:string[]): string|null
+
+ getTranslationWithParams(id:string, params:string[]): string|null {
+ return super.getTranslationWithParams(id,params)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/permission.ts b/src/core/api/defaults/permission.ts
new file mode 100644
index 0000000..0f01536
--- /dev/null
+++ b/src/core/api/defaults/permission.ts
@@ -0,0 +1,30 @@
+///////////////////////////////////////
+//DEFAULT PERMISSION MODULE
+///////////////////////////////////////
+import { ODDebugger } from "../modules/console"
+import { ODPermissionManager } from "../modules/permission"
+
+/**## ODPermissionManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODPermissionManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.permissions`!
+ */
+export class ODPermissionManager_Default extends ODPermissionManager {
+ constructor(debug:ODDebugger){
+ super(debug,true)
+ }
+}
+
+/**## ODPermissionEmbedType `type`
+ * This type contains all types available in the `openticket:no-permissions` embed.
+ */
+export type ODPermissionEmbedType = (
+ "developer"|
+ "owner"|
+ "admin"|
+ "moderator"|
+ "support"|
+ "member"|
+ "discord-administrator"
+)
\ No newline at end of file
diff --git a/src/core/api/defaults/post.ts b/src/core/api/defaults/post.ts
new file mode 100644
index 0000000..0b0dc27
--- /dev/null
+++ b/src/core/api/defaults/post.ts
@@ -0,0 +1,44 @@
+///////////////////////////////////////
+//DEFAULT POST MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODPost, ODPostManager } from "../modules/post"
+import * as discord from "discord.js"
+
+/**## ODPostManagerIds_Default `type`
+ * This type is an array of ids available in the `ODPostManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODPostManagerIds_Default {
+ "openticket:logs":ODPost|null,
+ "openticket:transcripts":ODPost|null
+}
+
+/**## ODPostManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODPostManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.code`!
+ */
+export class ODPostManager_Default extends ODPostManager {
+ get(id:PostId): ODPostManagerIds_Default[PostId]
+ get(id:ODValidId): ODPost|null
+
+ get(id:ODValidId): ODPost|null {
+ return super.get(id)
+ }
+
+ remove(id:PostId): ODPostManagerIds_Default[PostId]
+ remove(id:ODValidId): ODPost|null
+
+ remove(id:ODValidId): ODPost|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODPostManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/responder.ts b/src/core/api/defaults/responder.ts
new file mode 100644
index 0000000..ffe944f
--- /dev/null
+++ b/src/core/api/defaults/responder.ts
@@ -0,0 +1,255 @@
+///////////////////////////////////////
+//DEFAULT RESPONDER MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODButtonResponder, ODButtonResponderInstance, ODButtonResponderManager, ODCommandResponder, ODCommandResponderInstance, ODCommandResponderManager, ODDropdownResponder, ODDropdownResponderInstance, ODDropdownResponderManager, ODModalResponder, ODModalResponderInstance, ODModalResponderManager, ODResponderManager } from "../modules/responder"
+import { ODWorkerManager_Default } from "./worker"
+
+/**## ODResponderManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODResponderManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.responders`!
+ */
+export class ODResponderManager_Default extends ODResponderManager {
+ declare commands: ODCommandResponderManager_Default
+ declare buttons: ODButtonResponderManager_Default
+ declare dropdowns: ODDropdownResponderManager_Default
+ declare modals: ODModalResponderManager_Default
+}
+
+/**## ODCommandResponderManagerIds_Default `type`
+ * This type is an array of ids available in the `ODCommandResponderManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODCommandResponderManagerIds_Default {
+ "openticket:help":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:help"|"openticket:logs"},
+ "openticket:stats":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:stats"|"openticket:logs"},
+ "openticket:panel":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:panel"|"openticket:logs"},
+ "openticket:ticket":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:ticket"|"openticket:logs"},
+ "openticket:blacklist":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:blacklist"|"openticket:discord-logs"|"openticket:logs"},
+
+ "openticket:close":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:close"|"openticket:logs"},
+ "openticket:reopen":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:reopen"|"openticket:logs"},
+ "openticket:delete":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:delete"|"openticket:logs"},
+ "openticket:claim":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:claim"|"openticket:logs"},
+ "openticket:unclaim":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:unclaim"|"openticket:logs"},
+ "openticket:pin":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:pin"|"openticket:logs"},
+ "openticket:unpin":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:unpin"|"openticket:logs"},
+
+ "openticket:rename":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:rename"|"openticket:logs"},
+ "openticket:move":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:move"|"openticket:logs"},
+ "openticket:add":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:add"|"openticket:logs"},
+ "openticket:remove":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:remove"|"openticket:logs"},
+ "openticket:clear":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:clear"|"openticket:logs"},
+
+ "openticket:autoclose":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:autoclose"|"openticket:logs"},
+ "openticket:autodelete":{source:"slash"|"text",params:{},workers:"openticket:permissions"|"openticket:autodelete"|"openticket:logs"},
+}
+
+/**## ODCommandResponderManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCommandResponderManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.responders.commands`!
+ */
+export class ODCommandResponderManager_Default extends ODCommandResponderManager {
+ get(id:CommandResponderId): ODCommandResponder_Default
+ get(id:ODValidId): ODCommandResponder<"slash"|"text",any>|null
+
+ get(id:ODValidId): ODCommandResponder<"slash"|"text",any>|null {
+ return super.get(id)
+ }
+
+ remove(id:CommandResponderId): ODCommandResponder_Default
+ remove(id:ODValidId): ODCommandResponder<"slash"|"text",any>|null
+
+ remove(id:ODValidId): ODCommandResponder<"slash"|"text",any>|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODCommandResponderManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODCommandResponder_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODCommandResponder class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODCommandResponder`'s!
+ */
+export class ODCommandResponder_Default extends ODCommandResponder {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODButtonResponderManagerIds_Default `type`
+ * This type is an array of ids available in the `ODButtonResponderManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODButtonResponderManagerIds_Default {
+ "openticket:verifybar-success":{source:"button",params:{},workers:"openticket:handle-verifybar"},
+ "openticket:verifybar-failure":{source:"button",params:{},workers:"openticket:handle-verifybar"},
+
+ "openticket:help-menu-switch":{source:"button",params:{},workers:"openticket:update-help-menu"},
+ "openticket:help-menu-previous":{source:"button",params:{},workers:"openticket:update-help-menu"},
+ "openticket:help-menu-next":{source:"button",params:{},workers:"openticket:update-help-menu"},
+
+ "openticket:ticket-option":{source:"button",params:{},workers:"openticket:ticket-option"},
+ "openticket:role-option":{source:"button",params:{},workers:"openticket:role-option"},
+
+ "openticket:claim-ticket":{source:"button",params:{},workers:"openticket:claim-ticket"},
+ "openticket:unclaim-ticket":{source:"button",params:{},workers:"openticket:unclaim-ticket"},
+ "openticket:pin-ticket":{source:"button",params:{},workers:"openticket:pin-ticket"},
+ "openticket:unpin-ticket":{source:"button",params:{},workers:"openticket:unpin-ticket"},
+ "openticket:close-ticket":{source:"button",params:{},workers:"openticket:close-ticket"},
+ "openticket:reopen-ticket":{source:"button",params:{},workers:"openticket:reopen-ticket"},
+ "openticket:delete-ticket":{source:"button",params:{},workers:"openticket:delete-ticket"},
+
+ "openticket:transcript-error-retry":{source:"button",params:{},workers:"openticket:permissions"|"openticket:delete-ticket"|"openticket:logs"},
+ "openticket:transcript-error-continue":{source:"button",params:{},workers:"openticket:permissions"|"openticket:delete-ticket"|"openticket:logs"},
+ "openticket:clear-continue":{source:"button",params:{},workers:"openticket:clear-continue"},
+}
+
+/**## ODButtonResponderManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODButtonResponderManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.responders.buttons`!
+ */
+export class ODButtonResponderManager_Default extends ODButtonResponderManager {
+ get(id:ButtonResponderId): ODButtonResponder_Default
+ get(id:ODValidId): ODButtonResponder<"button",any>|null
+
+ get(id:ODValidId): ODButtonResponder<"button",any>|null {
+ return super.get(id)
+ }
+
+ remove(id:ButtonResponderId): ODButtonResponder_Default
+ remove(id:ODValidId): ODButtonResponder<"button",any>|null
+
+ remove(id:ODValidId): ODButtonResponder<"button",any>|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODButtonResponderManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODButtonResponder_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODButtonResponder class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODButtonResponder`'s!
+ */
+export class ODButtonResponder_Default extends ODButtonResponder {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODDropdownResponderManagerIds_Default `type`
+ * This type is an array of ids available in the `ODDropdownResponderManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODDropdownResponderManagerIds_Default {
+ "openticket:panel-dropdown-tickets":{source:"dropdown",params:{},workers:"openticket:panel-dropdown-tickets"},
+}
+
+/**## ODDropdownResponderManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODDropdownResponderManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.responders.dropdowns`!
+ */
+export class ODDropdownResponderManager_Default extends ODDropdownResponderManager {
+ get(id:DropdownResponderId): ODDropdownResponder_Default
+ get(id:ODValidId): ODDropdownResponder<"dropdown",any>|null
+
+ get(id:ODValidId): ODDropdownResponder<"dropdown",any>|null {
+ return super.get(id)
+ }
+
+ remove(id:DropdownResponderId): ODDropdownResponder_Default
+ remove(id:ODValidId): ODDropdownResponder<"dropdown",any>|null
+
+ remove(id:ODValidId): ODDropdownResponder<"dropdown",any>|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODDropdownResponderManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODDropdownResponder_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODDropdownResponder class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODDropdownResponder`'s!
+ */
+export class ODDropdownResponder_Default extends ODDropdownResponder {
+ declare workers: ODWorkerManager_Default
+}
+
+/**## ODModalResponderManagerIds_Default `type`
+ * This type is an array of ids available in the `ODModalResponderManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODModalResponderManagerIds_Default {
+ "openticket:ticket-questions":{source:"modal",params:{},workers:"openticket:ticket-questions"},
+ "openticket:close-ticket-reason":{source:"modal",params:{},workers:"openticket:close-ticket-reason"},
+ "openticket:reopen-ticket-reason":{source:"modal",params:{},workers:"openticket:reopen-ticket-reason"},
+ "openticket:delete-ticket-reason":{source:"modal",params:{},workers:"openticket:delete-ticket-reason"},
+ "openticket:claim-ticket-reason":{source:"modal",params:{},workers:"openticket:claim-ticket-reason"},
+ "openticket:unclaim-ticket-reason":{source:"modal",params:{},workers:"openticket:unclaim-ticket-reason"},
+ "openticket:pin-ticket-reason":{source:"modal",params:{},workers:"openticket:pin-ticket-reason"},
+ "openticket:unpin-ticket-reason":{source:"modal",params:{},workers:"openticket:unpin-ticket-reason"},
+}
+
+/**## ODModalResponderManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODModalResponderManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.responders.dropdowns`!
+ */
+export class ODModalResponderManager_Default extends ODModalResponderManager {
+ get(id:ModalResponderId): ODModalResponder_Default
+ get(id:ODValidId): ODModalResponder<"modal",any>|null
+
+ get(id:ODValidId): ODModalResponder<"modal",any>|null {
+ return super.get(id)
+ }
+
+ remove(id:ModalResponderId): ODModalResponder_Default
+ remove(id:ODValidId): ODModalResponder<"modal",any>|null
+
+ remove(id:ODValidId): ODModalResponder<"modal",any>|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODModalResponderManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODModalResponder_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODModalResponder class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the default `ODModalResponder`'s!
+ */
+export class ODModalResponder_Default extends ODModalResponder {
+ declare workers: ODWorkerManager_Default
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/session.ts b/src/core/api/defaults/session.ts
new file mode 100644
index 0000000..cce95ec
--- /dev/null
+++ b/src/core/api/defaults/session.ts
@@ -0,0 +1,42 @@
+///////////////////////////////////////
+//DEFAULT SESSION MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODSession, ODSessionManager } from "../modules/session"
+
+/**## ODSessionManagerIds_Default `type`
+ * This type is an array of ids available in the `ODSessionManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODSessionManagerIds_Default {
+ "test-session":ODSession
+}
+
+/**## ODSessionManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODSessionManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.sessions`!
+ */
+export class ODSessionManager_Default extends ODSessionManager {
+ get(id:SessionId): ODSessionManagerIds_Default[SessionId]
+ get(id:ODValidId): ODSession|null
+
+ get(id:ODValidId): ODSession|null {
+ return super.get(id)
+ }
+
+ remove(id:SessionId): ODSessionManagerIds_Default[SessionId]
+ remove(id:ODValidId): ODSession|null
+
+ remove(id:ODValidId): ODSession|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODSessionManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/startscreen.ts b/src/core/api/defaults/startscreen.ts
new file mode 100644
index 0000000..4d49c07
--- /dev/null
+++ b/src/core/api/defaults/startscreen.ts
@@ -0,0 +1,48 @@
+///////////////////////////////////////
+//DEFAULT STARTSCREEN MODULE
+///////////////////////////////////////
+import { ODValidId } from "../modules/base"
+import { ODStartScreenCategoryComponent, ODStartScreenComponent, ODStartScreenFlagsCategoryComponent, ODStartScreenHeaderComponent, ODStartScreenLiveStatusCategoryComponent, ODStartScreenLogoComponent, ODStartScreenManager, ODStartScreenPluginsCategoryComponent, ODStartScreenPropertiesCategoryComponent } from "../modules/startscreen"
+
+/**## ODStartScreenManagerIds_Default `type`
+ * This type is an array of ids available in the `ODStartScreenManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODStartScreenManagerIds_Default {
+ "openticket:logo":ODStartScreenLogoComponent,
+ "openticket:header":ODStartScreenHeaderComponent,
+ "openticket:flags":ODStartScreenFlagsCategoryComponent,
+ "openticket:plugins":ODStartScreenPluginsCategoryComponent,
+ "openticket:stats":ODStartScreenPropertiesCategoryComponent,
+ "openticket:livestatus":ODStartScreenLiveStatusCategoryComponent,
+ "openticket:logs":ODStartScreenCategoryComponent
+}
+
+/**## ODStartScreenManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODStartScreenManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.startscreen`!
+ */
+export class ODStartScreenManager_Default extends ODStartScreenManager {
+ get(id:StartScreenId): ODStartScreenManagerIds_Default[StartScreenId]
+ get(id:ODValidId): ODStartScreenComponent|null
+
+ get(id:ODValidId): ODStartScreenComponent|null {
+ return super.get(id)
+ }
+
+ remove(id:StartScreenId): ODStartScreenManagerIds_Default[StartScreenId]
+ remove(id:ODValidId): ODStartScreenComponent|null
+
+ remove(id:ODValidId): ODStartScreenComponent|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODStartScreenManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
\ No newline at end of file
diff --git a/src/core/api/defaults/stat.ts b/src/core/api/defaults/stat.ts
new file mode 100644
index 0000000..3366d7d
--- /dev/null
+++ b/src/core/api/defaults/stat.ts
@@ -0,0 +1,363 @@
+///////////////////////////////////////
+//DEFAULT SESSION MODULE
+///////////////////////////////////////
+import { Guild, TextBasedChannel, User } from "discord.js"
+import { ODValidId } from "../modules/base"
+import { ODStatScope, ODStatGlobalScope, ODStatsManager, ODStat, ODBasicStat, ODDynamicStat, ODValidStatValue, ODStatScopeSetMode } from "../modules/stat"
+
+/**## ODStatsManagerIds_Default `type`
+ * This type is an array of ids available in the `ODStatsManager_Default` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODStatsManagerIds_Default {
+ "openticket:global":ODStatGlobalScope_DefaultGlobal,
+ "openticket:system":ODStatGlobalScope_DefaultSystem,
+ "openticket:user":ODStatScope_DefaultUser,
+ "openticket:ticket":ODStatScope_DefaultTicket,
+ "openticket:participants":ODStatScope_DefaultParticipants
+}
+
+/**## ODStatsManager_Default `default_class`
+ * This is a special class that adds type definitions & typescript to the ODStatsManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the global variable `openticket.stats`!
+ */
+export class ODStatsManager_Default extends ODStatsManager {
+ get(id:StatsId): ODStatsManagerIds_Default[StatsId]
+ get(id:ODValidId): ODStatScope|null
+
+ get(id:ODValidId): ODStatScope|null {
+ return super.get(id)
+ }
+
+ remove(id:StatsId): ODStatsManagerIds_Default[StatsId]
+ remove(id:ODValidId): ODStatScope|null
+
+ remove(id:ODValidId): ODStatScope|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODStatsManagerIds_Default): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+}
+
+/**## ODStatGlobalScopeIds_DefaultGlobal `type`
+ * This type is an array of ids available in the `ODStatGlobalScope_DefaultGlobal` class.
+ * It's used to generate typescript declarations for this class.
+ */
+export interface ODStatGlobalScopeIds_DefaultGlobal {
+ "openticket:tickets-created":ODBasicStat,
+ "openticket:tickets-closed":ODBasicStat,
+ "openticket:tickets-deleted":ODBasicStat,
+ "openticket:tickets-reopened":ODBasicStat,
+ "openticket:tickets-autoclosed":ODBasicStat,
+ "openticket:tickets-autodeleted":ODBasicStat,
+ "openticket:tickets-claimed":ODBasicStat,
+ "openticket:tickets-pinned":ODBasicStat,
+ "openticket:tickets-moved":ODBasicStat,
+ "openticket:users-blacklisted":ODBasicStat,
+ "openticket:transcripts-created":ODBasicStat
+}
+
+/**## ODStatGlobalScope_DefaultGlobal `default_class`
+ * This is a special class that adds type definitions & typescript to the ODStatsManager class.
+ * It doesn't add any extra features!
+ *
+ * This default class is made for the `openticket:global` category in `openticket.stats`!
+ */
+export class ODStatGlobalScope_DefaultGlobal extends ODStatGlobalScope {
+ get(id:StatsId): ODStatGlobalScopeIds_DefaultGlobal[StatsId]
+ get(id:ODValidId): ODStat|null
+
+ get(id:ODValidId): ODStat|null {
+ return super.get(id)
+ }
+
+ remove(id:StatsId): ODStatGlobalScopeIds_DefaultGlobal[StatsId]
+ remove(id:ODValidId): ODStat|null
+
+ remove(id:ODValidId): ODStat|null {
+ return super.remove(id)
+ }
+
+ exists(id:keyof ODStatGlobalScopeIds_DefaultGlobal): boolean
+ exists(id:ODValidId): boolean
+
+ exists(id:ODValidId): boolean {
+ return super.exists(id)
+ }
+
+ getStat