Compare commits
70
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e7fe4e502 | ||
|
|
e51cc54090 | ||
|
|
dc3515da10 | ||
|
|
c57f3397a4 | ||
|
|
686b45b0bd | ||
|
|
96d6758b4a | ||
|
|
52b49ec564 | ||
|
|
deebd2b758 | ||
|
|
ed9afffd70 | ||
|
|
91cad963e5 | ||
|
|
baa4e35878 | ||
|
|
f6c70fa62a | ||
|
|
58fb7b7512 | ||
|
|
5e1cfe7942 | ||
|
|
507d254556 | ||
|
|
43356fef05 | ||
|
|
bbae139c6b | ||
|
|
6516857866 | ||
|
|
213ec32225 | ||
|
|
04789d5426 | ||
|
|
0437af1507 | ||
|
|
73d188c5dc | ||
|
|
057a5fc6ae | ||
|
|
d35eb8f8bf | ||
|
|
19e5902320 | ||
|
|
66b0377a2b | ||
|
|
3bd308007c | ||
|
|
40bd873a33 | ||
|
|
09d9b2d265 | ||
|
|
7fb169789b | ||
|
|
1ab207b4eb | ||
|
|
5e5ac3e409 | ||
|
|
7809ffc5c6 | ||
|
|
9da823aa4b | ||
|
|
ff23b0e89e | ||
|
|
c3474fb017 | ||
|
|
03982f644e | ||
|
|
3a30152cb2 | ||
|
|
334c9dde21 | ||
|
|
b6985f9d28 | ||
|
|
7d30bf24d9 | ||
|
|
138378ac31 | ||
|
|
9a73ee0d01 | ||
|
|
f26e6f5e99 | ||
|
|
209041c1e5 | ||
|
|
499901fbf1 | ||
|
|
1a1a3f3b02 | ||
|
|
dd5374f84c | ||
|
|
02e8b7d0a1 | ||
|
|
ce0af7e1e9 | ||
|
|
e1fab310a4 | ||
|
|
0615235780 | ||
|
|
abd672dd3b | ||
|
|
e65a092bc0 | ||
|
|
17e1902681 | ||
|
|
91657f7519 | ||
|
|
cfa692b356 | ||
|
|
0cbf991090 | ||
|
|
72f7cbce26 | ||
|
|
05b4080ac5 | ||
|
|
7646b3fc35 | ||
|
|
bf13e15d56 | ||
|
|
f0183c319a | ||
|
|
c6e836455c | ||
|
|
8a6a8e527f | ||
|
|
4e7d45ea07 | ||
|
|
b7f5c7191d | ||
|
|
106cb0f718 | ||
|
|
0c2b688862 | ||
|
|
a037d76060 |
@@ -1,6 +1,6 @@
|
||||
# 🎥 Content Creators
|
||||
Hi there! We're searching for content creators to create tutorials & setup guides for Open Ticket.
|
||||
You can get many great rewards from helpin us!
|
||||
You can get many great rewards from helping us!
|
||||
|
||||
You can choose which type of tutorial you want to make. You can create a quick setup, full setup, plugin tutorial or something else!
|
||||
You are not required to talk in the video, but make sure it has some kind of subtitles instead.
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Report bugs to help us improve Open Ticket!
|
||||
title: "[BUG] Your Bug"
|
||||
labels: bug
|
||||
assignees: DJj123dj
|
||||
title: "Your Bug Name"
|
||||
---
|
||||
|
||||
### Bug Description:
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Documentation
|
||||
about: Do you know anything to be improved in the Open Ticket documentation?
|
||||
title: "Documentation Improvement Name"
|
||||
labels: "Documentation"
|
||||
---
|
||||
|
||||
### Related Docs/Systems:
|
||||
Choose related systems/docs for this improvement/change:
|
||||
- [ ] Guides
|
||||
- [ ] Developer Guides
|
||||
- [ ] API Reference
|
||||
- [ ] Blog
|
||||
- [ ] System (Docusaurus & Javascript)
|
||||
- [ ] Assets (images)
|
||||
- [ ] Other
|
||||
|
||||
### Improvement Description:
|
||||
A clear and concise description of the improvement.
|
||||
|
||||
> Please explain it as detailed as possible!
|
||||
|
||||
### Screenshots:
|
||||
If applicable, add screenshots to help explain your request.
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the request here.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Do you have a great idea for Open Ticket? Let us know using this issue!
|
||||
title: "Your Feature Name"
|
||||
labels: "Concept"
|
||||
---
|
||||
|
||||
### Feature Description:
|
||||
A clear and concise description of what the feature is.
|
||||
|
||||
### Affected Systems
|
||||
Systems which are affected, improved or modified:
|
||||
- (example) Slash command registration...
|
||||
- (example) API embed builders...
|
||||
- Scroll down to '....'
|
||||
- See error
|
||||
|
||||
> Leave empty when you don't know which parts this feature affects!
|
||||
|
||||
### Advantages & Use Cases:
|
||||
What advantages & use cases do you think this feature would result in?
|
||||
|
||||
### Screenshots:
|
||||
If applicable, add screenshots to help explain your feature request.
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the request here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: HTML Transcripts
|
||||
about: Found a bug related to the HTML Transcripts? Or do you have a feature request?
|
||||
title: "Your Bug/Improvement Name"
|
||||
labels: "HTML Transcripts"
|
||||
---
|
||||
|
||||
### Feature/Bug Description:
|
||||
A clear and concise description of what the feature/bug report is.
|
||||
|
||||
### Screenshots:
|
||||
If applicable, add screenshots to help explain your feature request or bug report.
|
||||
|
||||
### Files:
|
||||
Please include the `otdebug.txt` file in your report! With this file, we can take a deep-dive in to the error that happend.
|
||||
> #### Include this file for bug reports!
|
||||
> This file doesn't contain any credentials or sensitive information!
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
name: New Language
|
||||
about: Do you want to add a new language to Open Ticket?
|
||||
title: "Language Name"
|
||||
labels: "New Translation"
|
||||
---
|
||||
|
||||
### Language Name
|
||||
The name of the new language.
|
||||
|
||||
### Language Description/Details:
|
||||
A clear and concise description of the translation/language.
|
||||
|
||||
### Checklist
|
||||
Before the language is fully implemented, the following checklist must be met:
|
||||
- [ ] **📌 Created a language file in the `./languages/` directory.**
|
||||
- [ ] **📌 The translation file uses the `<lowercase-language-name>.json` format.**
|
||||
- [ ] **📌 The `"_TRANSLATION"` metadata in the language file is correctly configured.**
|
||||
- [ ] The `"otversion"` is correct.
|
||||
- [ ] The `"translators"` list is up to date has the discord/github usernames from all translators.
|
||||
- [ ] The `"lastedited"` variable is the last edited date in the following format: `DD/MM/YYYY`.
|
||||
- [ ] The `"language"` variable is the name of the language in English.
|
||||
- [ ] `"automated"` is enabled when `Google Translate`, `DeepL`, `ChatGPT` or any other kind of translation tools were used.
|
||||
- [ ] **📌 The language has been added to the `README.md` list.**
|
||||
- [ ] **📌 The language counters have been updated in the `README.md`.**
|
||||
- [ ] **📌 The language has been added to the list in the `ODLanguageManagerIds_Default` interface in (`./src/core/api/defaults/language.ts`).**
|
||||
- [ ] **📌 The language has been added to the list in `./src/data/languageLoader.ts`.**
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Plugin Request
|
||||
about: Do you have an idea for an Open Ticket plugin?
|
||||
title: "Your Plugin Name"
|
||||
labels: "Plugin"
|
||||
---
|
||||
|
||||
### Plugin Description:
|
||||
A clear and concise description of what the plugin is & does.
|
||||
|
||||
> Please explain the plugin as detailed as possible!
|
||||
|
||||
### Advantages & Use Cases:
|
||||
What advantages & use cases do you think this plugin would result in?
|
||||
|
||||
### Screenshots:
|
||||
If applicable, add screenshots to help explain your plugin request.
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the request here.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: Question
|
||||
about: Do you have a question about Open Ticket?
|
||||
title: "My Question"
|
||||
labels: "Question"
|
||||
---
|
||||
|
||||
### Question:
|
||||
A clear and concise description of the question.
|
||||
|
||||
> Please explain the question as detailed as possible!
|
||||
|
||||
### Screenshots:
|
||||
If applicable, add screenshots to help explain your plugin request.
|
||||
|
||||
### Checklist:
|
||||
Before creating this question, the following checklist must be met:
|
||||
- [ ] **📌 I've read the docs (https://otdocs.dj-dj.be) and I didn't found the solution.**
|
||||
- [ ] **📌 I've asked other people & they didn't know the solution.**
|
||||
- [ ] **📌 The question is not related to the following subjects: (If so, ask it in our discord server: https://discord.dj-dj.be)**
|
||||
- Configuring the bot
|
||||
- Hosting the bot (24/7)
|
||||
- Updating the bot
|
||||
- [ ] **📌 I know that this issue is publicly visible for everyone and I haven't shared any private info.**
|
||||
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the request here.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Updated Language
|
||||
about: Do you want to update/improve an existing language in Open Ticket?
|
||||
title: "Language Name"
|
||||
labels: "Updated Translation"
|
||||
---
|
||||
|
||||
### Language Name
|
||||
The name of the existing language.
|
||||
|
||||
### Language Description/Details:
|
||||
A clear and concise description of the translation/language changes.
|
||||
|
||||
### Checklist
|
||||
Before the language is updated, the following checklist must be met:
|
||||
- [ ] **📌 The `"_TRANSLATION"` metadata in the language file is correctly configured.**
|
||||
- [ ] The `"otversion"` is correct.
|
||||
- [ ] The `"translators"` list is up to date has the discord/github usernames from all translators.
|
||||
- [ ] The `"lastedited"` variable is the last edited date in the following format: `DD/MM/YYYY`.
|
||||
- [ ] The `"language"` variable is the name of the language in English.
|
||||
- [ ] `"automated"` is enabled when `Google Translate`, `DeepL`, `ChatGPT` or any other kind of translation tools were used.
|
||||
|
||||
### Additional Notes:
|
||||
Add any other context about the problem here.
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# Security Policy
|
||||
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="500px">
|
||||
|
||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v4.0.0)
|
||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v4.0.0) [](https://github.com/sponsors/DJj123dj)
|
||||
|
||||
This is the Security Policy of Open Ticket!<br>
|
||||
Here you can find a list of all supported & deprecated versions of the bot.<br>
|
||||
|
||||
+18
-2
@@ -1,3 +1,7 @@
|
||||
# Open Ticket (License)
|
||||
© 2025 - DJj123dj & Contributors
|
||||
|
||||
```
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
@@ -70,7 +74,7 @@ modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
1. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
@@ -671,4 +675,16 @@ into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
```
|
||||
|
||||
### Additional Terms for Open Ticket
|
||||
The following additional terms apply to the use of this software:
|
||||
|
||||
1. This software may not be used as part of a public Discord bot service that is monetized (e.g., generating revenue through subscriptions, donations, or other forms of payment) without the prior written permission of the original author.
|
||||
|
||||
2. This software may not be used as part of a public Discord bot service on multiple Discord servers without attribution to the original author.
|
||||
|
||||
3. You are allowed to use this bot in a Discord server that makes money or is for-profit, provided that the income is not generated directly from the ticket bot or its functionality.
|
||||
|
||||
These additional terms are an extension to the GNU GPL v3 and must be followed alongside the original license terms. In case of any conflict between these additional terms and the GNU GPL v3, the additional terms shall take precedence.
|
||||
@@ -12,11 +12,12 @@
|
||||
<a href="https://otdocs.dj-dj.be"><img alt="Open Ticket Documentation" src="https://img.shields.io/badge/discord.js-v14-CB3837.svg?style=flat-square&logo=npm"></img></a>
|
||||
<a href="https://github.com/DJj123dj/open-ticket/blob/main/LICENSE"><img alt="Open Ticket License" src="https://img.shields.io/badge/license-GPL%203.0-important.svg?style=flat-square"></img></a>
|
||||
<a href="https://otdocs.dj-dj.be"><img alt="Open Ticket Stars" src="https://img.shields.io/github/stars/djj123dj/open-ticket?color=yellow&label=stars&logo=github&style=flat-square"></img></a>
|
||||
<a href="https://github.com/sponsors/DJj123dj"><img alt="Sponsor DJj123dj" src="https://img.shields.io/badge/sponsor-DJj123dj-ea4aaa?style=flat-square&logo=githubsponsors"></img></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Open Ticket is the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes <code>Html Transcripts</code>, <code>Advanced Plugins</code>, <code>Custom Embeds</code>, <code>Questions/Modals</code>, <code>Stats</code> & 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 <code>19 Languages</code>! If you need any help, feel free to join our <a href="https://discord.dj-dj.be">discord server</a>!
|
||||
You're also able to customise every little aspect of the bot! From embeds to transcripts. Open Ticket is also translated in more than <code>22 Languages</code>! If you need any help, feel free to join our <a href="https://discord.dj-dj.be">discord server</a>!
|
||||
</p>
|
||||
|
||||
<p align="center"><b>⭐️ Help us grow by giving a star! ⭐️</b></p>
|
||||
@@ -26,23 +27,34 @@ You're also able to customise every little aspect of the bot! From embeds to tra
|
||||
> The translation count may not be accurate!
|
||||
|
||||
### 📌 Features
|
||||
- **💩 no bloat/credits** - Your Open Ticket bot doesn't contain any form of bloat or credits!
|
||||
- **📈 scalable** - Open Ticket is made to handle huge servers! Even if your server contains more than 100k members!
|
||||
- **📄 html transcripts** - Make use of the most customisable, beautiful and easy-to-use HTML Transcripts!
|
||||
- **💩 no bloat** - Your Open Ticket bot doesn't contain any form of bloat or credits!
|
||||
- **🔒 tested & secure** - Open Ticket has been tested by thousands of servers and is very secure!
|
||||
- **📈 scalable** - Open Ticket is made to handle huge servers! (Already tested in **servers with 100k members**)
|
||||
- **📄 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 **16 languages** by our community!
|
||||
- **🇬🇧 translation** - Open Ticket has been translated in more than **22 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!
|
||||
- **∞ unlimited** - Create an infinite amount of tickets & panels!
|
||||
- **📝 advanced plugins** - Create advanced plugins or use pre-made 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!
|
||||
- **📢 commands** - The bot contains more than 25 commands! And it's expandable with plugins!
|
||||
- **📦 slash & text** - Open Ticket supports both slash & text commands!
|
||||
- **📥 extra buttons** - The bot also supports Reaction Roles & Url Buttons, because why not ¯\\_(ツ)_/¯
|
||||
- **✨ commands** - The bot contains more than 25 commands!
|
||||
|
||||
#### And more using plugins!
|
||||
- **💬 reviews** - Create & customise your own review system!
|
||||
- **📢 feedback** - Collect feedback & create forms for people to answer!
|
||||
- **🏷️ tags** - Create tags & answer questions automatically using keywords!
|
||||
- **📝 forms** - Create advanced forms and ask people for additional details!
|
||||
- **🔄 rotating status** - Create a rotating bot status & use dynamic variables from the bot!
|
||||
- **💾 sqlite database** - Use an `sqlite` database for increased performances!
|
||||
- **🎉 custom embeds** - Create your own embeds and use them in your server!
|
||||
- **🎨 customisation** - Yep, you heard it right! Even more customisation!
|
||||
- **😁 And so much more...**
|
||||
|
||||
> ### 📦 Resources
|
||||
> Resources might not be accurate yet! *(because v4 is still in beta)*<br>
|
||||
@@ -50,58 +62,17 @@ You're also able to customise every little aspect of the bot! From embeds to tra
|
||||
> <a href="https:/otdocs.dj-dj.be"><img src="https://apis.dj-dj.be/cdn/openticket/open-ticket-docs.png" alt="Open Ticket Docs" width="180px"></a>
|
||||
> <a href="https://github.com/DJj123dj/open-discord-plugins"><img src="https://apis.dj-dj.be/cdn/openticket/open-ticket-plugins.png" alt="Open Ticket Plugins" width="180px"></a>
|
||||
|
||||
## 📸 Preview
|
||||
<img alt="Ticket Message" width="550px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/ticket.png">
|
||||
<img alt="Ticket Stats Message" width="550px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/stats.png">
|
||||
<img alt="Example Panel 1" width="550px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/panel-1.png">
|
||||
<img alt="Example Panel 2" width="550px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/panel-2.png">
|
||||
|
||||
## 🧩 Plugins
|
||||
View all available Open Ticket plugins in our [Official Plugin Repository](https://github.com/DJj123dj/open-discord-plugins)!
|
||||
|
||||
### 📦 Official *(made by DJdj Development)*
|
||||
|Name |Category |Description |
|
||||
|---------------------------------------------------------------------|----------------------------|-------------------------|
|
||||
|[`example-plugin`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/example-plugin/) |Example |This is just an example plugin for people that want to create their own plugin. |
|
||||
|[`example-command`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/example-command/) |Example |Sample custom command using the Open Discord system. |
|
||||
|[`ot-jump-to-top`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-jump-to-top/) |Command |Add a simple command to jump to the top of the ticket. |
|
||||
|[`ot-kill-switch`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-kill-switch/) |Command |Temporarily disable the ticket system using a kill switch. |
|
||||
|[`ot-rename-keep-prefix`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-rename-keep-prefix/) |Channel Management |Simple plugin to keep the channel prefix when using the /rename command. |
|
||||
|[`ot-no-slash-clear`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-no-slash-clear/) |Development |Disable the automatic removal of slash commands that aren't used by Open Ticket. |
|
||||
|[`ot-better-status`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-better-status/) |Client Activity |An advanced status plugin to rotate between states. It also allows for the use of variables. |
|
||||
|[`ot-sqlite-database`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-sqlite-database/) |Database |With this plugin, the database will be an SQLite file. It's a must-have for large servers! |
|
||||
|[`ot-ticket-message-extras`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-ticket-message-extras/) |Customisation |A plugin which adds a few little features to the ticket message. |
|
||||
|
||||
|
||||
### ✅ Verified *(made by community)*
|
||||
|Name |Author |Category |Description |
|
||||
|---------------------------------------------------------------------|----------------------------|----------------------------|-------------------------|
|
||||
|[`ot-config-reload`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-config-reload/) |guillee.3 |Config |This plugin adds a new command that allows reloading the Open Ticket config files without the need for a restart. |
|
||||
|[`ot-feedback`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-feedback/) |an_developer |Feedback System |A plugin to gather feedback of your support service. |
|
||||
|
||||
## 🛠️ Contributors
|
||||
### 🖥️ Team
|
||||
The team behind Open Ticket!
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://github.com/DJj123dj.png" alt="Profile Picture" width="80px"></td>
|
||||
<td><img src="https://github.com/Sank34.png" alt="Profile Picture" width="80px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="https://github.com/DJj123dj">DJj123dj</a></th>
|
||||
<th><a href="https://github.com/Sank34">Sanke</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### ❤️ Sponsors
|
||||
A big thanks to all our sponsors! Without them, it wouldn't be possible to create this project!
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://github.com/roppl3r.png" alt="Profile Picture" width="80px"></td>
|
||||
<td><img src="https://github.com/BENZORICH.png" alt="Profile Picture" width="80px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="https://github.com/roppl3r">roppl3r</a></th>
|
||||
<th><a href="https://github.com/BENZORICH">BENZORICH</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -112,6 +83,78 @@ A big thanks to all our sponsors! Without them, it wouldn't be possible to creat
|
||||
<img src="https://github.com/DOSEV5.png" alt="DOSEV5" width="40px">
|
||||
</a>
|
||||
|
||||
## 📸 Preview
|
||||
<img alt="Ticket Message" width="350px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/ticket.png">
|
||||
<img alt="Ticket Stats Message" width="350px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/stats.png">
|
||||
<img alt="Example Panel 1" width="350px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/panel-1.png">
|
||||
<img alt="Example Panel 2" width="350px" src="https://apis.dj-dj.be/cdn/openticket/preview-v4/panel-2.png">
|
||||
|
||||
## 🧩 Plugins
|
||||
**Download all plugins in our [Official Plugin Repository](https://github.com/DJj123dj/open-discord-plugins)!**<br>
|
||||
> #### ⭐ Featured Plugins (Top 5 Most Used)
|
||||
> **[`ot-sqlite-database`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-sqlite-database/),
|
||||
> [`ot-migrate-v3`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-migrate-v3/),
|
||||
> [`ot-reviews`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-reviews/),
|
||||
> [`ot-feedback`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-feedback/),
|
||||
> [`ot-tags`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-tags/)**
|
||||
|
||||
### 📦 Official *(made by DJdj Development)*
|
||||
|Name |Category |Description |
|
||||
|----------------------------------------------------------------------|----------------------------|-------------------------|
|
||||
|[`example-plugin`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/example-plugin/) |📄 Example |This is just an example plugin for people that want to create their own plugin. |
|
||||
|[`example-command`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/example-command/) |📄 Example |Sample custom command using the Open Discord system. |
|
||||
|[`ot-jump-to-top`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-jump-to-top/) |📢 Command |Add a simple command to jump to the top of the ticket. |
|
||||
|[`ot-kill-switch`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-kill-switch/) |📢 Command |Temporarily disable the ticket system using a kill switch. |
|
||||
|[`ot-hosting-status`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-hosting-status/) |📢 Command |A simple command to send hosting status updates to a channel. |
|
||||
|[`ot-shutdown`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-shutdown/) |📢 Command |A simple command to turn off the bot from a slash command (server & bot owner only). |
|
||||
|[`ot-sqlite-database`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-sqlite-database/) |⚙️ Utility |With this plugin, the database will be an SQLite file. It's a must-have for large servers! |
|
||||
|[`ot-no-slash-clear`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-no-slash-clear/) |⚙️ Utility |Disable the automatic removal of slash commands that aren't used by Open Ticket. |
|
||||
|[`ot-migrate-v3`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-migrate-v3/) |⚙️ Utility |Use this plugin to migrate all tickets from Open Ticket v3 to v4. |
|
||||
|[`ot-ticket-message-extras`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-ticket-message-extras/) |🎨 Customisation |A plugin which adds a few little features to the ticket message. |
|
||||
|[`ot-rename-keep-prefix`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-rename-keep-prefix/) |🎨 Customisation |Simple plugin to keep the channel prefix when using the /rename command. |
|
||||
|[`ot-customise-buttons`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-customise-buttons/) |🎨 Customisation |Customise almost all built-in buttons. This includes the claim, reopen, close & delete buttons. |
|
||||
|[`ot-ephemeral-messages`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-ephemeral-messages/) |🎨 Customisation |Customise for every messages if it needs to be ephemeral or not. |
|
||||
|[`ot-footers`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-footers/) |🎨 Customisation |A simple plugin to add footers in all Open Ticket embeds. |
|
||||
|[`ot-alt-detector`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-alt-detector/) |💼 Management |Use the discord-alt-detector npm package by DJdj Development in your ticket bot. |
|
||||
|[`ot-embeds`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-embeds/) |💼 Management |Create custom premade embeds in the config or use the command to create one from scratch. |
|
||||
|[`ot-move-actions`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-move-actions/) |💼 Management |Automatically unclaim/unpin a ticket when it's moved using `/move`. |
|
||||
|[`ot-reviews`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-reviews/) |💼 Management |Review system for Open Ticket! It is very customisable and has lots of features. |
|
||||
|[`ot-tags`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-tags/) |💼 Management |Use tags to quickly reply with a pre-existing text. |
|
||||
|[`ot-better-status`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-better-status/) |🤖 Client |An advanced status plugin to rotate between states. It also allows for the use of variables. |
|
||||
|
||||
### ✅ Verified *(made by community)*
|
||||
|Name |Author |Category |Description |
|
||||
|---------------------------------------------------------------------|----------------------------|----------------------------|-------------------------|
|
||||
|[`ot-config-reload`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-config-reload/) |guillee.3 |⚙️ Utility |This plugin adds a new command that allows reloading the Open Ticket config files without the need for a restart. |
|
||||
|[`ot-ticket-forms`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-ticket-forms/) |guillee.3 |💼 Management |An advanced forms plugin for Open Ticket. |
|
||||
|[`ot-feedback`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-feedback/) |an_developer |💼 Management |A plugin to gather feedback of your support service. |
|
||||
|[`ot-assign-role`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-assign-role/) |rapid.fast |💼 Management |This plugin assigns a predefined role to a user upon creating a ticket. |
|
||||
|[`ot-translate-cmds`](https://github.com/DJj123dj/open-discord-plugins/tree/main/open-ticket/ot-translate-cmds/) |guillee.3 |🤖 Client |Translate all built-in command names, descriptions & options. |
|
||||
|
||||
### 📢 Categories
|
||||
- **📄 Example** - These plugins serve as an example or starting template.
|
||||
- **📢 Command** - These plugins add new commands to the bot.
|
||||
- **⚙️ Utility** - These plugins help with backend & systems. You won't notice it in discord itself.
|
||||
- **🎨 Customisation** - These plugins help you customise the bot even further.
|
||||
- **💼 Management** - These plugins add features that help you manage your server.
|
||||
- **🤖 Client** - These plugins add features affecting the discord client or bot itself.
|
||||
|
||||
## 🛠️ Contributors
|
||||
### 🖥️ Team
|
||||
This is the main team working on Open Ticket. Don't forget to check their profiles!
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://github.com/DJj123dj.png" alt="Profile Picture" width="80px"></td>
|
||||
<td><img src="https://github.com/Sank34.png" alt="Profile Picture" width="80px"></td>
|
||||
<td><img src="https://github.com/smetsliam.png" alt="Profile Picture" width="80px"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="https://github.com/DJj123dj">💻 DJj123dj</a></th>
|
||||
<th><a href="https://github.com/Sank34">💬 Sanke</a></th>
|
||||
<th><a href="https://github.com/smetsliam">💬 DevBack</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### 💬 Translators
|
||||
|Language |Maintainer (discord name) |Status |
|
||||
|---------------------|--------------------------|-----------------------------|
|
||||
@@ -132,10 +175,12 @@ A big thanks to all our sponsors! Without them, it wouldn't be possible to creat
|
||||
|🇹🇷 Turkish |palestinian |🟢 Up To Date |
|
||||
|🇫🇷 French |guillee.3 |🟢 Up To Date |
|
||||
|🇦🇪 Arabic |palestinian |🟢 Up To Date |
|
||||
|🇮🇳 Hindi |an_developer |🟢 Up To Date |
|
||||
|🇱🇹 Lithuanian |tsgindrius |🟢 Up To Date |
|
||||
|🇵🇱 Polish |danoglez |🟢 Up To Date |
|
||||
|🇪🇪 Estonian |iamnotmega |🔵 Up To Date (ChatGPT) |
|
||||
|🇫🇮 Finnish |iamnotmega |🔵 Up To Date (ChatGPT) |
|
||||
|🇷🇺 Russian |apexo & ander |🟠 Temporary Outdated (beta) |
|
||||
|🇵🇱 Polish |mkevas |🟠 Temporary Outdated (beta) |
|
||||
|🇳🇴 Norwegian |noonenook |🟠 Temporary Outdated (beta) |
|
||||
|❓ Kurdish |raze.hama |🟠 Temporary Outdated (beta) |
|
||||
|❓ Persian |sasanwm |🟠 Temporary Outdated (beta) |
|
||||
@@ -164,6 +209,6 @@ Please help us grow by giving a star! It would help us a lot!
|
||||
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||
|
||||
**README.md**<br>
|
||||
[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)<br>
|
||||
[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) - [license](./LICENSE.md)<br>
|
||||
|
||||
© 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)
|
||||
© 2025 - [DJdj Development](https://www.dj-dj.be) - [Terms](https://www.dj-dj.be/terms) - [Privacy Policy](https://www.dj-dj.be/privacy) - [Support Us](https://github.com/sponsors/DJj123dj)
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
"version":"open-ticket-v4.0.0"
|
||||
},
|
||||
|
||||
"token":"your bot token here! Or leave empty when you use tokenFromENV",
|
||||
"token":"your bot token here! (or leave empty when using 'tokenFromENV')",
|
||||
"tokenFromENV":false,
|
||||
|
||||
"mainColor":"#f8ba00",
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@
|
||||
|
||||
"dmMessage":{
|
||||
"enabled":false,
|
||||
"text":"Thanks for creating a ticket in our server! (or leave empty)",
|
||||
"text":"Thank you for creating a ticket in our server! (or leave empty)",
|
||||
"embed":{
|
||||
"enabled":false,
|
||||
"title":"Embed Title! (or leave empty)",
|
||||
@@ -51,7 +51,7 @@
|
||||
"embed":{
|
||||
"enabled":true,
|
||||
"title":"Question Ticket",
|
||||
"description":"Thanks for creating a 'Question' ticket in our server!\nOur support team will help you soon!",
|
||||
"description":"Thank you for creating a 'Question' ticket in our server!\nOur support team will help you as soon as possible!",
|
||||
"customColor":"#f8ab00 (or leave empty)",
|
||||
|
||||
"image":"https://www.example.com/image.png (or leave empty)",
|
||||
@@ -70,13 +70,13 @@
|
||||
"autoclose":{
|
||||
"enableInactiveHours":false,
|
||||
"inactiveHours":24,
|
||||
"enableUserLeave":true,
|
||||
"enableUserLeave":false,
|
||||
"disableOnClaim":false
|
||||
},
|
||||
"autodelete":{
|
||||
"enableInactiveDays":false,
|
||||
"inactiveDays":7,
|
||||
"enableUserLeave":true,
|
||||
"enableUserLeave":false,
|
||||
"disableOnClaim":false
|
||||
},
|
||||
"cooldown":{
|
||||
|
||||
@@ -31,15 +31,13 @@
|
||||
"background":{
|
||||
"enableCustomBackground":false,
|
||||
"backgroundColor":"#f8ba00 (or leave empty)",
|
||||
"backgroundImage":"https://www.example.com/image.png (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,
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
[
|
||||
{"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"}
|
||||
]
|
||||
[]
|
||||
@@ -1,53 +1,133 @@
|
||||
const fs = require("fs")
|
||||
const ts = require("typescript")
|
||||
const nodepath = require('path')
|
||||
|
||||
/////////////// STARTUP FLAGS ///////////////
|
||||
const flags = [
|
||||
// Edit flags here when being unable to use the flags in the command prompt.
|
||||
//PTERODACTYL PANEL
|
||||
//add startup flags here (e.g. "--no-compile") when running via the panel
|
||||
]
|
||||
process.argv.push(...flags)
|
||||
/////////////// STARTUP FLAGS ///////////////
|
||||
|
||||
/*
|
||||
██████╗ ██████╗ ███████╗███╗ ██╗ ████████╗██╗ ██████╗██╗ ██╗███████╗████████╗
|
||||
██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ╚══██╔══╝██║██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝
|
||||
██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║██║ █████╔╝ █████╗ ██║
|
||||
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██║
|
||||
╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ██║╚██████╗██║ ██╗███████╗ ██║
|
||||
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝
|
||||
v4.0.0 - Made by DJj123dj & Contributors
|
||||
|
||||
Discord: https://discord.dj-dj.be
|
||||
Docs: https://otdocs.dj-dj.be
|
||||
Support Us: https://github.com/sponsors/DJj123dj/
|
||||
|
||||
*/
|
||||
///////////////////////////////////////////
|
||||
////////// COMPILATION + STARTUP //////////
|
||||
///////////////////////////////////////////
|
||||
const fs = require("fs")
|
||||
const ts = require("typescript")
|
||||
const {createHash,Hash} = require("crypto")
|
||||
const nodepath = require('path')
|
||||
|
||||
/** ## What is this?
|
||||
* This is a function which compares `./src/` with a hash stored in `./dist/hash.txt`.
|
||||
* The hash is based on the modified date & file metadata of all files in `./src/`.
|
||||
*
|
||||
* If the hash is different, the bot will automatically re-compile.
|
||||
* This will help you save CPU resources because the bot shouldn't re-compile when nothing has been changed :)
|
||||
*
|
||||
* @param {string} dir
|
||||
* @param {Hash|null} upperHash
|
||||
*/
|
||||
function computeSourceHash(dir,upperHash){
|
||||
const hash = upperHash ? upperHash : createHash("sha256")
|
||||
const info = fs.readdirSync(dir,{withFileTypes:true})
|
||||
|
||||
for (const file of info) {
|
||||
const fullPath = nodepath.join(dir,file.name)
|
||||
if (file.isFile()){
|
||||
const statInfo = fs.statSync(fullPath)
|
||||
//compute hash using file metadata
|
||||
const fileInfo = `${fullPath}:${statInfo.size}:${statInfo.mtimeMs}`
|
||||
hash.update(fileInfo)
|
||||
|
||||
}else if (file.isDirectory()){
|
||||
//recursively compute all folders
|
||||
computeSourceHash(fullPath,hash)
|
||||
}
|
||||
}
|
||||
//return when not being called recursively
|
||||
if (!upperHash) {
|
||||
return hash.digest("hex")
|
||||
}
|
||||
}
|
||||
function requiresCompilation(){
|
||||
//check hashes when not using "--compile-only" flag
|
||||
if (process.argv.includes("--compile-only")) return true
|
||||
|
||||
console.log("OT: Comparing prebuilds with source...")
|
||||
const sourceHash = computeSourceHash("./src/")
|
||||
const pluginHash = computeSourceHash("./plugins/")
|
||||
const hash = sourceHash+":"+pluginHash
|
||||
|
||||
if (fs.existsSync("./dist/hash.txt")){
|
||||
const distHash = fs.readFileSync("./dist/hash.txt").toString()
|
||||
if (distHash === hash) return false
|
||||
else return true
|
||||
}else return true
|
||||
}
|
||||
function saveNewCompilationHash(){
|
||||
const sourceHash = computeSourceHash("./src/")
|
||||
const pluginHash = computeSourceHash("./plugins/")
|
||||
const hash = sourceHash+":"+pluginHash
|
||||
fs.writeFileSync("./dist/hash.txt",hash)
|
||||
}
|
||||
|
||||
if (!process.argv.includes("--no-compile")){
|
||||
//REMOVE EXISTING BUILDS
|
||||
console.log("OT: Removing Prebuilds...")
|
||||
fs.rmSync("./dist",{recursive:true,force:true})
|
||||
if (requiresCompilation()){
|
||||
console.log("OT: Compilation Required...")
|
||||
|
||||
//COMPILE TYPESCRIPT
|
||||
console.log("OT: Compiling Typescript...")
|
||||
const configPath = nodepath.resolve('./tsconfig.json')
|
||||
const configFile = ts.readConfigFile(configPath,ts.sys.readFile)
|
||||
//REMOVE EXISTING BUILDS
|
||||
console.log("OT: Removing Prebuilds...")
|
||||
fs.rmSync("./dist",{recursive:true,force:true})
|
||||
|
||||
//check for tsconfig errors
|
||||
if (configFile.error){
|
||||
const message = ts.formatDiagnosticsWithColorAndContext([configFile.error],ts.createCompilerHost({}))
|
||||
console.error(message)
|
||||
process.exit(1)
|
||||
}
|
||||
//COMPILE TYPESCRIPT
|
||||
console.log("OT: Compiling Typescript...")
|
||||
const configPath = nodepath.resolve('./tsconfig.json')
|
||||
const configFile = ts.readConfigFile(configPath,ts.sys.readFile)
|
||||
|
||||
//parse tsconfig file
|
||||
const parsedConfig = ts.parseJsonConfigFileContent(configFile.config,ts.sys,nodepath.dirname(configPath))
|
||||
//check for tsconfig errors
|
||||
if (configFile.error){
|
||||
const message = ts.formatDiagnosticsWithColorAndContext([configFile.error],ts.createCompilerHost({}))
|
||||
console.error(message)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
//create program/compiler
|
||||
const program = ts.createProgram({
|
||||
rootNames:parsedConfig.fileNames,
|
||||
options:parsedConfig.options
|
||||
})
|
||||
//parse tsconfig file
|
||||
const parsedConfig = ts.parseJsonConfigFileContent(configFile.config,ts.sys,nodepath.dirname(configPath))
|
||||
|
||||
//emit all compiled files
|
||||
const emitResult = program.emit()
|
||||
//create program/compiler
|
||||
const program = ts.createProgram({
|
||||
rootNames:parsedConfig.fileNames,
|
||||
options:parsedConfig.options
|
||||
})
|
||||
|
||||
//print emit errors/warnings (type errors)
|
||||
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics)
|
||||
const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(allDiagnostics, ts.createCompilerHost(parsedConfig.options))
|
||||
console.log(formattedDiagnostics)
|
||||
//emit all compiled files
|
||||
const emitResult = program.emit()
|
||||
|
||||
if (emitResult.emitSkipped || allDiagnostics.find((d) => d.category == ts.DiagnosticCategory.Error || d.category == ts.DiagnosticCategory.Warning)){
|
||||
console.log("OT: Compilation Failed!")
|
||||
process.exit(1)
|
||||
}
|
||||
//print emit errors/warnings (type errors)
|
||||
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics)
|
||||
const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(allDiagnostics, ts.createCompilerHost(parsedConfig.options))
|
||||
console.log(formattedDiagnostics)
|
||||
|
||||
if (emitResult.emitSkipped || allDiagnostics.find((d) => d.category == ts.DiagnosticCategory.Error || d.category == ts.DiagnosticCategory.Warning)){
|
||||
console.log("OT: Compilation Failed!")
|
||||
process.exit(1)
|
||||
}
|
||||
}else console.log("OT: No Compilation Required...")
|
||||
|
||||
//save new compilation hash
|
||||
saveNewCompilationHash()
|
||||
}
|
||||
|
||||
//START BOT
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"typeWarning":"[WARNING]",
|
||||
"typeInfo":"[INFO]",
|
||||
"headerConfigChecker":"CONFIG CHECKER",
|
||||
"headerDescription":"check for errors in you config files!",
|
||||
"headerDescription":"check for errors in your 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}",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"typeWarning":"[WARNING]",
|
||||
"typeInfo":"[INFO]",
|
||||
"headerConfigChecker":"CONFIG CHECKER",
|
||||
"headerDescription":"check for errors in you config files!",
|
||||
"headerDescription":"check for errors in your 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}",
|
||||
|
||||
@@ -0,0 +1,478 @@
|
||||
{
|
||||
"_TRANSLATION":{
|
||||
"otversion":"v4.0.0",
|
||||
"translators":["an_developer"],
|
||||
"lastedited":"14/12/2024",
|
||||
"language":"Hindi",
|
||||
"automated":false
|
||||
},
|
||||
"checker":{
|
||||
"system":{
|
||||
"typeError":"[गलती]",
|
||||
"headerOpenTicket":"खुला टिकट",
|
||||
"typeWarning":"[चेतावनी]",
|
||||
"typeInfo":"[जानकारी]",
|
||||
"headerConfigChecker":"कॉन्फिग चेकर",
|
||||
"headerDescription":"अपनी कॉन्फ़िग फ़ाइलों में त्रुटियों की जाँच करें!",
|
||||
"footerError":"जब तक सभी {0} ठीक नहीं हो जाते, बॉट प्रारंभ नहीं होगा!",
|
||||
"footerWarning":"प्रारंभ करने से पहले सभी {0} को ठीक करने की अनुशंसा की जाती है!",
|
||||
"footerSupport":"समर्थन: {0} - दस्तावेज़: {1}",
|
||||
"compactInformation":"अधिक जानकारी के लिए {0} का उपयोग करें!",
|
||||
"dataPath":"पथ",
|
||||
"dataDocs":"डॉक्स",
|
||||
"dataMessages":"संदेश"
|
||||
},
|
||||
"messages":{
|
||||
"stringTooShort":"यह स्ट्रिंग {0} वर्णों से छोटी नहीं हो सकती!",
|
||||
"stringTooLong":"यह स्ट्रिंग {0} वर्णों से अधिक लंबी नहीं हो सकती!",
|
||||
"stringLengthInvalid":"यह स्ट्रिंग {0} अक्षर लंबी होनी चाहिए!",
|
||||
"stringStartsWith":"यह स्ट्रिंग {0} से शुरू होनी चाहिए!",
|
||||
"stringEndsWith":"इस स्ट्रिंग को {0} पर समाप्त होना चाहिए!",
|
||||
"stringContains":"इस स्ट्रिंग में {0} होना आवश्यक है!",
|
||||
"stringChoices":"यह स्ट्रिंग केवल निम्नलिखित मानों में से एक हो सकती है: {0}!",
|
||||
"stringRegex":"यह स्ट्रिंग अमान्य है!",
|
||||
|
||||
"numberTooShort":"यह संख्या {0} वर्णों से छोटी नहीं हो सकती!",
|
||||
"numberTooLong":"यह संख्या {0} वर्णों से अधिक लंबी नहीं हो सकती!",
|
||||
"numberLengthInvalid":"यह संख्या {0} वर्ण लंबी होनी चाहिए!",
|
||||
"numberTooSmall":"यह संख्या कम से कम {0} होनी चाहिए!",
|
||||
"numberTooLarge":"यह संख्या अधिकतम {0} होनी चाहिए!",
|
||||
"numberNotEqual":"यह संख्या {0} होनी चाहिए!",
|
||||
"numberStep":"यह संख्या {0} का गुणज होनी चाहिए!",
|
||||
"numberStepOffset":"यह संख्या {1} से शुरू होकर {0} का गुणज होनी चाहिए!",
|
||||
"numberStartsWith":"यह संख्या {0} से शुरू होनी चाहिए!",
|
||||
"numberEndsWith":"यह संख्या {0} पर समाप्त होनी चाहिए!",
|
||||
"numberContains":"इस संख्या में {0} होना आवश्यक है!",
|
||||
"numberChoices":"यह संख्या केवल निम्नलिखित मानों में से एक हो सकती है: {0}!",
|
||||
"numberFloat":"यह संख्या दशमलव नहीं हो सकती!",
|
||||
"numberNegative":"यह संख्या ऋणात्मक नहीं हो सकती!",
|
||||
"numberPositive":"यह संख्या सकारात्मक नहीं हो सकती!",
|
||||
"numberZero":"यह संख्या शून्य नहीं हो सकती!",
|
||||
|
||||
"booleanTrue":"यह बूलियन सत्य नहीं हो सकता!",
|
||||
"booleanFalse":"यह बूलियन झूठा नहीं हो सकता!",
|
||||
|
||||
"arrayEmptyDisabled":"इस सरणी को खाली रहने की अनुमति नहीं है!",
|
||||
"arrayEmptyRequired":"यह सरणी खाली होनी आवश्यक है!",
|
||||
"arrayTooShort":"इस सरणी की लंबाई कम से कम {0} होनी चाहिए!",
|
||||
"arrayTooLong":"इस सरणी की लंबाई अधिकतम {0} होनी चाहिए!",
|
||||
"arrayLengthInvalid":"इस सरणी की लंबाई {0} होनी चाहिए!",
|
||||
"arrayInvalidTypes":"इस सरणी में केवल निम्नलिखित प्रकार हो सकते हैं: {0}!",
|
||||
"arrayDouble":"यह सरणी एक ही मान को दो बार अनुमति नहीं देती है!",
|
||||
|
||||
"discordInvalidId":"यह एक अमान्य कलह {0} आईडी है!",
|
||||
"discordInvalidIdOptions":"यह एक अमान्य कलह {0} आईडी है! ",
|
||||
"discordInvalidToken":"यह एक अमान्य कलह टोकन है (वाक्यविन्यास की दृष्टि से)!",
|
||||
"colorInvalid":"यह अमान्य हेक्स रंग है!",
|
||||
"emojiTooShort":"इस स्ट्रिंग में कम से कम {0} इमोजी होना आवश्यक है!",
|
||||
"emojiTooLong":"इस स्ट्रिंग में अधिकतम {0} इमोजी होना आवश्यक है!",
|
||||
"emojiCustom":"यह इमोजी कस्टम डिसॉर्डर इमोजी नहीं हो सकता!",
|
||||
"emojiInvalid":"यह एक अमान्य इमोजी है!",
|
||||
"urlInvalid":"यह यूआरएल अमान्य है!",
|
||||
"urlInvalidHttp":"यह यूआरएल केवल https:// प्रोटोकॉल का उपयोग कर सकता है!",
|
||||
"urlInvalidProtocol":"यह यूआरएल केवल http:// और https:// प्रोटोकॉल का उपयोग कर सकता है!",
|
||||
"urlInvalidHostname":"इस यूआरएल में एक अस्वीकृत होस्टनाम है!",
|
||||
"urlInvalidExtension":"इस यूआरएल में एक अमान्य एक्सटेंशन है! ",
|
||||
"urlInvalidPath":"इस यूआरएल में एक अमान्य पथ है!",
|
||||
"idNotUnique":"यह आईडी अद्वितीय नहीं है, इसके बजाय किसी अन्य आईडी का उपयोग करें!",
|
||||
"idNonExistent":"आईडी {0} मौजूद नहीं है!",
|
||||
|
||||
"invalidType":"यह संपत्ति इस प्रकार की होनी चाहिए: {0}!",
|
||||
"propertyMissing":"इस ऑब्जेक्ट में संपत्ति {0} गायब है!",
|
||||
"propertyOptional":"इस ऑब्जेक्ट में संपत्ति {0} वैकल्पिक है!",
|
||||
"objectDisabled":"यह ऑब्जेक्ट अक्षम है, इसे {0} का उपयोग करके सक्षम करें!",
|
||||
"nullInvalid":"यह संपत्ति शून्य नहीं हो सकती!",
|
||||
"switchInvalidType":"इसे निम्न प्रकारों में से एक होना आवश्यक है: {0}!",
|
||||
"objectSwitchInvalid":"यह ऑब्जेक्ट निम्न प्रकारों में से एक होना चाहिए: {0}!",
|
||||
|
||||
"invalidLanguage":"यह एक अमान्य भाषा है!",
|
||||
"invalidButton":"इस बटन पर कम से कम {0} या {1} होना आवश्यक है!",
|
||||
"unusedOption":"विकल्प {0} का उपयोग कहीं भी नहीं किया जाता है!",
|
||||
"unusedQuestion":"प्रश्न {0} का प्रयोग कहीं भी नहीं किया गया है!",
|
||||
"dropdownOption":"ड्रॉपडाउन सक्षम पैनल में केवल 'टिकट' प्रकार के विकल्प हो सकते हैं!"
|
||||
}
|
||||
},
|
||||
"actions":{
|
||||
"buttons":{
|
||||
"create":"विजिट टिकट",
|
||||
"close":"टिकट बंद करें",
|
||||
"delete":"टिकट हटाएँ",
|
||||
"reopen":"टिकट पुनः खोलें",
|
||||
"claim":"टिकट का दावा करें",
|
||||
"unclaim":"लावारिस टिकट",
|
||||
"pin":"टिकट पिन करें",
|
||||
"unpin":"टिकट अनपिन करें",
|
||||
"clear":"टिकट हटाएँ",
|
||||
"helpSwitchSlash":"स्लैश कमांड देखें",
|
||||
"helpSwitchText":"टेक्स्ट कमांड देखें",
|
||||
"helpPage":"पेज {0}",
|
||||
"withReason":"कारण के साथ",
|
||||
"withoutTranscript":"प्रतिलेख के बिना"
|
||||
},
|
||||
"titles":{
|
||||
"created":"टिकट बनाया गया",
|
||||
"close":"टिकट बंद",
|
||||
"delete":"टिकट हटा दिया गया",
|
||||
"reopen":"टिकट पुनः खोला गया",
|
||||
"claim":"टिकट का दावा किया गया",
|
||||
"unclaim":"टिकट लावारिस",
|
||||
"pin":"टिकट पिन किया गया",
|
||||
"unpin":"टिकट अनपिन किया गया",
|
||||
"rename":"टिकट का नाम बदला गया",
|
||||
"move":"टिकट स्थानांतरित",
|
||||
"add":"टिकट उपयोगकर्ता जोड़ा गया",
|
||||
"remove":"टिकट उपयोगकर्ता हटा दिया गया",
|
||||
|
||||
"help":"उपलब्ध आदेश",
|
||||
"statsReset":"आँकड़े रीसेट करें",
|
||||
"blacklistAdd":"उपयोगकर्ता को ब्लैकलिस्ट किया गया",
|
||||
"blacklistRemove":"उपयोगकर्ता जारी किया गया",
|
||||
"blacklistGet":"ब्लैकलिस्टेड उपयोगकर्ता",
|
||||
"blacklistView":"वर्तमान ब्लैकलिस्ट",
|
||||
"blacklistAddDm":"ब्लैकलिस्ट में जोड़ा गया",
|
||||
"blacklistRemoveDm":"काली सूची से हटाया गया",
|
||||
"clear":"टिकट साफ़ हो गए",
|
||||
"roles":"भूमिकाएँ अद्यतन की गईं",
|
||||
|
||||
"autoclose":"टिकट स्वतः बंद",
|
||||
"autocloseEnabled":"स्वत: बंद सक्षम",
|
||||
"autocloseDisabled":"स्वत: बंद अक्षम",
|
||||
"autodelete":"टिकट स्वतः हटा दिया गया",
|
||||
"autodeleteEnabled":"स्वतः हटाना सक्षम",
|
||||
"autodeleteDisabled":"स्वतः हटाना अक्षम"
|
||||
},
|
||||
"descriptions":{
|
||||
"create":"आपका टिकट बन गया है. ",
|
||||
"close":"टिकट सफलतापूर्वक बंद कर दिया गया है!",
|
||||
"delete":"टिकट सफलतापूर्वक हटा दिया गया है!",
|
||||
"reopen":"टिकट सफलतापूर्वक पुनः खोल दिया गया है!",
|
||||
"claim":"टिकट का सफलतापूर्वक दावा किया गया है!",
|
||||
"unclaim":"टिकट सफलतापूर्वक लावारिस हो गया है!",
|
||||
"pin":"टिकट सफलतापूर्वक पिन कर दिया गया है!",
|
||||
"unpin":"टिकट सफलतापूर्वक अनपिन कर दिया गया है!",
|
||||
"rename":"टिकट का नाम बदलकर सफलतापूर्वक {0} कर दिया गया है!",
|
||||
"move":"टिकट को सफलतापूर्वक {0} पर ले जाया गया है!",
|
||||
"add":"{0} को टिकट में सफलतापूर्वक जोड़ दिया गया है!",
|
||||
"remove":"{0} को टिकट से सफलतापूर्वक हटा दिया गया है!",
|
||||
|
||||
"helpExplanation":"`<name>` => आवश्यक पैरामीटर\n",
|
||||
"statsReset":"बॉट आँकड़े सफलतापूर्वक रीसेट कर दिए गए हैं!",
|
||||
"statsError":"टिकट आँकड़े देखने में असमर्थ!\n",
|
||||
"blacklistAdd":"{0} को सफलतापूर्वक काली सूची में डाल दिया गया है!",
|
||||
"blacklistRemove":"{0} सफलतापूर्वक जारी कर दिया गया है!",
|
||||
"blacklistGetSuccess":"{0} वर्तमान में ब्लैकलिस्टेड है!",
|
||||
"blacklistGetEmpty":"{0} वर्तमान में काली सूची में नहीं डाला गया है!",
|
||||
"blacklistViewEmpty":"अभी तक किसी को भी काली सूची में नहीं डाला गया है!",
|
||||
"blacklistViewTip":"किसी उपयोगकर्ता को ब्लैकलिस्ट करने के लिए \"/ब्लैकलिस्ट ऐड\" का उपयोग करें!",
|
||||
"clearVerify":"क्या आप वाकई एकाधिक टिकट हटाना चाहते हैं?\n",
|
||||
"clearReady":"{0} टिकट सफलतापूर्वक हटा दिए गए हैं!",
|
||||
"rolesEmpty":"कोई भूमिका अद्यतन नहीं की गई है!",
|
||||
|
||||
"autocloseLeave":"यह टिकट स्वतः बंद हो गया है क्योंकि निर्माता ने सर्वर छोड़ दिया है!",
|
||||
"autocloseTimeout":"यह टिकट स्वतः बंद कर दिया गया है क्योंकि यह `{0}h` से अधिक समय से निष्क्रिय है!",
|
||||
"autodeleteLeave":"यह टिकट स्वतः हटा दिया गया है क्योंकि निर्माता ने सर्वर छोड़ दिया है!",
|
||||
"autodeleteTimeout":"यह टिकट स्वतः हटा दिया गया है क्योंकि यह `{0} दिनों` से अधिक समय से निष्क्रिय है!",
|
||||
"autocloseEnabled":"इस टिकट में ऑटोक्लोज़ सक्षम कर दिया गया है!\n",
|
||||
"autocloseDisabled":"इस टिकट में ऑटोक्लोज़ अक्षम कर दिया गया है!\n",
|
||||
"autodeleteEnabled":"इस टिकट में ऑटोडिलीट सक्षम कर दिया गया है!\n",
|
||||
"autodeleteDisabled":"इस टिकट में ऑटोडिलीट अक्षम कर दिया गया है!\n",
|
||||
|
||||
"ticketMessageLimit":"आप एक ही समय में केवल {0} टिकट बना सकते हैं!",
|
||||
"ticketMessageAutoclose":"{0}घंटे तक निष्क्रिय रहने पर यह टिकट स्वतः बंद हो जाएगा!",
|
||||
"ticketMessageAutodelete":"{0} दिनों तक निष्क्रिय रहने पर यह टिकट स्वतः हटा दिया जाएगा!",
|
||||
"panelReady":"आप नीचे पैनल पा सकते हैं!\n"
|
||||
},
|
||||
"modal":{
|
||||
"closePlaceholder":"आपने यह टिकट क्यों बंद कर दिया?",
|
||||
"deletePlaceholder":"आपने यह टिकट क्यों हटा दिया?",
|
||||
"reopenPlaceholder":"आपने यह टिकट दोबारा क्यों खोला?",
|
||||
"claimPlaceholder":"आपने इस टिकट के लिए दावा क्यों किया?",
|
||||
"unclaimPlaceholder":"आपने इस टिकट पर दावा क्यों रद्द कर दिया?",
|
||||
"pinPlaceholder":"आपने यह टिकट पिन क्यों किया?",
|
||||
"unpinPlaceholder":"आपने इस टिकट को अनपिन क्यों किया?"
|
||||
},
|
||||
"logs":{
|
||||
"createLog":"{0} द्वारा एक नया टिकट बनाया गया!",
|
||||
"closeLog":"यह टिकट {0} द्वारा बंद कर दिया गया है!",
|
||||
"closeDm":"आपका टिकट हमारे सर्वर में बंद कर दिया गया है!",
|
||||
"deleteLog":"यह टिकट {0} द्वारा हटा दिया गया है!",
|
||||
"deleteDm":"आपका टिकट हमारे सर्वर से हटा दिया गया है!",
|
||||
"reopenLog":"यह टिकट {0} द्वारा पुनः खोल दिया गया है!",
|
||||
"reopenDm":"आपका टिकट हमारे सर्वर में फिर से खोल दिया गया है!",
|
||||
"claimLog":"इस टिकट पर {0} द्वारा दावा किया गया है!",
|
||||
"claimDm":"आपके टिकट का दावा हमारे सर्वर में कर दिया गया है!",
|
||||
"unclaimLog":"यह टिकट {0} द्वारा लावारिस कर दिया गया है!",
|
||||
"unclaimDm":"आपका टिकट हमारे सर्वर में लावारिस हो गया है!",
|
||||
"pinLog":"यह टिकट {0} द्वारा पिन किया गया है!",
|
||||
"pinDm":"आपका टिकट हमारे सर्वर में पिन कर दिया गया है!",
|
||||
"unpinLog":"यह टिकट {0} द्वारा अनपिन कर दिया गया है!",
|
||||
"unpinDm":"आपका टिकट हमारे सर्वर पर अनपिन कर दिया गया है!",
|
||||
"renameLog":"इस टिकट का नाम बदलकर {1} द्वारा {0} कर दिया गया है!",
|
||||
"renameDm":"हमारे सर्वर में आपके टिकट का नाम बदलकर {0} कर दिया गया है!",
|
||||
"moveLog":"इस टिकट को {1} द्वारा {0} में स्थानांतरित कर दिया गया है!",
|
||||
"moveDm":"आपका टिकट हमारे सर्वर में {0} पर स्थानांतरित कर दिया गया है!",
|
||||
"addLog":"इस टिकट में {1} द्वारा {0} जोड़ा गया है!",
|
||||
"addDm":"हमारे सर्वर में आपके टिकट में {0} जोड़ दिया गया है!",
|
||||
"removeLog":"{1} द्वारा इस टिकट से {0} हटा दिया गया है!",
|
||||
"removeDm":"हमारे सर्वर में आपके टिकट से {0} हटा दिया गया है!",
|
||||
|
||||
"blacklistAddLog":"{0} को {1} द्वारा काली सूची में डाल दिया गया था!",
|
||||
"blacklistRemoveLog":"{0} को {1} द्वारा काली सूची से हटा दिया गया था!",
|
||||
"blacklistAddDm":"आपको हमारे सर्वर में काली सूची में डाल दिया गया है!\n",
|
||||
"blacklistRemoveDm":"आपको हमारे सर्वर में ब्लैकलिस्ट से हटा दिया गया है!\n",
|
||||
"clearLog":"{0} टिकटें {1} द्वारा हटा दी गई हैं!"
|
||||
}
|
||||
},
|
||||
"transcripts":{
|
||||
"success":{
|
||||
"visit":"प्रतिलेख पर जाएँ",
|
||||
"ready":"प्रतिलेख बनाया गया",
|
||||
"textFileDescription":"यह हटाए गए टिकट का टेक्स्ट ट्रांसक्रिप्ट है!",
|
||||
"htmlProgress":"कृपया इस HTML प्रतिलेख के संसाधित होने तक प्रतीक्षा करें...",
|
||||
|
||||
"createdChannel":"सर्वर में एक नया {0} ट्रांस्क्रिप्ट बनाया गया है!",
|
||||
"createdCreator":"आपके एक टिकट के लिए एक नया {0} प्रतिलेख बनाया गया है!",
|
||||
"createdParticipant":"आपके द्वारा भाग लिए गए टिकटों में से एक में एक नया {0} प्रतिलेख बनाया गया है!",
|
||||
"createdActiveAdmin":"आपके द्वारा व्यवस्थापक के रूप में भाग लिए गए टिकटों में से एक में एक नया {0} प्रतिलेख बनाया गया है!",
|
||||
"createdEveryAdmin":"जिन टिकटों के आप व्यवस्थापक थे उनमें से एक में एक नया {0} प्रतिलेख बनाया गया है!",
|
||||
"createdOther":"एक नया {0} प्रतिलेख बनाया गया है!"
|
||||
},
|
||||
"errors":{
|
||||
"retry":"पुन: प्रयास करें",
|
||||
"continue":"प्रतिलेख के बिना हटाएँ",
|
||||
"backup":"बैकअप ट्रांस्क्रिप्ट बनाएं",
|
||||
"error":"प्रतिलेख बनाने का प्रयास करते समय कुछ गलत हो गया।\n"
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"titles":{
|
||||
"internalError":"आंतरिक त्रुटि",
|
||||
"optionMissing":"आदेश विकल्प गुम है",
|
||||
"optionInvalid":"आदेश विकल्प अमान्य",
|
||||
"unknownCommand":"अज्ञात आदेश",
|
||||
"noPermissions":"कोई अनुमति नहीं",
|
||||
"unknownTicket":"अज्ञात टिकट",
|
||||
"deprecatedTicket":"अस्वीकृत टिकट",
|
||||
"unknownOption":"अज्ञात विकल्प",
|
||||
"unknownPanel":"अज्ञात पैनल",
|
||||
"notInGuild":"सर्वर में नहीं",
|
||||
"channelRename":"चैनल का नाम बदलने में असमर्थ",
|
||||
"busy":"टिकट व्यस्त है"
|
||||
},
|
||||
"descriptions":{
|
||||
"askForInfo":"अधिक जानकारी के लिए इस बॉट के मालिक से संपर्क करें!",
|
||||
"askForInfoResolve":"यदि कुछ प्रयासों के बाद भी यह समस्या हल नहीं होती है तो इस बॉट के मालिक से संपर्क करें।",
|
||||
"internalError":"किसी आंतरिक त्रुटि के कारण इस {0} का उत्तर देने में विफल!",
|
||||
"optionMissing":"इस आदेश में एक आवश्यक पैरामीटर गुम है!",
|
||||
"optionInvalid":"इस आदेश में एक पैरामीटर अमान्य है!",
|
||||
"optionInvalidChoose":"इनमें से चुनें",
|
||||
"unknownCommand":"अधिक जानकारी के लिए सहायता मेनू पर जाने का प्रयास करें!",
|
||||
"noPermissions":"आपको इस {0} का उपयोग करने की अनुमति नहीं है!",
|
||||
"noPermissionsList":"आवश्यक अनुमतियाँ: (उनमें से एक)",
|
||||
"noPermissionsCooldown":"आपको इस {0} का उपयोग करने की अनुमति नहीं है क्योंकि आपके पास कूलडाउन है!",
|
||||
"noPermissionsBlacklist":"आपको इस {0} का उपयोग करने की अनुमति नहीं है क्योंकि आपको काली सूची में डाल दिया गया है!",
|
||||
"noPermissionsLimitGlobal":"आपको टिकट बनाने की अनुमति नहीं है क्योंकि सर्वर अधिकतम टिकट सीमा तक पहुंच गया है!",
|
||||
"noPermissionsLimitGlobalUser":"आपको टिकट बनाने की अनुमति नहीं है क्योंकि आप अधिकतम टिकट सीमा तक पहुँच गए हैं!",
|
||||
"noPermissionsLimitOption":"आपको टिकट बनाने की अनुमति नहीं है क्योंकि सर्वर इस विकल्प के लिए अधिकतम टिकट सीमा तक पहुंच गया है!",
|
||||
"noPermissionsLimitOptionUser":"आपको टिकट बनाने की अनुमति नहीं है क्योंकि आप इस विकल्प के लिए अधिकतम टिकट सीमा तक पहुँच गए हैं!",
|
||||
"unknownTicket":"वैध टिकट में इस आदेश को दोबारा आज़माएँ!",
|
||||
"deprecatedTicket":"वर्तमान चैनल वैध टिकट नहीं है! ",
|
||||
"notInGuild":"यह {0} डीएम में काम नहीं करता! ",
|
||||
"channelRename":"विवाद की दर सीमा के कारण, वर्तमान में बॉट के लिए चैनल का नाम बदलना असंभव है। ",
|
||||
"channelRenameSource":"इस त्रुटि का स्रोत है: {0}",
|
||||
"busy":"इस {0} का उपयोग करने में असमर्थ!\n"
|
||||
},
|
||||
"optionInvalidReasons":{
|
||||
"stringRegex":"मान पैटर्न से मेल नहीं खाता!",
|
||||
"stringMinLength":"मान कम से कम {0} अक्षर होना चाहिए!",
|
||||
"stringMaxLength":"मान अधिकतम {0} वर्ण होना चाहिए!",
|
||||
"numberInvalid":"अमान्य नंबर!",
|
||||
"numberMin":"संख्या कम से कम {0} होनी चाहिए!",
|
||||
"numberMax":"संख्या अधिकतम {0} होनी चाहिए!",
|
||||
"numberDecimal":"संख्या को दशमलव होने की अनुमति नहीं है!",
|
||||
"numberNegative":"संख्या को ऋणात्मक होने की अनुमति नहीं है!",
|
||||
"numberPositive":"संख्या को धनात्मक होने की अनुमति नहीं है!",
|
||||
"numberZero":"संख्या शून्य होने की अनुमति नहीं है!",
|
||||
"channelNotFound":"चैनल ढूंढने में असमर्थ!",
|
||||
"userNotFound":"उपयोगकर्ता ढूंढने में असमर्थ!",
|
||||
"roleNotFound":"भूमिका ढूँढने में असमर्थ!",
|
||||
"memberNotFound":"उपयोगकर्ता ढूंढने में असमर्थ!",
|
||||
"mentionableNotFound":"उपयोगकर्ता या भूमिका ढूंढने में असमर्थ!",
|
||||
"channelType":"अमान्य चैनल प्रकार!",
|
||||
"notInGuild":"इस विकल्प के लिए आपका सर्वर में होना आवश्यक है!"
|
||||
},
|
||||
"permissions":{
|
||||
"developer":"आपको बॉट का डेवलपर बनना होगा.",
|
||||
"owner":"आपको सर्वर स्वामी होना आवश्यक है.",
|
||||
"admin":"आपको एक सर्वर एडमिन बनना होगा.",
|
||||
"moderator":"आपको एक मॉडरेटर बनना होगा.",
|
||||
"support":"आपको सहायता टीम में रहना होगा.",
|
||||
"member":"आपको सदस्य बनना होगा.",
|
||||
"discord-administrator":"आपके पास `प्रशासक` की अनुमति होनी चाहिए।"
|
||||
},
|
||||
"actionInvalid":{
|
||||
"close":"टिकट पहले ही बंद हो चुका है!",
|
||||
"reopen":"टिकट अभी बंद नहीं हुआ है!",
|
||||
"claim":"टिकट का दावा पहले ही हो चुका है!",
|
||||
"unclaim":"अभी तक टिकट का दावा नहीं किया गया है!",
|
||||
"pin":"टिकट पहले ही पिन हो चुका है!",
|
||||
"unpin":"टिकट अभी तक पिन नहीं किया गया है!",
|
||||
"add":"यह उपयोगकर्ता पहले से ही टिकट तक पहुंचने में सक्षम है!",
|
||||
"remove":"इस उपयोगकर्ता को टिकट से हटाने में असमर्थ!"
|
||||
}
|
||||
},
|
||||
"params":{
|
||||
"uppercase":{
|
||||
"ticket":"टिकट",
|
||||
"tickets":"टिकट",
|
||||
"reason":"कारण",
|
||||
"creator":"निर्माता",
|
||||
"remaining":"शेष समय",
|
||||
"added":"जोड़ा",
|
||||
"removed":"निकाला गया",
|
||||
"filter":"फ़िल्टर",
|
||||
"claimedBy":"{0} द्वारा दावा किया गया",
|
||||
"method":"तरीका",
|
||||
"type":"प्रकार",
|
||||
"blacklisted":"ब्लैक लिस्ट किया",
|
||||
"panel":"पैनल",
|
||||
"command":"आज्ञा",
|
||||
"system":"प्रणाली",
|
||||
"true":"सत्य",
|
||||
"false":"असत्य",
|
||||
"syntax":"सिंटेक्स",
|
||||
"originalName":"मूल नाम",
|
||||
"newName":"नया नाम",
|
||||
"until":"जब तक",
|
||||
"validOptions":"वैध विकल्प",
|
||||
"validPanels":"वैध पैनल",
|
||||
"autoclose":"स्वतः",
|
||||
"autodelete":"स्वतः हटाएं",
|
||||
"startupDate":"अद्यतनीकरण शुरू करें",
|
||||
"version":"संस्करण",
|
||||
"name":"नाम",
|
||||
"role":"भूमिका",
|
||||
"status":"स्थिति",
|
||||
"claimed":"दावा किया",
|
||||
"pinned":"पिन की गई",
|
||||
"creationDate":"निर्माण तिथि"
|
||||
},
|
||||
"lowercase":{
|
||||
"text":"मूलपाठ",
|
||||
"html":"एचटीएमएल",
|
||||
"command":"आज्ञा",
|
||||
"modal":"मॉडल",
|
||||
"button":"बटन",
|
||||
"dropdown":"ड्रॉप डाउन",
|
||||
"method":"तरीका"
|
||||
}
|
||||
},
|
||||
"commands":{
|
||||
"reason":"एक वैकल्पिक कारण निर्दिष्ट करें जो लॉग में दिखाई देगा।",
|
||||
"help":"सभी उपलब्ध आदेशों की सूची प्राप्त करें.",
|
||||
"panel":"ड्रॉपडाउन या बटन (टिकट निर्माण के लिए) के साथ एक संदेश भेजें।",
|
||||
"panelId":"उस पैनल का पहचानकर्ता जिसे आप स्पॉन करना चाहते हैं.",
|
||||
"panelAutoUpdate":"क्या आप चाहते हैं कि संपादित होने पर यह पैनल स्वचालित रूप से अपडेट हो जाए?",
|
||||
"ticket":"तुरंत टिकट बनाएं.",
|
||||
"ticketId":"उस टिकट का पहचानकर्ता जिसे आप बनाना चाहते हैं.",
|
||||
"close":"एक टिकट बंद करें.",
|
||||
"delete":"एक टिकट हटाएँ.",
|
||||
"deleteNoTranscript":"प्रतिलेख बनाए बिना इस टिकट को हटा दें।",
|
||||
"reopen":"टिकट दोबारा खोलें.",
|
||||
"claim":"टिकट का दावा करें.",
|
||||
"claimUser":"इस टिकट का दावा अपने बजाय किसी और के लिए करें।",
|
||||
"unclaim":"टिकट का दावा रद्द करें.",
|
||||
"pin":"टिकट पिन करें.",
|
||||
"unpin":"टिकट अनपिन करें.",
|
||||
"move":"एक टिकट ले जाएँ.",
|
||||
"moveId":"उस विकल्प का पहचानकर्ता जिस पर आप जाना चाहते हैं.",
|
||||
"rename":"टिकट का नाम बदलें.",
|
||||
"renameName":"इस टिकट का नया नाम.",
|
||||
"add":"किसी उपयोगकर्ता को टिकट में जोड़ें.",
|
||||
"addUser":"उपयोगकर्ता को जोड़ना है.",
|
||||
"remove":"किसी उपयोगकर्ता को टिकट से हटाएँ.",
|
||||
"removeUser":"उपयोगकर्ता को हटाना है.",
|
||||
"blacklist":"टिकट ब्लैकलिस्ट प्रबंधित करें.",
|
||||
"blacklistView":"वर्तमान ब्लैकलिस्ट की सूची देखें.",
|
||||
"blacklistAdd":"किसी उपयोगकर्ता को काली सूची में जोड़ें.",
|
||||
"blacklistRemove":"किसी उपयोगकर्ता को काली सूची से हटाएँ.",
|
||||
"blacklistGet":"ब्लैकलिस्टेड उपयोगकर्ता से विवरण प्राप्त करें।",
|
||||
"blacklistGetUser":"जिस उपयोगकर्ता से विवरण प्राप्त करना है.",
|
||||
"stats":"बॉट, सदस्य या टिकट से आँकड़े देखें।",
|
||||
"statsReset":"बॉट के सभी आँकड़े रीसेट करें (और शून्य से गिनती शुरू करें)।",
|
||||
"statsGlobal":"वैश्विक आँकड़े देखें.",
|
||||
"statsUser":"सर्वर में किसी उपयोगकर्ता के आँकड़े देखें।",
|
||||
"statsUserUser":"देखने के लिए उपयोगकर्ता.",
|
||||
"statsTicket":"सर्वर में टिकट के आँकड़े देखें।",
|
||||
"statsTicketTicket":"देखने के लिए टिकट.",
|
||||
"clear":"एक ही समय में एकाधिक टिकट हटाएँ।",
|
||||
"clearFilter":"टिकट साफ़ करने के लिए फ़िल्टर.",
|
||||
"clearFilters":{
|
||||
"all":"सभी",
|
||||
"open":"खुला",
|
||||
"close":"बंद किया हुआ",
|
||||
"claim":"दावा किया",
|
||||
"unclaim":"लावारिस",
|
||||
"pin":"पिन की गई",
|
||||
"unpin":"अनपिन किया गया",
|
||||
"autoclose":"स्वतः बंद"
|
||||
},
|
||||
"autoclose":"किसी टिकट में ऑटोक्लोज़ प्रबंधित करें.",
|
||||
"autocloseDisable":"इस टिकट में ऑटोक्लोज़ अक्षम करें.",
|
||||
"autocloseEnable":"इस टिकट में ऑटोक्लोज़ सक्षम करें।",
|
||||
"autocloseEnableTime":"इस टिकट को बंद करने के लिए कितने घंटे निष्क्रिय रहने की आवश्यकता है।",
|
||||
"autodelete":"किसी टिकट में स्वत: हटाना प्रबंधित करें.",
|
||||
"autodeleteDisable":"इस टिकट में ऑटोडिलीट अक्षम करें।",
|
||||
"autodeleteEnable":"इस टिकट में ऑटोडिलीट सक्षम करें।",
|
||||
"autodeleteEnableTime":"इस टिकट को हटाने के लिए उतने दिनों की संख्या निष्क्रिय होनी चाहिए।"
|
||||
},
|
||||
"helpMenu":{
|
||||
"help":"सभी उपलब्ध आदेशों की सूची प्राप्त करें.",
|
||||
"ticket":"तुरंत टिकट बनाएं.",
|
||||
"close":"टिकट बंद करें, इससे इस चैनल में लिखना अक्षम हो जाएगा।",
|
||||
"delete":"टिकट हटाएं, सक्षम होने पर यह एक प्रतिलेख बनाता है।",
|
||||
"reopen":"टिकट दोबारा खोलें, इससे इस चैनल में फिर से लिखना संभव हो जाएगा।",
|
||||
"pin":"टिकट पिन करें. ",
|
||||
"unpin":"टिकट अनपिन करें. ",
|
||||
"move":"एक टिकट ले जाएँ. ",
|
||||
"rename":"टिकट का नाम बदलें. ",
|
||||
"claim":"टिकट का दावा करें. ",
|
||||
"unclaim":"टिकट का दावा रद्द करें. ",
|
||||
"add":"किसी उपयोगकर्ता को टिकट में जोड़ें. ",
|
||||
"remove":"किसी उपयोगकर्ता को टिकट से हटाएँ. ",
|
||||
"panel":"ड्रॉपडाउन या बटन (टिकट निर्माण के लिए) के साथ एक संदेश भेजें।",
|
||||
"blacklistView":"वर्तमान ब्लैकलिस्ट की सूची देखें.",
|
||||
"blacklistAdd":"किसी उपयोगकर्ता को काली सूची में जोड़ें.",
|
||||
"blacklistRemove":"किसी उपयोगकर्ता को काली सूची से हटाएँ.",
|
||||
"blacklistGet":"ब्लैकलिस्टेड उपयोगकर्ता से विवरण प्राप्त करें।",
|
||||
"statsGlobal":"वैश्विक आँकड़े देखें.",
|
||||
"statsTicket":"सर्वर में टिकट के आँकड़े देखें।",
|
||||
"statsUser":"सर्वर में किसी उपयोगकर्ता के आँकड़े देखें।",
|
||||
"statsReset":"बॉट के सभी आँकड़े रीसेट करें (और शून्य से गिनती शुरू करें)।",
|
||||
"autocloseDisable":"इस टिकट में ऑटोक्लोज़ अक्षम करें.",
|
||||
"autocloseEnable":"इस टिकट में ऑटोक्लोज़ सक्षम करें।",
|
||||
"autodeleteDisable":"इस टिकट में ऑटोडिलीट अक्षम करें।",
|
||||
"autodeleteEnable":"इस टिकट में ऑटोडिलीट सक्षम करें।"
|
||||
},
|
||||
"stats":{
|
||||
"scopes":{
|
||||
"global":"वैश्विक आँकड़े",
|
||||
"system":"सिस्टम आँकड़े",
|
||||
"user":"उपयोगकर्ता आँकड़े",
|
||||
"ticket":"टिकट आँकड़े",
|
||||
"participants":"प्रतिभागियों"
|
||||
},
|
||||
"properties":{
|
||||
"ticketsCreated":"टिकट बनाये गये",
|
||||
"ticketsClosed":"टिकट बंद",
|
||||
"ticketsDeleted":"टिकटें हटा दी गईं",
|
||||
"ticketsReopened":"टिकट पुनः खोले गए",
|
||||
"ticketsAutoclosed":"टिकट स्वतः बंद",
|
||||
"ticketsClaimed":"टिकट का दावा किया गया",
|
||||
"ticketsPinned":"टिकट पिन किये गये",
|
||||
"ticketsMoved":"टिकट ले जाया गया",
|
||||
"usersBlacklisted":"उपयोगकर्ता ब्लैकलिस्टेड",
|
||||
"transcriptsCreated":"प्रतिलिपियाँ बनाई गईं"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
{
|
||||
"_TRANSLATION":{
|
||||
"otversion":"v4.0.0",
|
||||
"translators":["TsgIndrius"],
|
||||
"lastedited":"26/01/2025",
|
||||
"language":"Lithuanian",
|
||||
"automated":false
|
||||
},
|
||||
"checker":{
|
||||
"system":{
|
||||
"typeError":"[KLAIDA]",
|
||||
"headerOpenTicket":"Atidaryti Bilietą",
|
||||
"typeWarning":"[Įspėjimas]",
|
||||
"typeInfo":"[INFORMACIJA]",
|
||||
"headerConfigChecker":"KONFIGŪROS PATIKRINIMAS",
|
||||
"headerDescription":"pažiūrėk klaidą savo konfigūracijos faile!",
|
||||
"footerError":"Bot'as negali pastartuoti kol visi {0}' nebus sutvarkyti!",
|
||||
"footerWarning":"Rekomenduojama sutvarkyti visus {0}' prieš paleidžiant bot'a!",
|
||||
"footerSupport":"PAGALBA: {0} - DOCS: {1}",
|
||||
"compactInformation":"NAUDOK {0} DĖL IŠSAMESNĖS INFORMACIJOS!",
|
||||
"dataPath":"path",
|
||||
"dataDocs":"docs",
|
||||
"dataMessages":"pranešimas"
|
||||
},
|
||||
"messages":{
|
||||
"stringTooShort":"Ši eilutė negali būti trumpesnė nei {0} raidžių!",
|
||||
"stringTooLong":"Ši eilutė negali būti ilgesnė nei {0} raidžių!",
|
||||
"stringLengthInvalid":"Šita eilutė turi būti ilgesnė negu {0} raidžių ilgio!",
|
||||
"stringStartsWith":"Šita eilutė turi prasidėti su {0}!",
|
||||
"stringEndsWith":"Ši eilutė turi baigtis su {0}!",
|
||||
"stringContains":"Šita eilutė turi turėti {0}!",
|
||||
"stringChoices":"Ši eilutė gali būti tik viena iš šių pasirinkimų: {0}!",
|
||||
"stringRegex":"Šita eilutė nėra teisinga!",
|
||||
|
||||
"numberTooShort":"Šis skaičius negali būti trumpesnis nei {0} raidžių!",
|
||||
"numberTooLong":"Šis skaičius negali būti ilgesnis nei {0} raidžių!",
|
||||
"numberLengthInvalid":"Šis skaičius turi būti {0} raidžių ilgio!",
|
||||
"numberTooSmall":"Šis skaičius turi būti bent {0}!",
|
||||
"numberTooLarge":"Šis skaičius turi būti ne daugiau negu {0}!",
|
||||
"numberNotEqual":"Šis skaičius turi būti {0}!",
|
||||
"numberStep":"Šis skaičius turi būti kartotinis {0}!",
|
||||
"numberStepOffset":"Šis skaičius turi būti kartotinis {0} pradedant nuo {1}!",
|
||||
"numberStartsWith":"Šitas skaičius turi pradėti nuo {0}!",
|
||||
"numberEndsWith":"Šitas numeris turi baigtis su {0}!",
|
||||
"numberContains":"Šitas skaičius turi turėti {0}!",
|
||||
"numberChoices":"Šitas skaičius gali būti tik vienas iš šių pasirinkimų: {0}!",
|
||||
"numberFloat":"Šis skaičius negali būti dešimtainis!",
|
||||
"numberNegative":"Šitas numeris negali būti neigiamas!",
|
||||
"numberPositive":"Šitas numeris negali būti teigiamas!",
|
||||
"numberZero":"Šitas numeris negali būti nulinis!",
|
||||
|
||||
"booleanTrue":"Šis boolean negali būti tiesa!",
|
||||
"booleanFalse":"Šis boolean negali būti neteisingas!",
|
||||
|
||||
"arrayEmptyDisabled":"Šis array negali būti tuščias!",
|
||||
"arrayEmptyRequired":"Šis array turi būti tuščias!",
|
||||
"arrayTooShort":"Šis array turi būti bent ilgesnis negu {0}!",
|
||||
"arrayTooLong":"Šitas array turi būti trumpesnis negu {0}!",
|
||||
"arrayLengthInvalid":"Šio array ilgis turi būti {0}!",
|
||||
"arrayInvalidTypes":"Šiame array gali būti tik šie tipai: {0}!",
|
||||
"arrayDouble":"Šis array neleidžia tureti tos pačios reikšmės du kartus!",
|
||||
|
||||
"discordInvalidId":"Šitas neteisingas discord'o {0} ID!",
|
||||
"discordInvalidIdOptions":"Tai neteisingas discord {0} ID! Taip pat galite naudoti vieną iš šių: {1}!",
|
||||
"discordInvalidToken":"Šitas Token yra neteisingas prašyčiau idėti teisinga Token!",
|
||||
"colorInvalid":"Tai netinkama šešioliktainė spalva!",
|
||||
"emojiTooShort":"Ši eilutė turi turėti bent {0} jaustukų!",
|
||||
"emojiTooLong":"Šią eilutę reikia turėti maziau negu {0} jaustukų!",
|
||||
"emojiCustom":"Šitas jaustukas negali būti nuosavas!",
|
||||
"emojiInvalid":"Šitas jaustukas netinkamas!",
|
||||
"urlInvalid":"Šitas linkas neveikiantis!",
|
||||
"urlInvalidHttp":"Šitas linkas turi naudoti https:// protocol!",
|
||||
"urlInvalidProtocol":"Šitas linkas turi naudoti http:// & https:// protocols!",
|
||||
"urlInvalidHostname":"Šio linko serverio pavadinimas neleidžiamas!",
|
||||
"urlInvalidExtension":"Šiame URL yra netinkamas plėtinys! Pasirinkite tarp: {0}!",
|
||||
"urlInvalidPath":"Šiame URL yra netinkamas kelias!",
|
||||
"idNotUnique":"Šis ID nėra unikalus, naudokite kitą ID!",
|
||||
"idNonExistent":"Šitas ID {0} neegzistuoja!",
|
||||
|
||||
"invalidType":"Šios valdos turi būti tipas: {0}!",
|
||||
"propertyMissing":"Ši valda {0} šio objekto trūksta!",
|
||||
"propertyOptional":"Ši valda {0} yra neprivalomas šiame objekte!",
|
||||
"objectDisabled":"Šis objektas išjungtas, ijunkite jį naudodami {0}!",
|
||||
"nullInvalid":"Ši valda negali būti niekinė!",
|
||||
"switchInvalidType":"Tai turi būti vienas iš toliau nurodytų tipų: {0}!",
|
||||
"objectSwitchInvalid":"Šis objektas turi būti vieno iš šių tipų: {0}!",
|
||||
|
||||
"invalidLanguage":"Neiteisinga Kalba!",
|
||||
"invalidButton":"Šis mygtukas turi turėti bent {0} arba {1}!",
|
||||
"unusedOption":"Šis pasirinkimas {0} nėra naudojamas!",
|
||||
"unusedQuestion":"Klausimas {0} nėra naudojamas niekur!",
|
||||
"dropdownOption":"Pasirinkimas su įjungtu išskleidžiamuoju meniu gali būti tik „bilieto“ tipo parinktys!"
|
||||
}
|
||||
},
|
||||
"actions":{
|
||||
"buttons":{
|
||||
"create":"Aplankykite Bilietą",
|
||||
"close":"Uždarykite Bilieta",
|
||||
"delete":"Ištrinti Bilieta",
|
||||
"reopen":"Atnaujinti Bilieta",
|
||||
"claim":"Claim Bilieta",
|
||||
"unclaim":"Unclaim Bilieta",
|
||||
"pin":"Prisegti Bilieta",
|
||||
"unpin":"Atsegti Bilieta",
|
||||
"clear":"Ištrinti Bilieta",
|
||||
"helpSwitchSlash":"Pamatyti Slash Komandas",
|
||||
"helpSwitchText":"Peržiūrėti Teksto Komandas ",
|
||||
"helpPage":"Puslapis {0}",
|
||||
"withReason":"Su Priežastimi",
|
||||
"withoutTranscript":"Be Išrašo"
|
||||
},
|
||||
"titles":{
|
||||
"created":"Bilietas Sukurtas",
|
||||
"close":"Bilietas Uždarytas",
|
||||
"delete":"Bilietas Ištrintas",
|
||||
"reopen":"Bilietas Atnaujintas",
|
||||
"claim":"Bilietas Claimed",
|
||||
"unclaim":"Bilietas Unclaimed",
|
||||
"pin":"Bilietas Prisegtas",
|
||||
"unpin":"Bilietas Atsegtas",
|
||||
"rename":"Bilietas Pervadytas",
|
||||
"move":"Bilietas Perkeltas",
|
||||
"add":"Bilieto Naudotojas Pridėtas",
|
||||
"remove":"Bilieto Naudotojas Pašalintas",
|
||||
|
||||
"help":"Galimi Komandos",
|
||||
"statsReset":"Atkurti Statusa",
|
||||
"blacklistAdd":"Naudotojas Užblokuotas",
|
||||
"blacklistRemove":"Naudotojas Atblokuotas",
|
||||
"blacklistGet":"Naudotojas Užblokuotas",
|
||||
"blacklistView":"Dabartinis Užblokavimai",
|
||||
"blacklistAddDm":"Žmogus buvo užblokuotas",
|
||||
"blacklistRemoveDm":"Pašalino užblokavima",
|
||||
"clear":"Bilietai išvalyti",
|
||||
"roles":"Roles Atnaujinti",
|
||||
|
||||
"autoclose":"Bilietas automatiškai uždarytas",
|
||||
"autocloseEnabled":"Automatinis uždarymas įjungtas",
|
||||
"autocloseDisabled":"Automatinis uždarymas išjungtas",
|
||||
"autodelete":"Bilietas automatiškai ištrintas",
|
||||
"autodeleteEnabled":"Bilieto automatinis ištrynimas įjungtas",
|
||||
"autodeleteDisabled":"Bilieto automatinis ištrynimas išjungtas"
|
||||
},
|
||||
"descriptions":{
|
||||
"create":"Jūsų bilietas sukurtas. Spustelėkite toliau esantį mygtuką, kad jį pasiektumėte!",
|
||||
"close":"Bilietas buvo sėkmingai uždarytas!",
|
||||
"delete":"Bilietas buvo sėkmingai ištrintas!",
|
||||
"reopen":"Bilietas buvo sėkmingai atidarytas!",
|
||||
"claim":"Bilietas buvo sėkmingai claimed!",
|
||||
"unclaim":"Bilietas buvo sėkmingai unclaimed!",
|
||||
"pin":"Bilietas buvo sėkmingai prisegtas!",
|
||||
"unpin":"Bilietas buvo sėkmingai atsegtas",
|
||||
"rename":"Bilietas buvo pervadytas į {0} sėkmingai!",
|
||||
"move":"Bilietas buvo perkeltas į {0} sėkmingai!",
|
||||
"add":"{0} buvo pridėtas į bilieta sekmingai!",
|
||||
"remove":"{0} buvo pašalintas iš bilieto sėkmingai!",
|
||||
|
||||
"helpExplanation":"`<pavadinimas>` => reikalingas parametras\n`[pavadinimas]` => pasirenkamas parametras",
|
||||
"statsReset":"Boto statistika buvo sekmingai nustatyti iš naujo!",
|
||||
"statsError":"Negaliu matyti bilieto statistikos!\n{0} nėra bilietas!",
|
||||
"blacklistAdd":"{0} buvo sėkmingai užblokuotas!",
|
||||
"blacklistRemove":"{0} buvo sėkmingai užblokuotas!",
|
||||
"blacklistGetSuccess":"{0} yra užblokuotas!",
|
||||
"blacklistGetEmpty":"{0} nėra užblokuotas!",
|
||||
"blacklistViewEmpty":"Dar niekas nebuvo užblokuotas!",
|
||||
"blacklistViewTip":"Norėdami užblokuoti naudotoja, naudokite \"/blacklist add\".!",
|
||||
"clearVerify":"Ar tikrai norite ištrinti kelis bilietus?\nŠio veiksmo anuliuoti negalima!",
|
||||
"clearReady":"{0} bilietai buvo sėkmingai pašalinti!",
|
||||
"rolesEmpty":"Jokie roles nebuvo atnaujinti!",
|
||||
|
||||
"autocloseLeave":"Šis bilietas buvo automatiškai uždarytas, nes kūrėjas paliko serverį!",
|
||||
"autocloseTimeout":"Šis bilietas buvo automatiškai uždarytas, nes buvo neaktyvus daugiau nei `{0}h`!",
|
||||
"autodeleteLeave":"Šis bilietas buvo automatiškai ištrintas, nes kūrėjas paliko serverį!",
|
||||
"autodeleteTimeout":"Šis bilietas buvo automatiškai ištrintas, nes buvo neaktyvus daugiau nei `{0} dienas`!",
|
||||
"autocloseEnabled":"Šiame biliete įjungtas automatinis uždarymas!\nJis bus uždarytas, kai bus neaktyvus ilgiau nei `{0}h`!",
|
||||
"autocloseDisabled":"Šiame biliete automatinis uždarymas išjungtas!\nJis nebebus automatiškai uždarytas!",
|
||||
"autodeleteEnabled":"Šiame biliete įgalintas automatinis ištrynimas!\nJis bus ištrintas, kai bus neaktyvus ilgiau nei `{0} dienas`!",
|
||||
"autodeleteDisabled":"Automatinis ištrynimas šiame biliete išjungtas!\nJis nebebus automatiškai ištrintas!",
|
||||
|
||||
"ticketMessageLimit":"Tu gali sukurti tik {0} bilietus tuo pačiu metu!",
|
||||
"ticketMessageAutoclose":"Šis bilietas bus automatiškai uždarytas, kai bus neaktyvus {0}h!",
|
||||
"ticketMessageAutodelete":"Šis bilietas bus automatiškai ištrintas, kai neaktyvus {0} dienas!",
|
||||
"panelReady":"Žemiau rasite skydelį!\nŠį pranešimą dabar galima ištrinti!"
|
||||
},
|
||||
"modal":{
|
||||
"closePlaceholder":"Kodėl tu uždarei šį bilieta?",
|
||||
"deletePlaceholder":"Kodėl tu ištrinei šita bilieta?",
|
||||
"reopenPlaceholder":"Kam tu atidarei bilieta?",
|
||||
"claimPlaceholder":"Kam tu claimed šita bilieta?",
|
||||
"unclaimPlaceholder":"Kam tu Unclaimed šita bilieta?",
|
||||
"pinPlaceholder":"Kam tu prisegei šita bilieta?",
|
||||
"unpinPlaceholder":"Kam tu atsegei šita bilieta?"
|
||||
},
|
||||
"logs":{
|
||||
"createLog":"Naujas bilietas buvo sukurtas {0}!",
|
||||
"closeLog":"šitas bilietas bus uždarytas už {0}!",
|
||||
"closeDm":"Tavo bilietas buvo uždarytas!",
|
||||
"deleteLog":"Šitas bilietas buvo ištrintas nuo {0}!",
|
||||
"deleteDm":"Jūsų bilietas buvo ištrintas!",
|
||||
"reopenLog":"Šitas bilietas buvo atidarytas nuo {0}!",
|
||||
"reopenDm":"Tavo bilietas buvo atidarytas!",
|
||||
"claimLog":"Šitas bilietas buvo claimed nuo {0}!",
|
||||
"claimDm":"Tavo bilietas buvo claimed!",
|
||||
"unclaimLog":"Bilietas buvo unclaimed nuo {0}!",
|
||||
"unclaimDm":"Tavo bilietas buvo unclaimed!",
|
||||
"pinLog":"This ticket has been pinned by {0}!",
|
||||
"pinDm":"Bilietas buvo prisegtas!",
|
||||
"unpinLog":"Bilietas buvo atsegtas nuo {0}!",
|
||||
"unpinDm":"Tavo bilietas buvo atsegtas!",
|
||||
"renameLog":"Šitas bilietas buvo pervadintas į {0} nuo {1}!",
|
||||
"renameDm":"Tavo bilietas buvo pervadytas į {0}!",
|
||||
"moveLog":"Šitas bilietas buvo perkeltas į {0} nuo {1}!",
|
||||
"moveDm":"Tavo bilietas buvo perkeltas į {0}!",
|
||||
"addLog":"{0} buvo pridėtas į bilieta nuo {1}!",
|
||||
"addDm":"{0} Buvo pridėtas į tavo bilieta!",
|
||||
"removeLog":"{0} buvo pašalintas iš šito bilieto nuo {1}!",
|
||||
"removeDm":"{0} buvo pasalintas iš tavo bilieto!",
|
||||
|
||||
"blacklistAddLog":"{0} buvo užblokuotas nuo {1}!",
|
||||
"blacklistRemoveLog":"{0} buvo atblokuotas nuo {1}!",
|
||||
"blacklistAddDm":"Jūs buvote užblokuotas!\nNuo šiol negalite sukurti bilieto!",
|
||||
"blacklistRemoveDm":"Jūs buvote pašalinti iš juodojo sąrašo mūsų serveryje!\nDabar vėl galite kurti bilietus!",
|
||||
"clearLog":"{0} bilietai buvo pašalinti nuo {1}!"
|
||||
}
|
||||
},
|
||||
"transcripts":{
|
||||
"success":{
|
||||
"visit":"Peržiūrėti Išrašus",
|
||||
"ready":"Išrašai sukurti",
|
||||
"textFileDescription":"!",
|
||||
"htmlProgress":"Palaukite, kol šis html išrašas bus apdorojamas...",
|
||||
|
||||
"createdChannel":"Naujas {0} išrašas buvo sukurtas!",
|
||||
"createdCreator":"Naujas {0} vieno iš jūsų bilietų išrašas sukurtas!",
|
||||
"createdParticipant":"Naujas {0} išrašas buvo sukurta viename iš bilietų, kuriuose dalyvavote!",
|
||||
"createdActiveAdmin":"Naujas {0} išrašas buvo sukurta viename iš bilietų, kuriuose dalyvavote kaip administratorius!",
|
||||
"createdEveryAdmin":"Naujas {0} išrašas buvo sukurta viename iš bilietų, kuriuose buvote administratorius!",
|
||||
"createdOther":"Naujas {0} išrašas buvo sukurtas!"
|
||||
},
|
||||
"errors":{
|
||||
"retry":"Bandyk Iš naujo",
|
||||
"continue":"Ištrinti be išrašo",
|
||||
"backup":"Sukurti Atsarginį išraša",
|
||||
"error":"Kažkas nepavyko bandant sukurti išraša.\nKą norėtumėte daryti?\n\nŠis bilietas nebus ištrintas, kol spustelėsite vieną iš šių mygtukų."
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"titles":{
|
||||
"internalError":"Vidinė klaida",
|
||||
"optionMissing":"Trūksta komandos parinkties",
|
||||
"optionInvalid":"Netinkama komandos parinktis",
|
||||
"unknownCommand":"Nepažystama komanda",
|
||||
"noPermissions":"Jokių leidimų",
|
||||
"unknownTicket":"Nepažystamas bilietas",
|
||||
"deprecatedTicket":"Nebenaudojamas bilietas",
|
||||
"unknownOption":"Nepažystamas pasirinkimas",
|
||||
"unknownPanel":"Nepažystama skydelis",
|
||||
"notInGuild":"Nera serveryje",
|
||||
"channelRename":"Negaliu pervadyti kanalo",
|
||||
"busy":"Bilietas yra užimtas"
|
||||
},
|
||||
"descriptions":{
|
||||
"askForInfo":"Susisiek su savininku šito bilieto del daigiau informacijos!",
|
||||
"askForInfoResolve":"Susisiekite su šio bot'o savininku, jei ši problema neišsprendžiama po kelių bandymų.",
|
||||
"internalError":"Nepavyko atsakyti į šį {0} dėl vidinės klaidos!",
|
||||
"optionMissing":"Šioje komandoje trūksta būtino parametro!",
|
||||
"optionInvalid":"Šios komandos parametras neteisingas!",
|
||||
"optionInvalidChoose":"Pasirink tarp",
|
||||
"unknownCommand":"Norėdami gauti daugiau informacijos, pabandykite apsilankyti pagalbos meniu!",
|
||||
"noPermissions":"Jums neleidžiama to naudoti {0}!",
|
||||
"noPermissionsList":"Reikalingas Leidimas: (vienas iš jų)",
|
||||
"noPermissionsCooldown":"Jums neleidžiama naudoti šio {0}, nes reikia atvėsti!",
|
||||
"noPermissionsBlacklist":"Jums neleidžiama naudoti šio {0}, nes buvote užblokuotas!",
|
||||
"noPermissionsLimitGlobal":"Jums neleidžiama kurti bilieto, nes serveris pasiekė maksimalų bilietų limitą!",
|
||||
"noPermissionsLimitGlobalUser":"Jums neleidžiama kurti bilieto, nes pasiekėte maksimalų bilietų limitą!",
|
||||
"noPermissionsLimitOption":"Jums neleidžiama kurti bilieto, nes serveris pasiekė maksimalų šios parinkties bilietų limitą!",
|
||||
"noPermissionsLimitOptionUser":"Jums neleidžiama kurti bilieto, nes pasiekėte maksimalų šios parinkties bilietų limitą!",
|
||||
"unknownTicket":"Išbandykite šią komandą dar kartą naudodami galiojantį bilietą!",
|
||||
"deprecatedTicket":"Dabartinis kanalas negalioja! Tai galėjo būti bilietas iš senos Open Ticket versijos!",
|
||||
"notInGuild":"Šis {0} neveikia DM! Bandykite dar kartą serveryje!",
|
||||
"channelRename":"Dėl discord'o greičio apribojimų, šiuo metu robotas negali pervardyti kanalo. Kanalas bus automatiškai pervardytas per 10 minučių, jei robotas nebus paleistas iš naujo.",
|
||||
"channelRenameSource":"Šios klaidos šaltinis yra: {0}",
|
||||
"busy":"Neįmanoma naudoti šio {0}!\nBilietą šiuo metu apdoroja botas.\n\nBandykite dar kartą po kelių sekundžių!"
|
||||
},
|
||||
"optionInvalidReasons":{
|
||||
"stringRegex":"Vertė neatitinka šablono!",
|
||||
"stringMinLength":"Reikšmė turi būti bent {0} simbolių!",
|
||||
"stringMaxLength":"Reikšmę turi sudaryti daugiausia {0} simboliai!",
|
||||
"numberInvalid":"Neteisingas numeris!",
|
||||
"numberMin":"Skaičius turi būti bent {0}!",
|
||||
"numberMax":"Skaičius turi būti didžiausias {0}!",
|
||||
"numberDecimal":"Skaičius negali būti dešimtainis!",
|
||||
"numberNegative":"Skaičius negali būti neigiamas!",
|
||||
"numberPositive":"Skaičius negali būti teigiamas!",
|
||||
"numberZero":"Skaičius negali būti nulis!",
|
||||
"channelNotFound":"Negaliu surasti kanalo!",
|
||||
"userNotFound":"Negaliu surasti naudotojo!",
|
||||
"roleNotFound":"Negaliu surasti rolės!",
|
||||
"memberNotFound":"negaliu surasti naudotojo!",
|
||||
"mentionableNotFound":"negaliu surasti naudotojo arba rolės!",
|
||||
"channelType":"Neteisingas kanalo tipas!",
|
||||
"notInGuild":"Ši parinktis reikalauja, kad būtumėte serveryje!"
|
||||
},
|
||||
"permissions":{
|
||||
"developer":"Tu turi būti developeris šito boto.",
|
||||
"owner":"Tu turi būti serverio savininkas.",
|
||||
"admin":"Tu turi būti serverio administratorius.",
|
||||
"moderator":"Tu turi būt serverio moderatorius.",
|
||||
"support":"Tu turi būti prižiūrėtojas.",
|
||||
"member":"Tu turi būti narys.",
|
||||
"discord-administrator":"Tu turi turėti `ADMINISTRATOR` leidima."
|
||||
},
|
||||
"actionInvalid":{
|
||||
"close":"Bilietas yra jau uždarytas!",
|
||||
"reopen":"Bilietas nėra uždarytas!",
|
||||
"claim":"Bilietas jau yra claimed!",
|
||||
"unclaim":"Bilietas nera claimed!",
|
||||
"pin":"Bilietas jau yra prisegtas!",
|
||||
"unpin":"Bilietas nėra prisegtas!",
|
||||
"add":"Šitas naudotojas jau gali matyti šita bilieta!",
|
||||
"remove":"Negaliu pašalinti naudotojo iš bilieto!"
|
||||
}
|
||||
},
|
||||
"params":{
|
||||
"uppercase":{
|
||||
"ticket":"Bilietas",
|
||||
"tickets":"Bilietao",
|
||||
"reason":"Priežastis",
|
||||
"creator":"Kūrėjas",
|
||||
"remaining":"Liko laiko",
|
||||
"added":"Pridėta",
|
||||
"removed":"Pašalinta",
|
||||
"filter":"Filteris",
|
||||
"claimedBy":"Claimed nuo {0}",
|
||||
"method":"Metodas",
|
||||
"type":"Tipas",
|
||||
"blacklisted":"Užblokuotas",
|
||||
"panel":"Skydelis",
|
||||
"command":"Komanda",
|
||||
"system":"Sistema",
|
||||
"true":"Teisingai",
|
||||
"false":"Klaidingai",
|
||||
"syntax":"Sintaksė",
|
||||
"originalName":"Orginalus Pavadinimas",
|
||||
"newName":"Naujas pavadinimas",
|
||||
"until":"Iki",
|
||||
"validOptions":"Galiojančios parinktys",
|
||||
"validPanels":"Galiojančios Skydeliai",
|
||||
"autoclose":"Automatinis uždarymas",
|
||||
"autodelete":"Automatinis Ištrinimas",
|
||||
"startupDate":"Paleidimo data",
|
||||
"version":"Versija",
|
||||
"name":"Pavadinimas",
|
||||
"role":"Role",
|
||||
"status":"Statusas",
|
||||
"claimed":"Claimed",
|
||||
"pinned":"Prisegta",
|
||||
"creationDate":"Sukūrimo data"
|
||||
},
|
||||
"lowercase":{
|
||||
"text":"tekstas",
|
||||
"html":"html",
|
||||
"command":"komanda",
|
||||
"modal":"modal",
|
||||
"button":"mygtukas",
|
||||
"dropdown":"išskleidžiamas meniu",
|
||||
"method":"metodas"
|
||||
}
|
||||
},
|
||||
"commands":{
|
||||
"reason":"Nurodykite pasirenkamą priežastį, kuri bus matoma veiksmo žurnaluose.",
|
||||
"help":"Gaukite visų galimų komandų sąrašą.",
|
||||
"panel":"Pateikite pranešimą išskleidžiamuoju meniu arba mygtukais (bilietui sukurti).",
|
||||
"panelId":"Skydelio, kurį norite sukurti, identifikatorius.",
|
||||
"panelAutoUpdate":"Ar norite, kad šis skydelis būtų automatiškai atnaujintas redaguojant?",
|
||||
"ticket":"Iškart sukurkite bilietą.",
|
||||
"ticketId":"Bilieto, kurį norite sukurti, identifikatorius.",
|
||||
"close":"Uždaryti bilieta.",
|
||||
"delete":"Ištrinti bilieta.",
|
||||
"deleteNoTranscript":"Ištrinti šita bilieta nesukuriant išrašo.",
|
||||
"reopen":"Atidaryti bilieta.",
|
||||
"claim":"Claim bileta.",
|
||||
"claimUser":"Claim bilieta kažka kita negu save.",
|
||||
"unclaim":"Unclaim bilieta.",
|
||||
"pin":"Prisegti bilieta.",
|
||||
"unpin":"Atsegti bilieta.",
|
||||
"move":"Perkelti bilieta.",
|
||||
"moveId":"Parinkties, į kurią norite pereiti, identifikatorius.",
|
||||
"rename":"Pervadinti bilieta.",
|
||||
"renameName":"Naujas pavadinimas šitam bilietui.",
|
||||
"add":"Pridėk naudotoja prie bilieto.",
|
||||
"addUser":"Asmuo kurį norite pridėti.",
|
||||
"remove":"Pašalinti naudotoja iš bilieto.",
|
||||
"removeUser":"Pašalinti asmuo iš bilieto.",
|
||||
"blacklist":"Tvarkykite bilietų užblokavimo sąrašą.",
|
||||
"blacklistView":"Peržiūrėkite dabartinio užblokavimo sąrašą.",
|
||||
"blacklistAdd":"Pridėk asmenį i užblokuoti saraša.",
|
||||
"blacklistRemove":"Pašalinti asmenį iš užblokuotų sarašo.",
|
||||
"blacklistGet":"Gaukite išsamią informaciją iš naudotojo kuris buvo užblokuotas.",
|
||||
"blacklistGetUser":"Asmuo kurio nori gauti informacija.",
|
||||
"stats":"Peržiūrėkite boto, nario ar bilieto statistiką.",
|
||||
"statsReset":"Iš naujo nustatykite visą roboto statistiką (ir pradėkite skaičiuoti nuo nulio).",
|
||||
"statsGlobal":"Peržiūrėkite pasaulinę statistiką.",
|
||||
"statsUser":"Peržiūrėkite serverio vartotojo statistiką.",
|
||||
"statsUserUser":"Asmuo kuri norite peržiūrėti.",
|
||||
"statsTicket":"Peržiūrėkite bilieto statistiką serveryje.",
|
||||
"statsTicketTicket":"Pamatyti Bilieta.",
|
||||
"clear":"Ištrinkite kelis bilietus vienu metu.",
|
||||
"clearFilter":"Bilietų išvalymo filtras.",
|
||||
"clearFilters":{
|
||||
"all":"Visus",
|
||||
"open":"Atidarytus",
|
||||
"close":"Uždarytus",
|
||||
"claim":"Claimed",
|
||||
"unclaim":"Unclaimed",
|
||||
"pin":"Prisegtus",
|
||||
"unpin":"Atsegtus",
|
||||
"autoclose":"Automatinius uždarymus"
|
||||
},
|
||||
"autoclose":"Tvarkykite automatinį uždarymą biliete.",
|
||||
"autocloseDisable":"Išjungti automatinį uždarymą šiame biliete.",
|
||||
"autocloseEnable":"Įgalinti automatinį uždarymą šiame biliete.",
|
||||
"autocloseEnableTime":"Norint jį uždaryti, šis bilietas turi būti neaktyvus.",
|
||||
"autodelete":"Tvarkykite automatinį ištrynimą biliete.",
|
||||
"autodeleteDisable":"Išjungti automatinį ištrynimą šiame biliete.",
|
||||
"autodeleteEnable":"Įgalinti automatinį ištrynimą šiame biliete.",
|
||||
"autodeleteEnableTime":"Kiek dienų šis bilietas turi būti neaktyvus, kad jį būtų galima ištrinti."
|
||||
},
|
||||
"helpMenu":{
|
||||
"help":"Gauk saraša galimų komandų.",
|
||||
"ticket":"Iškart atidaryk bilieta.",
|
||||
"close":"Uždarykite bilietą, tai išjungs rašymą šiame kanale.",
|
||||
"delete":"Ištrinkite bilietą. Kai įjungta, sukuriamas nuorašas.",
|
||||
"reopen":"Iš naujo atidarykite bilietą, todėl vėl galėsite rašyti šiame kanale.",
|
||||
"pin":"Prisekite bilietą. Taip bilietas bus perkeltas į viršų ir prie pavadinimo bus pridėta emocija „📌“..",
|
||||
"unpin":"Atsegti bilietą. Bilietas liks savo pozicijoje, bet praras emociją „📌“..",
|
||||
"move":"Perkelkite bilietą. Tai pakeis šio bilieto tipą.",
|
||||
"rename":"Pervardykite bilietą. Tai pakeis šio bilieto kanalo pavadinimą.",
|
||||
"claim":"CLaim bilieto. Taip galite pranešti savo komandai, kad tvarkote šį bilietą.",
|
||||
"unclaim":"Unclaim bilietą. Taip galite pranešti savo komandai, kad šis bilietas vėl netvarkomas.",
|
||||
"add":"Pridėkite vartotoją prie bilieto. Tai leis vartotojui skaityti ir rašyti šiame biliete.",
|
||||
"remove":"Pašalinkite vartotoją iš bilieto. Tai pašalins vartotojo galimybę skaityti ir rašyti šiame biliete.",
|
||||
"panel":"Pateikite pranešimą išskleidžiamuoju meniu arba mygtukais (bilietui sukurti).",
|
||||
"blacklistView":"Peržiūrėkite dabartinio užblokuotų žmonių sąrašą.",
|
||||
"blacklistAdd":"Užblokuok žmogų nuo kurimosi bikieto.",
|
||||
"blacklistRemove":"Pašalinkite vartotoją iš juodojo sąrašo.",
|
||||
"blacklistGet":"Gaukite išsamią informaciją iš naudotojo, įtraukto į juodąjį sąrašą.",
|
||||
"statsGlobal":"Peržiūrėkite pasaulinę statistiką.",
|
||||
"statsTicket":"Peržiūrėkite bilieto statistiką serveryje.",
|
||||
"statsUser":"Peržiūrėkite serverio vartotojo statistiką.",
|
||||
"statsReset":"Iš naujo nustatykite visą roboto statistiką (ir pradėkite skaičiuoti nuo nulio).",
|
||||
"autocloseDisable":"Išjungti automatinį uždarymą šiame biliete.",
|
||||
"autocloseEnable":"Įgalinti automatinį uždarymą šiame biliete.",
|
||||
"autodeleteDisable":"Išjungti automatinį ištrynimą šiame biliete.",
|
||||
"autodeleteEnable":"Įgalinti automatinį ištrynimą šiame biliete."
|
||||
},
|
||||
"stats":{
|
||||
"scopes":{
|
||||
"global":"Globalinė statistika",
|
||||
"system":"Sisteminė statistika",
|
||||
"user":"Naudotojo statistika",
|
||||
"ticket":"Bilieto statistika",
|
||||
"participants":"Dalyviai"
|
||||
},
|
||||
"properties":{
|
||||
"ticketsCreated":"Bilietai Sukurti",
|
||||
"ticketsClosed":"BILIETAI Uždaryti",
|
||||
"ticketsDeleted":"Bilietai Ištrinti",
|
||||
"ticketsReopened":"Bilietai Atnaujinti",
|
||||
"ticketsAutoclosed":"Bilietai uždaryti automatiškai",
|
||||
"ticketsClaimed":"Bilietai Claim",
|
||||
"ticketsPinned":"Bilietai Prisegti",
|
||||
"ticketsMoved":"Bilietai Perkelti",
|
||||
"usersBlacklisted":"Naudojas Užblokuotas",
|
||||
"transcriptsCreated":"Išrašai sukurti"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
{
|
||||
"_TRANSLATION":{
|
||||
"otversion":"v4.0.0",
|
||||
"translators":["DanoGlez"],
|
||||
"lastedited":"28/01/2025",
|
||||
"language":"Polish",
|
||||
"automated":false
|
||||
},
|
||||
"checker":{
|
||||
"system":{
|
||||
"typeError":"[BŁĄD]",
|
||||
"headerOpenTicket":"OTWÓRZ TICKET",
|
||||
"typeWarning":"[OSTRZEŻENIE]",
|
||||
"typeInfo":"[INFO]",
|
||||
"headerConfigChecker":"SPRAWDZANIE KONFIGURACJI",
|
||||
"headerDescription":"sprawdź błędy w swoich plikach konfiguracyjnych!",
|
||||
"footerError":"bot nie uruchomi się, dopóki wszystkie {0} nie zostaną naprawione!",
|
||||
"footerWarning":"zaleca się naprawienie wszystkich {0} przed uruchomieniem!",
|
||||
"footerSupport":"WSPARCIE: {0} - DOKUMENTACJA: {1}",
|
||||
"compactInformation":"użyj {0}, aby uzyskać więcej informacji!",
|
||||
"dataPath":"ścieżka",
|
||||
"dataDocs":"dokumentacja",
|
||||
"dataMessages":"wiadomość"
|
||||
},
|
||||
"messages":{
|
||||
"stringTooShort":"Ten tekst nie może być krótszy niż {0} znaków!",
|
||||
"stringTooLong":"Ten tekst nie może być dłuższy niż {0} znaków!",
|
||||
"stringLengthInvalid":"Ten tekst musi mieć {0} znaków!",
|
||||
"stringStartsWith":"Ten tekst musi zaczynać się od {0}!",
|
||||
"stringEndsWith":"Ten tekst musi kończyć się na {0}!",
|
||||
"stringContains":"Ten tekst musi zawierać {0}!",
|
||||
"stringChoices":"Ten tekst może być tylko jednym z następujących wartości: {0}!",
|
||||
"stringRegex":"Ten tekst jest nieprawidłowy!",
|
||||
|
||||
"numberTooShort":"Ta liczba nie może być krótsza niż {0} znaków!",
|
||||
"numberTooLong":"Ta liczba nie może być dłuższa niż {0} znaków!",
|
||||
"numberLengthInvalid":"Ta liczba musi mieć {0} znaków!",
|
||||
"numberTooSmall":"Ta liczba musi wynosić co najmniej {0}!",
|
||||
"numberTooLarge":"Ta liczba może wynosić maksymalnie {0}!",
|
||||
"numberNotEqual":"Ta liczba musi wynosić {0}!",
|
||||
"numberStep":"Ta liczba musi być wielokrotnością {0}!",
|
||||
"numberStepOffset":"Ta liczba musi być wielokrotnością {0}, zaczynając od {1}!",
|
||||
"numberStartsWith":"Ta liczba musi zaczynać się od {0}!",
|
||||
"numberEndsWith":"Ta liczba musi kończyć się na {0}!",
|
||||
"numberContains":"Ta liczba musi zawierać {0}!",
|
||||
"numberChoices":"Ta liczba może być tylko jedną z następujących wartości: {0}!",
|
||||
"numberFloat":"Ta liczba nie może być dziesiętna!",
|
||||
"numberNegative":"Ta liczba nie może być ujemna!",
|
||||
"numberPositive":"Ta liczba nie może być dodatnia!",
|
||||
"numberZero":"Ta liczba nie może wynosić zero!",
|
||||
|
||||
"booleanTrue":"Ta wartość logiczna nie może być prawdziwa!",
|
||||
"booleanFalse":"Ta wartość logiczna nie może być fałszywa!",
|
||||
|
||||
"arrayEmptyDisabled":"Ta tablica nie może być pusta!",
|
||||
"arrayEmptyRequired":"Ta tablica musi być pusta!",
|
||||
"arrayTooShort":"Ta tablica musi mieć co najmniej {0} elementów!",
|
||||
"arrayTooLong":"Ta tablica może mieć maksymalnie {0} elementów!",
|
||||
"arrayLengthInvalid":"Ta tablica musi mieć {0} elementów!",
|
||||
"arrayInvalidTypes":"Ta tablica może zawierać tylko następujące typy: {0}!",
|
||||
"arrayDouble":"Ta tablica nie może zawierać tych samych wartości dwukrotnie!",
|
||||
|
||||
"discordInvalidId":"To jest nieprawidłowe ID Discorda {0}!",
|
||||
"discordInvalidIdOptions":"To jest nieprawidłowe ID Discorda {0}! Możesz również użyć jednego z tych: {1}!",
|
||||
"discordInvalidToken":"To jest nieprawidłowy token Discorda (składniowo)!",
|
||||
"colorInvalid":"To jest nieprawidłowy kolor w formacie hex!",
|
||||
"emojiTooShort":"Ten tekst musi zawierać co najmniej {0} emoji!",
|
||||
"emojiTooLong":"Ten tekst może zawierać maksymalnie {0} emoji!",
|
||||
"emojiCustom":"To emoji nie może być niestandardowym emoji Discorda!",
|
||||
"emojiInvalid":"To jest nieprawidłowe emoji!",
|
||||
"urlInvalid":"Ten URL jest nieprawidłowy!",
|
||||
"urlInvalidHttp":"Ten URL może korzystać tylko z protokołu https://!",
|
||||
"urlInvalidProtocol":"Ten URL może korzystać tylko z protokołów http:// i https://!",
|
||||
"urlInvalidHostname":"Ten URL ma niedozwoloną nazwę hosta!",
|
||||
"urlInvalidExtension":"Ten URL ma nieprawidłowe rozszerzenie! Wybierz spośród: {0}!",
|
||||
"urlInvalidPath":"Ten URL ma nieprawidłową ścieżkę!",
|
||||
"idNotUnique":"To ID nie jest unikalne, użyj innego ID!",
|
||||
"idNonExistent":"ID {0} nie istnieje!",
|
||||
|
||||
"invalidType":"Ta właściwość musi być typu: {0}!",
|
||||
"propertyMissing":"Właściwość {0} jest wymagana w tym obiekcie!",
|
||||
"propertyOptional":"Właściwość {0} jest opcjonalna w tym obiekcie!",
|
||||
"objectDisabled":"Ten obiekt jest wyłączony, włącz go za pomocą {0}!",
|
||||
"nullInvalid":"Ta właściwość nie może być null!",
|
||||
"switchInvalidType":"To musi być jeden z następujących typów: {0}!",
|
||||
"objectSwitchInvalid":"Ten obiekt musi być jednym z następujących typów: {0}!",
|
||||
|
||||
"invalidLanguage":"To jest nieprawidłowy język!",
|
||||
"invalidButton":"Ten przycisk musi zawierać co najmniej {0} lub {1}!",
|
||||
"unusedOption":"Opcja {0} nie jest nigdzie używana!",
|
||||
"unusedQuestion":"Pytanie {0} nie jest nigdzie używane!",
|
||||
"dropdownOption":"Panel z włączonym rozwijanym menu może zawierać tylko opcje typu 'ticket'!"
|
||||
}
|
||||
},
|
||||
"actions":{
|
||||
"buttons":{
|
||||
"create":"Otwórz Ticket",
|
||||
"close":"Zamknij Ticket",
|
||||
"delete":"Usuń Ticket",
|
||||
"reopen":"Otwórz ponownie Ticket",
|
||||
"claim":"Przejmij Ticket",
|
||||
"unclaim":"Porzuć Ticket",
|
||||
"pin":"Przypnij Ticket",
|
||||
"unpin":"Odepnij Ticket",
|
||||
"clear":"Usuń Tickety",
|
||||
"helpSwitchSlash":"Pokaż Komendy Slash",
|
||||
"helpSwitchText":"Pokaż Komendy Tekstowe",
|
||||
"helpPage":"Strona {0}",
|
||||
"withReason":"Z Powodem",
|
||||
"withoutTranscript":"Bez Transkrypcji"
|
||||
},
|
||||
"titles":{
|
||||
"created":"Ticket Utworzony",
|
||||
"close":"Ticket Zamknięty",
|
||||
"delete":"Ticket Usunięty",
|
||||
"reopen":"Ticket Ponownie Otwarty",
|
||||
"claim":"Ticket Przejety",
|
||||
"unclaim":"Ticket Porzucony",
|
||||
"pin":"Ticket Przypięty",
|
||||
"unpin":"Ticket Odpięty",
|
||||
"rename":"Ticket Przemianowany",
|
||||
"move":"Ticket Przeniesiony",
|
||||
"add":"Użytkownik Dodany do Ticketa",
|
||||
"remove":"Użytkownik Usunięty z Ticketa",
|
||||
|
||||
"help":"Dostępne Komendy",
|
||||
"statsReset":"Statystyki Zresetowane",
|
||||
"blacklistAdd":"Użytkownik Zablokowany",
|
||||
"blacklistRemove":"Użytkownik Odblokowany",
|
||||
"blacklistGet":"Zablokowany Użytkownik",
|
||||
"blacklistView":"Aktualna Lista Zablokowanych",
|
||||
"blacklistAddDm":"Dodano do Listy Zablokowanych",
|
||||
"blacklistRemoveDm":"Usunięto z Listy Zablokowanych",
|
||||
"clear":"Tickety Usunięte",
|
||||
"roles":"Role Zaktualizowane",
|
||||
|
||||
"autoclose":"Ticket Automatycznie Zamknięty",
|
||||
"autocloseEnabled":"Automatyczne Zamknięcie Włączone",
|
||||
"autocloseDisabled":"Automatyczne Zamknięcie Wyłączone",
|
||||
"autodelete":"Ticket Automatycznie Usunięty",
|
||||
"autodeleteEnabled":"Automatyczne Usuwanie Włączone",
|
||||
"autodeleteDisabled":"Automatyczne Usuwanie Wyłączone"
|
||||
},
|
||||
"descriptions":{
|
||||
"create":"Twój ticket został utworzony. Kliknij poniższy przycisk, aby go otworzyć!",
|
||||
"close":"Ticket został pomyślnie zamknięty!",
|
||||
"delete":"Ticket został pomyślnie usunięty!",
|
||||
"reopen":"Ticket został pomyślnie ponownie otwarty!",
|
||||
"claim":"Ticket został pomyślnie przypisany!",
|
||||
"unclaim":"Ticket został pomyślnie odpisany!",
|
||||
"pin":"Ticket został pomyślnie przypięty!",
|
||||
"unpin":"Ticket został pomyślnie odpięty!",
|
||||
"rename":"Ticket został pomyślnie przemianowany na {0}!",
|
||||
"move":"Ticket został pomyślnie przeniesiony do {0}!",
|
||||
"add":"{0} został pomyślnie dodany do ticketa!",
|
||||
"remove":"{0} został pomyślnie usunięty z ticketa!",
|
||||
|
||||
"helpExplanation":"`<name>` => wymagany parametr\n`[name]` => opcjonalny parametr",
|
||||
"statsReset":"Statystyki bota zostały pomyślnie zresetowane!",
|
||||
"statsError":"Nie można wyświetlić statystyk ticketa!\n{0} nie jest ticketem!",
|
||||
"blacklistAdd":"{0} został pomyślnie dodany do czarnej listy!",
|
||||
"blacklistRemove":"{0} został pomyślnie usunięty z czarnej listy!",
|
||||
"blacklistGetSuccess":"{0} jest obecnie na czarnej liście!",
|
||||
"blacklistGetEmpty":"{0} nie znajduje się obecnie na czarnej liście!",
|
||||
"blacklistViewEmpty":"Nikt nie został jeszcze dodany do czarnej listy!",
|
||||
"blacklistViewTip":"Użyj \"/blacklist add\", aby dodać użytkownika do czarnej listy!",
|
||||
"clearVerify":"Czy na pewno chcesz usunąć wiele ticketów?\nTej operacji nie można cofnąć!",
|
||||
"clearReady":"{0} ticketów zostało pomyślnie usuniętych!",
|
||||
"rolesEmpty":"Nie zaktualizowano żadnych ról!",
|
||||
|
||||
"autocloseLeave":"Ten ticket został automatycznie zamknięty, ponieważ jego twórca opuścił serwer!",
|
||||
"autocloseTimeout":"Ten ticket został automatycznie zamknięty z powodu braku aktywności przez więcej niż `{0}h`!",
|
||||
"autodeleteLeave":"Ten ticket został automatycznie usunięty, ponieważ jego twórca opuścił serwer!",
|
||||
"autodeleteTimeout":"Ten ticket został automatycznie usunięty z powodu braku aktywności przez więcej niż `{0} dni`!",
|
||||
"autocloseEnabled":"Autoczynność została włączona w tym tickecie!\nZostanie on zamknięty, jeśli będzie nieaktywny przez więcej niż `{0}h`!",
|
||||
"autocloseDisabled":"Autoczynność została wyłączona w tym tickecie!\nNie będzie on już zamykany automatycznie!",
|
||||
"autodeleteEnabled":"Autousuwanie zostało włączone w tym tickecie!\nZostanie on usunięty, jeśli będzie nieaktywny przez więcej niż `{0} dni`!",
|
||||
"autodeleteDisabled":"Autousuwanie zostało wyłączone w tym tickecie!\nNie będzie on już usuwany automatycznie!",
|
||||
|
||||
"ticketMessageLimit":"Możesz utworzyć maksymalnie {0} ticket(y) jednocześnie!",
|
||||
"ticketMessageAutoclose":"Ten ticket zostanie automatycznie zamknięty, jeśli będzie nieaktywny przez {0}h!",
|
||||
"ticketMessageAutodelete":"Ten ticket zostanie automatycznie usunięty, jeśli będzie nieaktywny przez {0} dni!",
|
||||
"panelReady":"Panel znajduje się poniżej!\nTeraz możesz usunąć tę wiadomość!"
|
||||
},
|
||||
"modal":{
|
||||
"closePlaceholder":"Dlaczego zamknąłeś ten ticket?",
|
||||
"deletePlaceholder":"Dlaczego usunąłeś ten ticket?",
|
||||
"reopenPlaceholder":"Dlaczego ponownie otworzyłeś ten ticket?",
|
||||
"claimPlaceholder":"Dlaczego przypisałeś ten ticket?",
|
||||
"unclaimPlaceholder":"Dlaczego odpisano ten ticket?",
|
||||
"pinPlaceholder":"Dlaczego przypiąłeś ten ticket?",
|
||||
"unpinPlaceholder":"Dlaczego odpiąłeś ten ticket?"
|
||||
},
|
||||
"logs":{
|
||||
"createLog":"Nowy ticket został utworzony przez {0}!",
|
||||
"closeLog":"Ten ticket został zamknięty przez {0}!",
|
||||
"closeDm":"Twój ticket został zamknięty na naszym serwerze!",
|
||||
"deleteLog":"Ten ticket został usunięty przez {0}!",
|
||||
"deleteDm":"Twój ticket został usunięty na naszym serwerze!",
|
||||
"reopenLog":"Ten ticket został ponownie otwarty przez {0}!",
|
||||
"reopenDm":"Twój ticket został ponownie otwarty na naszym serwerze!",
|
||||
"claimLog":"Ten ticket został przypisany przez {0}!",
|
||||
"claimDm":"Twój ticket został przypisany na naszym serwerze!",
|
||||
"unclaimLog":"Ten ticket został odpisany przez {0}!",
|
||||
"unclaimDm":"Twój ticket został odpisany na naszym serwerze!",
|
||||
"pinLog":"Ten ticket został przypięty przez {0}!",
|
||||
"pinDm":"Twój ticket został przypięty na naszym serwerze!",
|
||||
"unpinLog":"Ten ticket został odpięty przez {0}!",
|
||||
"unpinDm":"Twój ticket został odpięty na naszym serwerze!",
|
||||
"renameLog":"Ten ticket został przemianowany na {0} przez {1}!",
|
||||
"renameDm":"Twój ticket został przemianowany na {0} na naszym serwerze!",
|
||||
"moveLog":"Ten ticket został przeniesiony do {0} przez {1}!",
|
||||
"moveDm":"Twój ticket został przeniesiony do {0} na naszym serwerze!",
|
||||
"addLog":"{0} został dodany do tego ticketa przez {1}!",
|
||||
"addDm":"{0} został dodany do twojego ticketa na naszym serwerze!",
|
||||
"removeLog":"{0} został usunięty z tego ticketa przez {1}!",
|
||||
"removeDm":"{0} został usunięty z twojego ticketa na naszym serwerze!",
|
||||
|
||||
"blacklistAddLog":"{0} został dodany do czarnej listy przez {1}!",
|
||||
"blacklistRemoveLog":"{0} został usunięty z czarnej listy przez {1}!",
|
||||
"blacklistAddDm":"Zostałeś dodany do czarnej listy na naszym serwerze!\nOd teraz nie możesz tworzyć ticketów!",
|
||||
"blacklistRemoveDm":"Zostałeś usunięty z czarnej listy na naszym serwerze!\nTeraz możesz ponownie tworzyć tickety!",
|
||||
"clearLog":"{0} ticketów zostało usuniętych przez {1}!"
|
||||
}
|
||||
},
|
||||
"transcripts":{
|
||||
"success":{
|
||||
"visit":"Otwórz transkrypt",
|
||||
"ready":"Transkrypt został utworzony",
|
||||
"textFileDescription":"To jest tekstowy transkrypt usuniętego ticketa!",
|
||||
"htmlProgress":"Proszę czekać, trwa przetwarzanie tego transkryptu w formacie HTML...",
|
||||
|
||||
"createdChannel":"Nowy transkrypt {0} został utworzony na serwerze!",
|
||||
"createdCreator":"Nowy transkrypt {0} został utworzony dla jednego z twoich ticketów!",
|
||||
"createdParticipant":"Nowy transkrypt {0} został utworzony w jednym z ticketów, w których brałeś udział!",
|
||||
"createdActiveAdmin":"Nowy transkrypt {0} został utworzony w jednym z ticketów, w których brałeś udział jako administrator!",
|
||||
"createdEveryAdmin":"Nowy transkrypt {0} został utworzony w jednym z ticketów, w których byłeś administratorem!",
|
||||
"createdOther":"Nowy transkrypt {0} został utworzony!"
|
||||
},
|
||||
"errors":{
|
||||
"retry":"Spróbuj ponownie",
|
||||
"continue":"Usuń bez transkryptu",
|
||||
"backup":"Utwórz kopię zapasową transkryptu",
|
||||
"error":"Coś poszło nie tak podczas próby utworzenia transkryptu.\nCo chciałbyś zrobić?\n\nTen ticket nie zostanie usunięty, dopóki nie klikniesz jednego z tych przycisków."
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"titles":{
|
||||
"internalError":"Błąd wewnętrzny",
|
||||
"optionMissing":"Brakująca opcja polecenia",
|
||||
"optionInvalid":"Nieprawidłowa opcja polecenia",
|
||||
"unknownCommand":"Nieznane polecenie",
|
||||
"noPermissions":"Brak uprawnień",
|
||||
"unknownTicket":"Nieznany ticket",
|
||||
"deprecatedTicket":"Przestarzały ticket",
|
||||
"unknownOption":"Nieznana opcja",
|
||||
"unknownPanel":"Nieznany panel",
|
||||
"notInGuild":"Nie na serwerze",
|
||||
"channelRename":"Nie można zmienić nazwy kanału",
|
||||
"busy":"Ticket jest zajęty"
|
||||
},
|
||||
"descriptions":{
|
||||
"askForInfo":"Skontaktuj się z właścicielem tego bota, aby uzyskać więcej informacji!",
|
||||
"askForInfoResolve":"Skontaktuj się z właścicielem bota, jeśli problem nie rozwiąże się po kilku próbach.",
|
||||
"internalError":"Nie udało się odpowiedzieć na to {0} z powodu błędu wewnętrznego!",
|
||||
"optionMissing":"Brak wymaganego parametru w tym poleceniu!",
|
||||
"optionInvalid":"Parametr w tym poleceniu jest nieprawidłowy!",
|
||||
"optionInvalidChoose":"Wybierz spośród",
|
||||
"unknownCommand":"Spróbuj odwiedzić menu pomocy, aby uzyskać więcej informacji!",
|
||||
"noPermissions":"Nie masz uprawnień do użycia tego {0}!",
|
||||
"noPermissionsList":"Wymagane uprawnienia: (jedno z nich)",
|
||||
"noPermissionsCooldown":"Nie możesz użyć tego {0}, ponieważ masz nałożone ograniczenie czasowe!",
|
||||
"noPermissionsBlacklist":"Nie możesz użyć tego {0}, ponieważ jesteś na czarnej liście!",
|
||||
"noPermissionsLimitGlobal":"Nie możesz utworzyć ticketa, ponieważ serwer osiągnął maksymalny limit ticketów!",
|
||||
"noPermissionsLimitGlobalUser":"Nie możesz utworzyć ticketa, ponieważ osiągnąłeś maksymalny limit ticketów!",
|
||||
"noPermissionsLimitOption":"Nie możesz utworzyć ticketa, ponieważ serwer osiągnął maksymalny limit ticketów dla tej opcji!",
|
||||
"noPermissionsLimitOptionUser":"Nie możesz utworzyć ticketa, ponieważ osiągnąłeś maksymalny limit ticketów dla tej opcji!",
|
||||
"unknownTicket":"Spróbuj ponownie użyć tego polecenia w prawidłowym tickecie!",
|
||||
"deprecatedTicket":"Obecny kanał nie jest prawidłowym ticketem! Może to być ticket z starej wersji Open Ticket!",
|
||||
"notInGuild":"To {0} nie działa w DM! Spróbuj ponownie na serwerze!",
|
||||
"channelRename":"Z powodu ograniczeń Discorda obecnie niemożliwe jest, aby bot zmienił nazwę kanału. Kanał zostanie automatycznie przemianowany w ciągu 10 minut, jeśli bot nie zostanie zrestartowany.",
|
||||
"channelRenameSource":"Źródło tego błędu: {0}",
|
||||
"busy":"Nie można użyć tego {0}!\nTicket jest obecnie przetwarzany przez bota.\n\nSpróbuj ponownie za kilka sekund!"
|
||||
},
|
||||
"optionInvalidReasons":{
|
||||
"stringRegex":"Wartość nie pasuje do wzorca!",
|
||||
"stringMinLength":"Wartość musi mieć co najmniej {0} znaków!",
|
||||
"stringMaxLength":"Wartość może mieć maksymalnie {0} znaków!",
|
||||
"numberInvalid":"Nieprawidłowa liczba!",
|
||||
"numberMin":"Liczba musi wynosić co najmniej {0}!",
|
||||
"numberMax":"Liczba może wynosić maksymalnie {0}!",
|
||||
"numberDecimal":"Liczba nie może być dziesiętna!",
|
||||
"numberNegative":"Liczba nie może być ujemna!",
|
||||
"numberPositive":"Liczba nie może być dodatnia!",
|
||||
"numberZero":"Liczba nie może wynosić zero!",
|
||||
"channelNotFound":"Nie można znaleźć kanału!",
|
||||
"userNotFound":"Nie można znaleźć użytkownika!",
|
||||
"roleNotFound":"Nie można znaleźć roli!",
|
||||
"memberNotFound":"Nie można znaleźć użytkownika!",
|
||||
"mentionableNotFound":"Nie można znaleźć użytkownika ani roli!",
|
||||
"channelType":"Nieprawidłowy typ kanału!",
|
||||
"notInGuild":"Ta opcja wymaga, abyś był na serwerze!"
|
||||
},
|
||||
"permissions":{
|
||||
"developer":"Musisz być deweloperem bota.",
|
||||
"owner":"Musisz być właścicielem serwera.",
|
||||
"admin":"Musisz być administratorem serwera.",
|
||||
"moderator":"Musisz być moderatorem.",
|
||||
"support":"Musisz należeć do zespołu wsparcia.",
|
||||
"member":"Musisz być członkiem.",
|
||||
"discord-administrator":"Musisz mieć uprawnienie `ADMINISTRATOR`."
|
||||
},
|
||||
"actionInvalid":{
|
||||
"close":"Ticket jest już zamknięty!",
|
||||
"reopen":"Ticket nie jest jeszcze zamknięty!",
|
||||
"claim":"Ticket jest już przypisany!",
|
||||
"unclaim":"Ticket nie jest jeszcze przypisany!",
|
||||
"pin":"Ticket jest już przypięty!",
|
||||
"unpin":"Ticket nie jest przypięty!",
|
||||
"add":"Ten użytkownik już ma dostęp do ticketa!",
|
||||
"remove":"Nie można usunąć tego użytkownika z ticketa!"
|
||||
}
|
||||
},
|
||||
"params":{
|
||||
"uppercase":{
|
||||
"ticket":"Ticket",
|
||||
"tickets":"Tickety",
|
||||
"reason":"Powód",
|
||||
"creator":"Twórca",
|
||||
"remaining":"Pozostały czas",
|
||||
"added":"Dodano",
|
||||
"removed":"Usunięto",
|
||||
"filter":"Filtr",
|
||||
"claimedBy":"Przypisane przez {0}",
|
||||
"method":"Metoda",
|
||||
"type":"Typ",
|
||||
"blacklisted":"Na czarnej liście",
|
||||
"panel":"Panel",
|
||||
"command":"Polecenie",
|
||||
"system":"System",
|
||||
"true":"Prawda",
|
||||
"false":"Fałsz",
|
||||
"syntax":"Składnia",
|
||||
"originalName":"Oryginalna nazwa",
|
||||
"newName":"Nowa nazwa",
|
||||
"until":"Do",
|
||||
"validOptions":"Prawidłowe opcje",
|
||||
"validPanels":"Prawidłowe panele",
|
||||
"autoclose":"Automatyczne zamknięcie",
|
||||
"autodelete":"Automatyczne usunięcie",
|
||||
"startupDate":"Data uruchomienia",
|
||||
"version":"Wersja",
|
||||
"name":"Nazwa",
|
||||
"role":"Rola",
|
||||
"status":"Status",
|
||||
"claimed":"Przypisane",
|
||||
"pinned":"Przypięte",
|
||||
"creationDate":"Data utworzenia"
|
||||
},
|
||||
"lowercase":{
|
||||
"text":"tekst",
|
||||
"html":"html",
|
||||
"command":"polecenie",
|
||||
"modal":"modal",
|
||||
"button":"przycisk",
|
||||
"dropdown":"rozwijane menu",
|
||||
"method":"metoda"
|
||||
}
|
||||
},
|
||||
"commands":{
|
||||
"reason":"Określ opcjonalny powód, który będzie widoczny w logach.",
|
||||
"help":"Uzyskaj listę wszystkich dostępnych poleceń.",
|
||||
"panel":"Wyślij wiadomość z rozwijanym menu lub przyciskami (do tworzenia ticketów).",
|
||||
"panelId":"Identyfikator panelu, który chcesz wyświetlić.",
|
||||
"panelAutoUpdate":"Czy chcesz, aby ten panel automatycznie aktualizował się po edycji?",
|
||||
"ticket":"Natychmiast utwórz ticket.",
|
||||
"ticketId":"Identyfikator ticketa, który chcesz utworzyć.",
|
||||
"close":"Zamknij ticket.",
|
||||
"delete":"Usuń ticket.",
|
||||
"deleteNoTranscript":"Usuń ten ticket bez tworzenia transkryptu.",
|
||||
"reopen":"Ponownie otwórz ticket.",
|
||||
"claim":"Przypisz ticket.",
|
||||
"claimUser":"Przypisz ten ticket innej osobie zamiast sobie.",
|
||||
"unclaim":"Odpowiedz ticket.",
|
||||
"pin":"Przypnij ticket.",
|
||||
"unpin":"Odepnij ticket.",
|
||||
"move":"Przenieś ticket.",
|
||||
"moveId":"Identyfikator opcji, do której chcesz przenieść ticket.",
|
||||
"rename":"Zmień nazwę ticketa.",
|
||||
"renameName":"Nowa nazwa dla tego ticketa.",
|
||||
"add":"Dodaj użytkownika do ticketa.",
|
||||
"addUser":"Użytkownik do dodania.",
|
||||
"remove":"Usuń użytkownika z ticketa.",
|
||||
"removeUser":"Użytkownik do usunięcia.",
|
||||
"blacklist":"Zarządzaj czarną listą ticketów.",
|
||||
"blacklistView":"Wyświetl listę obecnej czarnej listy.",
|
||||
"blacklistAdd":"Dodaj użytkownika do czarnej listy.",
|
||||
"blacklistRemove":"Usuń użytkownika z czarnej listy.",
|
||||
"blacklistGet":"Uzyskaj szczegóły użytkownika na czarnej liście.",
|
||||
"blacklistGetUser":"Użytkownik do uzyskania szczegółów.",
|
||||
"stats":"Wyświetl statystyki bota, użytkownika lub ticketa.",
|
||||
"statsReset":"Zresetuj wszystkie statystyki bota (i zacznij liczyć od zera).",
|
||||
"statsGlobal":"Wyświetl globalne statystyki.",
|
||||
"statsUser":"Wyświetl statystyki użytkownika na serwerze.",
|
||||
"statsUserUser":"Użytkownik do wyświetlenia.",
|
||||
"statsTicket":"Wyświetl statystyki ticketa na serwerze.",
|
||||
"statsTicketTicket":"Ticket do wyświetlenia.",
|
||||
"clear":"Usuń wiele ticketów jednocześnie.",
|
||||
"clearFilter":"Filtr do usuwania ticketów.",
|
||||
"clearFilters":{
|
||||
"all":"Wszystkie",
|
||||
"open":"Otwarte",
|
||||
"close":"Zamknięte",
|
||||
"claim":"Przypisane",
|
||||
"unclaim":"Nieprzypisane",
|
||||
"pin":"Przypięte",
|
||||
"unpin":"Nieprzypięte",
|
||||
"autoclose":"Automatycznie zamknięte"
|
||||
},
|
||||
"autoclose":"Zarządzaj automatycznym zamknięciem ticketa.",
|
||||
"autocloseDisable":"Wyłącz automatyczne zamknięcie w tym tickecie.",
|
||||
"autocloseEnable":"Włącz automatyczne zamknięcie w tym tickecie.",
|
||||
"autocloseEnableTime":"Liczba godzin braku aktywności potrzebna do zamknięcia ticketa.",
|
||||
"autodelete":"Zarządzaj automatycznym usunięciem ticketa.",
|
||||
"autodeleteDisable":"Wyłącz automatyczne usunięcie w tym tickecie.",
|
||||
"autodeleteEnable":"Włącz automatyczne usunięcie w tym tickecie.",
|
||||
"autodeleteEnableTime":"Liczba dni braku aktywności potrzebna do usunięcia ticketa."
|
||||
},
|
||||
"helpMenu":{
|
||||
"help":"Uzyskaj listę wszystkich dostępnych poleceń.",
|
||||
"ticket":"Natychmiast utwórz ticket.",
|
||||
"close":"Zamknij ticket, wyłączając możliwość pisania na tym kanale.",
|
||||
"delete":"Usuń ticket, tworząc transkrypt, jeśli jest włączony.",
|
||||
"reopen":"Ponownie otwórz ticket, włączając możliwość pisania na tym kanale.",
|
||||
"pin":"Przypnij ticket. To przeniesie ticket na górę i doda emoji '📌' do nazwy.",
|
||||
"unpin":"Odepnij ticket. Ticket pozostanie na swojej pozycji, ale straci emoji '📌'.",
|
||||
"move":"Przenieś ticket. To zmieni typ tego ticketa.",
|
||||
"rename":"Zmień nazwę ticketa. To zmieni nazwę kanału tego ticketa.",
|
||||
"claim":"Przypisz ticket. Dzięki temu możesz poinformować zespół, że zajmujesz się tym ticketem.",
|
||||
"unclaim":"Odpowiedz ticket. Dzięki temu możesz poinformować zespół, że ticket jest ponownie dostępny.",
|
||||
"add":"Dodaj użytkownika do ticketa. Pozwoli to użytkownikowi na odczyt i pisanie w tym tickecie.",
|
||||
"remove":"Usuń użytkownika z ticketa. To odbierze użytkownikowi możliwość odczytu i pisania w tym tickecie.",
|
||||
"panel":"Wyślij wiadomość z rozwijanym menu lub przyciskami (do tworzenia ticketów).",
|
||||
"blacklistView":"Wyświetl listę obecnej czarnej listy.",
|
||||
"blacklistAdd":"Dodaj użytkownika do czarnej listy.",
|
||||
"blacklistRemove":"Usuń użytkownika z czarnej listy.",
|
||||
"blacklistGet":"Uzyskaj szczegóły użytkownika na czarnej liście.",
|
||||
"statsGlobal":"Wyświetl globalne statystyki.",
|
||||
"statsTicket":"Wyświetl statystyki ticketa na serwerze.",
|
||||
"statsUser":"Wyświetl statystyki użytkownika na serwerze.",
|
||||
"statsReset":"Zresetuj wszystkie statystyki bota (i zacznij liczyć od zera).",
|
||||
"autocloseDisable":"Wyłącz automatyczne zamknięcie w tym tickecie.",
|
||||
"autocloseEnable":"Włącz automatyczne zamknięcie w tym tickecie.",
|
||||
"autodeleteDisable":"Wyłącz automatyczne usunięcie w tym tickecie.",
|
||||
"autodeleteEnable":"Włącz automatyczne usunięcie w tym tickecie."
|
||||
},
|
||||
"stats":{
|
||||
"scopes":{
|
||||
"global":"Globalne statystyki",
|
||||
"system":"Statystyki systemu",
|
||||
"user":"Statystyki użytkownika",
|
||||
"ticket":"Statystyki ticketa",
|
||||
"participants":"Uczestnicy"
|
||||
},
|
||||
"properties":{
|
||||
"ticketsCreated":"Tickety utworzone",
|
||||
"ticketsClosed":"Tickety zamknięte",
|
||||
"ticketsDeleted":"Tickety usunięte",
|
||||
"ticketsReopened":"Tickety ponownie otwarte",
|
||||
"ticketsAutoclosed":"Tickety automatycznie zamknięte",
|
||||
"ticketsClaimed":"Tickety przypisane",
|
||||
"ticketsPinned":"Tickety przypięte",
|
||||
"ticketsMoved":"Tickety przeniesione",
|
||||
"usersBlacklisted":"Użytkownicy na czarnej liście",
|
||||
"transcriptsCreated":"Transkrypty utworzone"
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
-2
@@ -21,9 +21,10 @@
|
||||
"type": "commonjs",
|
||||
"license": "GPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@discordjs/rest": "^2.4.2",
|
||||
"@types/node": "^22.5.0",
|
||||
"ansis": "^2.3.0",
|
||||
"discord.js": "^14.16.1",
|
||||
"discord.js": "^14.17.2",
|
||||
"formatted-json-stringify": "^1.1.0",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
@@ -35,5 +36,13 @@
|
||||
"url": "https://github.com/DJj123dj/open-ticket/issues",
|
||||
"email": "support@dj-dj.be"
|
||||
},
|
||||
"homepage": "https://openticket.dj-dj.be"
|
||||
"homepage": "https://openticket.dj-dj.be",
|
||||
"imports": {
|
||||
"#opendiscord": "./dist/src/index.js",
|
||||
"#opendiscord-types": "./dist/src/core/api/api.js"
|
||||
},
|
||||
"funding":{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/DJj123dj"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {api, openticket, utilities} from "../../src/index"
|
||||
import {api, openticket, utilities} from "#opendiscord"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/////////////////////////////////////////////
|
||||
@@ -7,10 +7,12 @@ import * as discord from "discord.js"
|
||||
/////////////////////////////////////////////
|
||||
|
||||
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.js" {
|
||||
declare module "#opendiscord-types" {
|
||||
export interface ODPluginManagerIds_Default {
|
||||
"example-plugin":api.ODPlugin
|
||||
}
|
||||
export interface ODConfigManagerIds_Default {
|
||||
"example-plugin:config":api.ODJsonConfig
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"priority":0,
|
||||
"events":[],
|
||||
|
||||
"npmDependencies":["discord.js"],
|
||||
"npmDependencies":[],
|
||||
"requiredPlugins":[],
|
||||
"incompatiblePlugins":[],
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.adding.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -74,7 +74,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.claiming.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -132,7 +132,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.closing.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -40,9 +40,11 @@ export const registerActions = async () => {
|
||||
//create transcript
|
||||
if (!params.withoutTranscript){
|
||||
const transcriptRes = await openticket.actions.get("openticket:create-transcript").run(source,{guild,channel,user,ticket})
|
||||
//transcript failure
|
||||
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)
|
||||
.catch((reason) => openticket.log("Unable to send transcript failure to ticket channel!","error",[{key:"id",value:channel.id}]))
|
||||
|
||||
//undo deletion
|
||||
ticket.get("openticket:for-deletion").value = false
|
||||
@@ -76,13 +78,14 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.deleting.dm) await openticket.client.sendUserDm(creator,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 channel.delete("Ticket Deleted").catch((reason) => openticket.log("Unable to delete ticket channel!","error",[{key:"id",value:channel.id}]))
|
||||
await openticket.events.get("afterTicketChannelDeleted").emit([ticket,user])
|
||||
|
||||
//delete permissions from manager
|
||||
|
||||
@@ -198,7 +198,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.moving.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -72,7 +72,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.pinning.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -32,7 +32,7 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//update roles of user
|
||||
const result: api.OTRoleUpdateResult[] = []
|
||||
const result: api.ODRoleUpdateResult[] = []
|
||||
for (const r of roles){
|
||||
try{
|
||||
if (r.members.has(user.id) && (mode == "add&remove" || mode == "remove")){
|
||||
|
||||
@@ -59,7 +59,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.removing.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -56,7 +56,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.renaming.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -158,7 +158,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.reopening.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -103,7 +103,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.claiming.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -65,7 +65,8 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//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}))
|
||||
const creator = await openticket.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.pinning.dm) await openticket.client.sendUserDm(creator,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
|
||||
|
||||
@@ -17,14 +17,15 @@ const panelDropdowns = () => {
|
||||
new api.ODWorker("openticket:panel-dropdown-tickets",0,async (instance,params) => {
|
||||
const {panel,options} = params
|
||||
|
||||
|
||||
const parsedOptions: api.ODDropdownData["options"] = options.map((option) => {
|
||||
const desc = option.get("openticket:description").value.substring(0,100)
|
||||
const emoji = option.get("openticket:button-emoji").value
|
||||
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:(desc.length > 0) ? desc : undefined
|
||||
emoji:(emoji.length > 0) ? emoji : undefined,
|
||||
description:(desc.length > 0) ? desc : undefined,
|
||||
default:false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
+6
-23
@@ -490,7 +490,7 @@ const panelEmbeds = () => {
|
||||
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.setColor(embedOptions.customColor ? embedOptions.customColor : generalConfig.data.mainColor)
|
||||
instance.setTitle(embedOptions.title)
|
||||
if (embedOptions.thumbnail) instance.setThumbnail(embedOptions.thumbnail)
|
||||
if (embedOptions.image) instance.setImage(embedOptions.image)
|
||||
@@ -586,7 +586,7 @@ const ticketEmbeds = () => {
|
||||
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)
|
||||
instance.setColor(embedOptions.customColor ? embedOptions.customColor : generalConfig.data.mainColor)
|
||||
if (embedOptions.title) instance.setTitle(embedOptions.title)
|
||||
if (embedOptions.thumbnail) instance.setThumbnail(embedOptions.thumbnail)
|
||||
if (embedOptions.image) instance.setImage(embedOptions.image)
|
||||
@@ -985,8 +985,9 @@ const transcriptEmbeds = () => {
|
||||
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
|
||||
const transcriptConfig = openticket.configs.get("openticket:transcripts")
|
||||
|
||||
instance.setColor(generalConfig.data.mainColor)
|
||||
instance.setColor(transcriptConfig.data.embedSettings.customColor ? transcriptConfig.data.embedSettings.customColor : 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})
|
||||
@@ -1014,8 +1015,9 @@ const transcriptEmbeds = () => {
|
||||
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
|
||||
const transcriptConfig = openticket.configs.get("openticket:transcripts")
|
||||
|
||||
instance.setColor(generalConfig.data.mainColor)
|
||||
instance.setColor(transcriptConfig.data.embedSettings.customColor ? transcriptConfig.data.embedSettings.customColor : 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})
|
||||
@@ -1162,25 +1164,6 @@ const clearEmbeds = () => {
|
||||
)
|
||||
}
|
||||
|
||||
//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"))
|
||||
|
||||
@@ -25,6 +25,7 @@ export * from "./modules/code"
|
||||
export * from "./modules/cooldown"
|
||||
export * from "./modules/post"
|
||||
export * from "./modules/verifybar"
|
||||
export * from "./modules/progressbar"
|
||||
export * from "./modules/startscreen"
|
||||
|
||||
//OPENTICKET DEFAULT MODULES
|
||||
@@ -48,6 +49,7 @@ export * from "./defaults/worker"
|
||||
export * from "./defaults/code"
|
||||
export * from "./defaults/cooldown"
|
||||
export * from "./defaults/post"
|
||||
export * from "./defaults/progressbar"
|
||||
export * from "./defaults/startscreen"
|
||||
export * from "./defaults/console"
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ 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"
|
||||
import { ODRole, ODRoleUpdateMode, ODRoleUpdateResult } from "../openticket/role"
|
||||
|
||||
/**## ODActionManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODActionManager_Default` class.
|
||||
/**## ODActionManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODActionManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODActionManagerIds_Default {
|
||||
@@ -102,8 +102,8 @@ export interface ODActionManagerIds_Default {
|
||||
},
|
||||
"openticket:reaction-role":{
|
||||
source:"panel-button"|"other",
|
||||
params:{guild:discord.Guild,user:discord.User,option:ODRoleOption,overwriteMode:OTRoleUpdateMode|null},
|
||||
result:{result:OTRoleUpdateResult[],role:ODRole},
|
||||
params:{guild:discord.Guild,user:discord.User,option:ODRoleOption,overwriteMode:ODRoleUpdateMode|null},
|
||||
result:{result:ODRoleUpdateResult[],role:ODRole},
|
||||
workers:"openticket:reaction-role"|"openticket:logs"
|
||||
},
|
||||
"openticket:clear-tickets":{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
///////////////////////////////////////
|
||||
import { ODVersion, ODVersionManager, ODValidId } from "../modules/base"
|
||||
|
||||
/**## ODVersionManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODVersionManager` class.
|
||||
/**## ODVersionManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODVersionManager` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODVersionManagerIds_Default {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { ODRoleOption, ODTicketOption, ODWebsiteOption } from "../openticket/opt
|
||||
import { ODVerifyBar } from "../modules/verifybar"
|
||||
import * as discord from "discord.js"
|
||||
import { ODTranscriptCompiler, ODTranscriptCompilerCompileResult } from "../openticket/transcript"
|
||||
import { ODRole, OTRoleUpdateResult } from "../openticket/role"
|
||||
import { ODRole, ODRoleUpdateResult } from "../openticket/role"
|
||||
|
||||
/**## ODBuilderManager_Default `default_class`
|
||||
* This is a special class that adds type definitions & typescript to the ODBuilderManager class.
|
||||
@@ -29,8 +29,8 @@ export class ODBuilderManager_Default extends ODBuilderManager {
|
||||
declare modals: ODModalManager_Default
|
||||
}
|
||||
|
||||
/**## ODButtonManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODButtonManager_Default` class.
|
||||
/**## ODButtonManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODButtonManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODButtonManagerIds_Default {
|
||||
@@ -111,8 +111,8 @@ export class ODButton_Default<Source extends string, Params, WorkerIds extends s
|
||||
declare workers: ODWorkerManager_Default<ODButtonInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODDropdownManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODDropdownManager_Default` class.
|
||||
/**## ODDropdownManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODDropdownManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODDropdownManagerIds_Default {
|
||||
@@ -165,8 +165,8 @@ export class ODDropdown_Default<Source extends string, Params, WorkerIds extends
|
||||
declare workers: ODWorkerManager_Default<ODDropdownInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODFileManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODFileManager_Default` class.
|
||||
/**## ODFileManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODFileManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODFileManagerIds_Default {
|
||||
@@ -219,8 +219,8 @@ export class ODFile_Default<Source extends string, Params, WorkerIds extends str
|
||||
declare workers: ODWorkerManager_Default<ODFileInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODEmbedManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODEmbedManager_Default` class.
|
||||
/**## ODEmbedManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODEmbedManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODEmbedManagerIds_Default {
|
||||
@@ -280,7 +280,7 @@ export interface ODEmbedManagerIds_Default {
|
||||
"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<any>,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:reaction-role":{source:"panel-button"|"other",params:{guild:discord.Guild,user:discord.User,role:ODRole,result:ODRoleUpdateResult[]},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"},
|
||||
@@ -339,8 +339,8 @@ export class ODEmbed_Default<Source extends string, Params, WorkerIds extends st
|
||||
declare workers: ODWorkerManager_Default<ODEmbedInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODMessageManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODMessageManager_Default` class.
|
||||
/**## ODMessageManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODMessageManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODMessageManagerIds_Default {
|
||||
@@ -411,7 +411,7 @@ export interface ODMessageManagerIds_Default {
|
||||
"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<any>,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:reaction-role":{source:"panel-button"|"other",params:{guild:discord.Guild,user:discord.User,role:ODRole,result:ODRoleUpdateResult[]},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"},
|
||||
@@ -470,8 +470,8 @@ export class ODMessage_Default<Source extends string, Params, WorkerIds extends
|
||||
declare workers: ODWorkerManager_Default<ODMessageInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODModalManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODModalManager_Default` class.
|
||||
/**## ODModalManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODModalManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODModalManagerIds_Default {
|
||||
|
||||
@@ -6,8 +6,8 @@ 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.
|
||||
/**## ODCheckerManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCheckerManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODCheckerManagerIds_Default {
|
||||
@@ -77,7 +77,7 @@ export class ODCheckerRenderer_Default extends ODCheckerRenderer {
|
||||
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!",
|
||||
headerDescription:tm.get("other","openticket:header-description") ?? "check for errors in your 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}",
|
||||
@@ -208,8 +208,8 @@ export class ODCheckerRenderer_Default extends ODCheckerRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODCheckerTranslationRegisterOtherIds_Default `type`
|
||||
* This type is an array of ids available in the `ODCheckerTranslationRegister_Default` class.
|
||||
/**## ODCheckerTranslationRegisterOtherIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCheckerTranslationRegister_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export type ODCheckerTranslationRegisterOtherIds_Default = (
|
||||
@@ -228,8 +228,8 @@ export type ODCheckerTranslationRegisterOtherIds_Default = (
|
||||
"openticket:footer-support"
|
||||
)
|
||||
|
||||
/**## ODCheckerTranslationRegisterMessageIds_Default `type`
|
||||
* This type is an array of ids available in the `ODCheckerTranslationRegister_Default` class.
|
||||
/**## ODCheckerTranslationRegisterMessageIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCheckerTranslationRegister_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export type ODCheckerTranslationRegisterMessageIds_Default = (
|
||||
@@ -341,8 +341,8 @@ export class ODCheckerTranslationRegister_Default extends ODCheckerTranslationRe
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODCheckerFunctionManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODCheckerFunctionManager_Default` class.
|
||||
/**## ODCheckerFunctionManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCheckerFunctionManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODCheckerFunctionManagerIds_Default {
|
||||
|
||||
@@ -15,8 +15,8 @@ export class ODClientManager_Default extends ODClientManager {
|
||||
declare textCommands: ODTextCommandManager_Default
|
||||
}
|
||||
|
||||
/**## ODSlashCommandManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODSlashCommandManager_Default` class.
|
||||
/**## ODSlashCommandManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODSlashCommandManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODSlashCommandManagerIds_Default {
|
||||
@@ -77,8 +77,8 @@ export class ODSlashCommandManager_Default extends ODSlashCommandManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTextCommandManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODTextCommandManager_Default` class.
|
||||
/**## ODTextCommandManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODTextCommandManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODTextCommandManagerIds_Default {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
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.
|
||||
/**## ODCodeManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCodeManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODCodeManagerIds_Default {
|
||||
@@ -23,7 +23,8 @@ export interface ODCodeManagerIds_Default {
|
||||
"openticket:autoclose-timeout":ODCode,
|
||||
"openticket:autoclose-leave":ODCode,
|
||||
"openticket:autodelete-timeout":ODCode,
|
||||
"openticket:autodelete-leave":ODCode
|
||||
"openticket:autodelete-leave":ODCode,
|
||||
"openticket:ticket-anti-busy":ODCode,
|
||||
}
|
||||
|
||||
/**## ODCodeManager_Default `default_class`
|
||||
|
||||
+225
-13
@@ -5,10 +5,10 @@ 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"
|
||||
import { ODRoleUpdateMode } from "../openticket/role"
|
||||
|
||||
/**## ODConfigManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODConfigManager_Default` class.
|
||||
/**## ODConfigManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODConfigManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODConfigManagerIds_Default {
|
||||
@@ -52,22 +52,28 @@ export class ODConfigManager_Default extends ODConfigManager {
|
||||
* This interface is an object which has all properties for the status object in the `general.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultStatusType {
|
||||
/**Is the status enabled? */
|
||||
enabled:boolean,
|
||||
/**The type of status (e.g. playing, listening, custom, ...) */
|
||||
type:Exclude<ODClientActivityType,false>,
|
||||
/**The text for the status. */
|
||||
text:string,
|
||||
/**The status of the bot (e.g. online, invisible, idle, do not disturb) */
|
||||
status:ODClientActivityStatus
|
||||
}
|
||||
|
||||
/**## ODJsonConfig_DefaultMessageSettingsType `interface`
|
||||
* This interface is an object which has all properties for the system/messages/... object in the `general.json` config!
|
||||
* This interface is an object which has all properties for the "system"."messages".... object in the `general.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultMessageSettingsType {
|
||||
/**Enable sending DM logs to the ticket creator for this action. */
|
||||
dm:boolean,
|
||||
/**Enable sending logsto the log channel for this action. */
|
||||
logs:boolean
|
||||
}
|
||||
|
||||
/**## ODJsonConfig_DefaultCmdPermissionSettingsType `type`
|
||||
* This type is a collection of command permission settings for the system/permissions/... object in the `general.json` config!
|
||||
* 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
|
||||
|
||||
@@ -79,56 +85,96 @@ export type ODJsonConfig_DefaultCmdPermissionSettingsType = "admin"|"everyone"|"
|
||||
*/
|
||||
export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
|
||||
declare data: {
|
||||
/**This object contains a few URLs and metadata for the config. */
|
||||
_INFO:{
|
||||
/**A link to the Open Ticket documentation. */
|
||||
support:string,
|
||||
/**A link to the DJdj Development discord server. */
|
||||
discord:string,
|
||||
/**The version of Open Ticket this config is compatible with. */
|
||||
version:string
|
||||
},
|
||||
|
||||
/**The token of the bot. (Empty when using `tokenFromENV`) */
|
||||
token:string,
|
||||
/**Use the token from the `.env` file as `TOKEN=xxxxx`. */
|
||||
tokenFromENV:boolean,
|
||||
|
||||
/**The main (hex) color used in almost every embed in the bot. */
|
||||
mainColor:discord.ColorResolvable,
|
||||
/**The language to use. Can be the id of the language or the id without the prefix when using `openticket:...`. */
|
||||
language:string,
|
||||
/**The prefix used in all text-commands. */
|
||||
prefix:string,
|
||||
/**The id of the discord server where the bot is used. */
|
||||
serverId:string,
|
||||
/**A list of discord role ids which are able to access all tickets & commands. */
|
||||
globalAdmins:string[],
|
||||
|
||||
/**Are slash commands enabled? */
|
||||
slashCommands:boolean,
|
||||
/**Are text commands enabled? */
|
||||
textCommands:boolean,
|
||||
|
||||
/**All settings related to the status of the bot. */
|
||||
status:ODJsonConfig_DefaultStatusType,
|
||||
|
||||
/**All settings related to the ticket system. */
|
||||
system:{
|
||||
/**Remove all participants (except admins) from the ticket when it's closed. */
|
||||
removeParticipantsOnClose:boolean,
|
||||
/**Reply with an ephemeral message when a ticket is created. */
|
||||
replyOnTicketCreation:boolean,
|
||||
/**Reply with an ephemeral message when reaction roles are changed. */
|
||||
replyOnReactionRole:boolean,
|
||||
/**Use a translated config checker in the console. */
|
||||
useTranslatedConfigChecker:boolean,
|
||||
/**Prefer slash-commands over text-commands when displaying them in menu's and messages. */
|
||||
preferSlashOverText:boolean,
|
||||
/**Reply with "unknown command" when the prefix is used without a valid command. */
|
||||
sendErrorOnUnknownCommand:boolean,
|
||||
/**Display the question fields (in a ticket message) in code blocks. */
|
||||
questionFieldsInCodeBlock:boolean,
|
||||
/**Disable the (✅❌) buttons and directly run the action. */
|
||||
disableVerifyBars:boolean,
|
||||
/**Display error embeds/messages with red instead of the default bot color. */
|
||||
useRedErrorEmbeds:boolean,
|
||||
/**The emoji style used in the bot. This will affect all embeds, titles & messages in the bot. */
|
||||
emojiStyle:"before"|"after"|"double"|"disabled",
|
||||
|
||||
|
||||
/**Enable/disable the ticket claim & unclaim button in the ticket message. */
|
||||
enableTicketClaimButtons:boolean,
|
||||
/**Enable/disable the ticket close & re-open button in the ticket message. */
|
||||
enableTicketCloseButtons:boolean,
|
||||
/**Enable/disable the ticket pin & unpin button in the ticket message. */
|
||||
enableTicketPinButtons:boolean,
|
||||
/**Enable/disable the ticket delete button in the ticket message. */
|
||||
enableTicketDeleteButtons:boolean,
|
||||
/**Enable/disable the "with reason" button for all actions in the ticket message. */
|
||||
enableTicketActionWithReason:boolean,
|
||||
/**Enable/disable the delete without transcript feature (button & /delete command). */
|
||||
enableDeleteWithoutTranscript:boolean,
|
||||
|
||||
/**All settings related to the log channel. */
|
||||
logs:{
|
||||
/**Enable logging. Individual actions should still be added via the `"system"."messages"..."logs"` */
|
||||
enabled:boolean,
|
||||
/**The channel to send logs to. */
|
||||
channel:string
|
||||
},
|
||||
|
||||
/**All settings related to global ticket limits. */
|
||||
limits:{
|
||||
/**Enable global ticket limits. */
|
||||
enabled:boolean,
|
||||
/**The maximum amount of tickets that are allowed in the server at the same time. */
|
||||
globalMaximum:number,
|
||||
/**The maximum amount of tickets that a user is allowed to create at the same time. */
|
||||
userMaximum:number
|
||||
},
|
||||
|
||||
/**Configure permissions for all Open Ticket commands & actions. */
|
||||
permissions:{
|
||||
help:ODJsonConfig_DefaultCmdPermissionSettingsType,
|
||||
panel:ODJsonConfig_DefaultCmdPermissionSettingsType,
|
||||
@@ -151,6 +197,7 @@ export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
|
||||
autodelete:ODJsonConfig_DefaultCmdPermissionSettingsType
|
||||
},
|
||||
|
||||
/**Configure dm & log messages for all Open Ticket commands & actions. */
|
||||
messages:{
|
||||
creation:ODJsonConfig_DefaultMessageSettingsType,
|
||||
closing:ODJsonConfig_DefaultMessageSettingsType,
|
||||
@@ -174,22 +221,32 @@ export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
|
||||
* This interface is an object which has all basic properties for options in the `options.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultOptionType {
|
||||
/**The id of this option. */
|
||||
id:string,
|
||||
/**The name of this option. */
|
||||
name:string,
|
||||
/**The description of this option. */
|
||||
description:string,
|
||||
/**The type of this option. This type also determines the other option-specific variables. */
|
||||
type:"ticket"|"website"|"role",
|
||||
/**All settings related to the button for the 3 option types. */
|
||||
button:{
|
||||
/**The emoji of the button. (can also be empty) */
|
||||
emoji:string,
|
||||
/**The label of the button (can also be empty) */
|
||||
label:string
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODJsonConfig_DefaultOptionButtonSettingsType `interface`
|
||||
* This interface is an object which has all button settings for ticket options in the `options.json` config!
|
||||
* This interface is an object which has all button settings for ticket & reaction role options in the `options.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultOptionButtonSettingsType {
|
||||
/**The emoji of the button. (can also be empty) */
|
||||
emoji:string,
|
||||
/**The label of the button (can also be empty) */
|
||||
label:string,
|
||||
/**The color of the button (not available in options with the 'website' type!) */
|
||||
color:ODValidButtonColor
|
||||
}
|
||||
|
||||
@@ -197,14 +254,28 @@ export interface ODJsonConfig_DefaultOptionButtonSettingsType {
|
||||
* This interface is an object which has all message embed settings for ticket options in the `options.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultOptionEmbedSettingsType {
|
||||
/**Is this embed enabled? */
|
||||
enabled:boolean,
|
||||
/**The title of the embed. */
|
||||
title:string,
|
||||
/**The description of this embed. */
|
||||
description:string,
|
||||
customColor:string,
|
||||
/**A custom color for this embed. (The default bot color is used when empty) */
|
||||
customColor:discord.ColorResolvable,
|
||||
|
||||
/**A URL to an image displayed in the embed. */
|
||||
image:string,
|
||||
/**A URL to a thumbnail displayed in the embed. */
|
||||
thumbnail:string,
|
||||
fields:{name:string, value:string, inline:boolean}[],
|
||||
/**A list of fields displayed in the embed. */
|
||||
fields:{
|
||||
/**The name of this field. */
|
||||
name:string,
|
||||
/**The value of this field. => empty not allowed */
|
||||
value:string,
|
||||
inline:boolean
|
||||
}[],
|
||||
/**Enable setting the timestamp of the embed to the current time. */
|
||||
timestamp:boolean
|
||||
}
|
||||
|
||||
@@ -212,8 +283,11 @@ export interface ODJsonConfig_DefaultOptionEmbedSettingsType {
|
||||
* This interface is an object which has all message ping settings for ticket options in the `options.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultOptionPingSettingsType {
|
||||
/**Ping `@here`. */
|
||||
"@here":boolean,
|
||||
/**Ping `@everyone`. */
|
||||
"@everyone":boolean,
|
||||
/**A list of custom discord role ids to ping. */
|
||||
custom:string[]
|
||||
}
|
||||
|
||||
@@ -223,49 +297,92 @@ export interface ODJsonConfig_DefaultOptionPingSettingsType {
|
||||
export interface ODJsonConfig_DefaultOptionTicketType extends ODJsonConfig_DefaultOptionType {
|
||||
type:"ticket",
|
||||
button:ODJsonConfig_DefaultOptionButtonSettingsType,
|
||||
/**A list of discord role ids which are able to access this ticket type & use commands. */
|
||||
ticketAdmins:string[],
|
||||
/**A list of discord role ids which are able to access this ticket type but can't write in the chat. */
|
||||
readonlyAdmins:string[],
|
||||
/**When enabled, blacklisted users can still create this ticket type. (used for appeals, etc) */
|
||||
allowCreationByBlacklistedUsers:boolean,
|
||||
/**A list of valid question ids from the `questions.json` config. */
|
||||
questions:string[],
|
||||
/**All settings related to the ticket channel itself. */
|
||||
channel:{
|
||||
/**The prefix used in the name of this ticket channel. */
|
||||
prefix:string,
|
||||
/**The type of suffix used in the name of this ticket channel. */
|
||||
suffix:"user-name"|"user-id"|"random-number"|"random-hex"|"counter-dynamic"|"counter-fixed",
|
||||
/**An optional discord category id to create this ticket in. */
|
||||
category:string,
|
||||
/**An optional discord category id to move this ticket to when closed. */
|
||||
closedCategory:string,
|
||||
/**An optional discord category id to create this ticket in when the primary one is full (max. 50 tickets). */
|
||||
backupCategory:string,
|
||||
claimedCategory:{user:string, category:string}[],
|
||||
/**A list of discord category ids to move this ticket to when claimed by a specific user. */
|
||||
claimedCategory:{
|
||||
/**The user which claimed the ticket. */
|
||||
user:string,
|
||||
/**The category to move the ticket to when claimed by this user. */
|
||||
category:string
|
||||
}[],
|
||||
/**The channel description/topic shown at the top of the channel in discord. */
|
||||
description:string
|
||||
},
|
||||
/**All settings related to the message sent in DM to the creator when the ticket is created. */
|
||||
dmMessage:{
|
||||
/**Enable this message. */
|
||||
enabled:boolean,
|
||||
/**The raw text contents of this message. (empty for embed only) */
|
||||
text:string,
|
||||
/**The embed of this message. */
|
||||
embed:ODJsonConfig_DefaultOptionEmbedSettingsType
|
||||
},
|
||||
/**All settings related to the message sent in the ticket channel when the ticket is created. */
|
||||
ticketMessage:{
|
||||
/**Enable this message. */
|
||||
enabled:boolean,
|
||||
/**The raw text contents of this message. (empty for embed only) */
|
||||
text:string,
|
||||
/**The embed of this message. */
|
||||
embed:ODJsonConfig_DefaultOptionEmbedSettingsType,
|
||||
/**Additional ping/mention settings for this ticket channel. */
|
||||
ping:ODJsonConfig_DefaultOptionPingSettingsType
|
||||
},
|
||||
/**All settings related to autoclosing this ticket type. */
|
||||
autoclose:{
|
||||
/**Enable autoclosing when the ticket is inactive for the set duration of time. */
|
||||
enableInactiveHours:boolean,
|
||||
/**The amount of hours this ticket is required to be inactive for. */
|
||||
inactiveHours:number,
|
||||
/**Enable autoclosing when the creator of the ticket leaves the server. */
|
||||
enableUserLeave:boolean,
|
||||
/**Disable autoclosing when the ticket is claimed by someone. */
|
||||
disableOnClaim:boolean
|
||||
},
|
||||
/**All settings related to autodeleting this ticket type. */
|
||||
autodelete:{
|
||||
/**Enable autodeleting when the ticket is inactive for the set duration of time. */
|
||||
enableInactiveDays:boolean,
|
||||
/**The amount of days this ticket is required to be inactive for. */
|
||||
inactiveDays:number,
|
||||
/**Enable autodeleting when the creator of the ticket leaves the server. */
|
||||
enableUserLeave:boolean,
|
||||
/**Disable autodeleting when the ticket is claimed by someone. */
|
||||
disableOnClaim:boolean
|
||||
},
|
||||
/**All settings related to the cooldown of this ticket type */
|
||||
cooldown:{
|
||||
/**Enable cooldown (per user) */
|
||||
enabled:boolean,
|
||||
/**The amount of minutes a user needs to wait before being able to create a ticket again. */
|
||||
cooldownMinutes:number
|
||||
},
|
||||
/**All settings related to the limits of this ticket type */
|
||||
limits:{
|
||||
/**Enable option ticket limits. */
|
||||
enabled:boolean,
|
||||
/**The maximum amount of tickets of this type that are allowed in the server at the same time. */
|
||||
globalMaximum:number,
|
||||
/**The maximum amount of tickets of this type that a user is allowed to create at the same time. */
|
||||
userMaximum:number
|
||||
}
|
||||
}
|
||||
@@ -275,6 +392,7 @@ export interface ODJsonConfig_DefaultOptionTicketType extends ODJsonConfig_Defau
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultOptionWebsiteType extends ODJsonConfig_DefaultOptionType {
|
||||
type:"website",
|
||||
/**The URL this button will point to. */
|
||||
url:string
|
||||
}
|
||||
|
||||
@@ -284,9 +402,13 @@ export interface ODJsonConfig_DefaultOptionWebsiteType extends ODJsonConfig_Defa
|
||||
export interface ODJsonConfig_DefaultOptionRoleType extends ODJsonConfig_DefaultOptionType {
|
||||
type:"role",
|
||||
button:ODJsonConfig_DefaultOptionButtonSettingsType,
|
||||
/**All roles which will be affected by this button. */
|
||||
roles:string[],
|
||||
mode:OTRoleUpdateMode,
|
||||
/**The mode determines what will happen with the affected roles on the user. */
|
||||
mode:ODRoleUpdateMode,
|
||||
/**A list of roles to remove from the user when given at least one of the affected roles. */
|
||||
removeRolesOnAdd:string[],
|
||||
/**Automatically add these roles when the user joins the server. */
|
||||
addOnMemberJoin:boolean
|
||||
}
|
||||
|
||||
@@ -308,18 +430,34 @@ export class ODJsonConfig_DefaultOptions extends ODJsonConfig {
|
||||
* This interface is an object which has all message embed settings for panels in the `panels.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultPanelEmbedSettingsType {
|
||||
/**Is this embed enabled? */
|
||||
enabled:boolean,
|
||||
/**The title of the embed. */
|
||||
title:string,
|
||||
/**The description of this embed. */
|
||||
description:string,
|
||||
|
||||
customColor:string,
|
||||
/**A custom color for this embed. (The default bot color is used when empty) */
|
||||
customColor:discord.ColorResolvable,
|
||||
/**An optional URL used in the title of the embed. */
|
||||
url:string,
|
||||
|
||||
/**A URL to an image displayed in the embed. */
|
||||
image:string,
|
||||
/**A URL to a thumbnail displayed in the embed. */
|
||||
thumbnail:string,
|
||||
|
||||
/**The footer of this embed. */
|
||||
footer:string,
|
||||
fields:{name:string,value:string,inline:boolean}[],
|
||||
/**A list of fields displayed in the embed. (except when using "describeOptionsInEmbedFields") */
|
||||
fields:{
|
||||
/**The name of this field. */
|
||||
name:string,
|
||||
/**The value of this field. => empty not allowed */
|
||||
value:string,
|
||||
inline:boolean
|
||||
}[],
|
||||
/**Enable setting the timestamp of the embed to the current time. */
|
||||
timestamp:boolean
|
||||
}
|
||||
|
||||
@@ -327,23 +465,37 @@ export interface ODJsonConfig_DefaultPanelEmbedSettingsType {
|
||||
* This interface is an object which has all properties for panels in the `panels.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultPanelType {
|
||||
/**The id of this panel. */
|
||||
id:string,
|
||||
/**The name of this panel. */
|
||||
name:string,
|
||||
/**When enabled, the panel uses a dropdown instead of buttons. */
|
||||
dropdown:boolean,
|
||||
/**A list of valid options ids from the `options.json` config. */
|
||||
options:string[],
|
||||
|
||||
/**The raw text contents of this panel. (empty for embed only) */
|
||||
text:string,
|
||||
/**The embed of this panel. */
|
||||
embed:ODJsonConfig_DefaultPanelEmbedSettingsType,
|
||||
settings:{
|
||||
/**The placeholder used in the dropdown when enabled. */
|
||||
dropdownPlaceholder:string,
|
||||
|
||||
/**Enable a max tickets warning in the text contents. */
|
||||
enableMaxTicketsWarningInText:boolean,
|
||||
/**Enable a max tickets warning in the embed. */
|
||||
enableMaxTicketsWarningInEmbed:boolean,
|
||||
|
||||
/**The layout/complexity of the describe options feature. */
|
||||
describeOptionsLayout:"simple"|"normal"|"detailed",
|
||||
/**A custom title for the describe options feature. */
|
||||
describeOptionsCustomTitle:string,
|
||||
/**Describe the options in the text contents. */
|
||||
describeOptionsInText:boolean,
|
||||
/**Describe the options in the embed fields. */
|
||||
describeOptionsInEmbedFields:boolean,
|
||||
/**Describe the options in the embed description. */
|
||||
describeOptionsInEmbedDescription:boolean
|
||||
}
|
||||
}
|
||||
@@ -362,15 +514,24 @@ export class ODJsonConfig_DefaultPanels extends ODJsonConfig {
|
||||
* This interface is an object which has all properties for short questions in the `questions.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultShortQuestionType {
|
||||
/**The id of this question. */
|
||||
id:string,
|
||||
/**The name of this question. */
|
||||
name:string,
|
||||
/**The type of this question. */
|
||||
type:"short",
|
||||
|
||||
/**Is this question required? */
|
||||
required:boolean,
|
||||
/**A placeholder for the question. */
|
||||
placeholder:string,
|
||||
/**Settings related to the length of the input. */
|
||||
length:{
|
||||
/**Enable text length verification. */
|
||||
enabled:boolean,
|
||||
/**The minimum text input length. */
|
||||
min:number,
|
||||
/**The maximum text input length. */
|
||||
max:number
|
||||
}
|
||||
}
|
||||
@@ -379,15 +540,24 @@ export interface ODJsonConfig_DefaultShortQuestionType {
|
||||
* This interface is an object which has all properties for paragraph questions in the `questions.json` config!
|
||||
*/
|
||||
export interface ODJsonConfig_DefaultParagraphQuestionType {
|
||||
/**The id of this question. */
|
||||
id:string,
|
||||
/**The name of this question. */
|
||||
name:string,
|
||||
/**The type of this question. */
|
||||
type:"paragraph",
|
||||
|
||||
/**Is this question required? */
|
||||
required:boolean,
|
||||
/**A placeholder for the question. */
|
||||
placeholder:string,
|
||||
/**Settings related to the length of the input. */
|
||||
length:{
|
||||
/**Enable text length verification. */
|
||||
enabled:boolean,
|
||||
/**The minimum text input length. */
|
||||
min:number,
|
||||
/**The maximum text input length. */
|
||||
max:number
|
||||
}
|
||||
}
|
||||
@@ -413,56 +583,98 @@ export class ODJsonConfig_DefaultQuestions extends ODJsonConfig {
|
||||
*/
|
||||
export class ODJsonConfig_DefaultTranscripts extends ODJsonConfig {
|
||||
declare data: {
|
||||
/**All general settings related to transcripts. */
|
||||
general:{
|
||||
/**Are transcripts enabled? */
|
||||
enabled:boolean,
|
||||
|
||||
/**Enable sending the generated transcript in a channel. */
|
||||
enableChannel:boolean,
|
||||
/**Enable sending the generated transcript to the DM of the ticket creator. */
|
||||
enableCreatorDM:boolean,
|
||||
/**Enable sending the generated transcript to the DM of the participants. */
|
||||
enableParticipantDM:boolean,
|
||||
/**Enable sending the generated transcript to the DM of all admins which were active in the ticket. */
|
||||
enableActiveAdminDM:boolean,
|
||||
/**Enable sending the generated transcript to the DM of all admins which were assigned to the ticket. */
|
||||
enableEveryAdminDM:boolean,
|
||||
|
||||
/**A discord channel id for the `"enableChannel"` setting. */
|
||||
channel:string,
|
||||
/**Want to use text or HTML transcripts? */
|
||||
mode:"html"|"text"
|
||||
},
|
||||
/**All settings related to the embed from the transcripts. (UNIMPLEMENTED!!) */
|
||||
embedSettings:{
|
||||
customColor:string,
|
||||
/**Unimplemented feature */
|
||||
customColor:discord.ColorResolvable,
|
||||
/**Unimplemented feature */
|
||||
listAllParticipants:boolean,
|
||||
/**Unimplemented feature */
|
||||
includeTicketStats:boolean
|
||||
},
|
||||
/**The layout of the text transcripts. */
|
||||
textTranscriptStyle:{
|
||||
/**The layout/complexity of the text transcripts. */
|
||||
layout:"simple"|"normal"|"detailed",
|
||||
/**Include stats in the transcript. */
|
||||
includeStats:boolean,
|
||||
/**Include user & message ids in the transcript. */
|
||||
includeIds:boolean,
|
||||
/**Include embeds in the transcript. */
|
||||
includeEmbeds:boolean,
|
||||
/**Include files in the transcript. */
|
||||
includeFiles:boolean,
|
||||
/**Include bot messages in the transcript. */
|
||||
includeBotMessages:boolean,
|
||||
|
||||
/**How to name the transcript file? */
|
||||
fileMode:"custom"|"channel-name"|"channel-id"|"user-name"|"user-id",
|
||||
/**A custom name for the transcript file (when using `"custom"`) */
|
||||
customFileName:string
|
||||
},
|
||||
/**The layout of the HTML transcripts. */
|
||||
htmlTranscriptStyle:{
|
||||
/**Settings related to the background. */
|
||||
background:{
|
||||
/**Enable a custom background. */
|
||||
enableCustomBackground:boolean,
|
||||
/**The background (hex) color. */
|
||||
backgroundColor:string,
|
||||
/**The background image url. */
|
||||
backgroundImage:string
|
||||
},
|
||||
/**Settings related to the header. */
|
||||
header:{
|
||||
/**Enable a custom header. */
|
||||
enableCustomHeader:boolean,
|
||||
/**The background (hex) color of the header. */
|
||||
backgroundColor:string,
|
||||
/**The deco color (horizontal line) of the header. */
|
||||
decoColor:string,
|
||||
/**The text color of the header. */
|
||||
textColor:string
|
||||
},
|
||||
/**Settings related to the stats section. */
|
||||
stats:{
|
||||
/**Enable a custom stats section. */
|
||||
enableCustomStats:false,
|
||||
/**The background color of the stats section. */
|
||||
backgroundColor:string,
|
||||
/**The key text color of the stats section. */
|
||||
keyTextColor:string,
|
||||
/**The value text color of the stats section. */
|
||||
valueTextColor:string,
|
||||
/**The background color of the hide button in the stats section. */
|
||||
hideBackgroundColor:string,
|
||||
/**The text color of the hide button in the stats section. */
|
||||
hideTextColor:string
|
||||
},
|
||||
/**Settings related to the favicon. */
|
||||
favicon:{
|
||||
/**Enable a custom background. */
|
||||
enableCustomFavicon:boolean,
|
||||
/**A link to the custom favicon. */
|
||||
imageUrl:string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
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.
|
||||
/**## ODLiveStatusManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODLiveStatusManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODLiveStatusManagerIds_Default {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
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.
|
||||
/**## ODCooldownManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCooldownManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODCooldownManagerIds_Default {
|
||||
|
||||
@@ -6,8 +6,8 @@ import { ODDatabaseManager, ODDatabase, ODFormattedJsonDatabase } from "../modul
|
||||
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.
|
||||
/**## ODDatabaseManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODDatabaseManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODDatabaseManagerIds_Default {
|
||||
@@ -48,7 +48,7 @@ export class ODDatabaseManager_Default extends ODDatabaseManager {
|
||||
}
|
||||
|
||||
/**## ODFormattedJsonDatabaseIds_DefaultGlobal `type`
|
||||
* This type is an array of ids available in the `ODFormattedJsonDatabase_DefaultGlobal` class.
|
||||
* This interface is a list of ids available in the `ODFormattedJsonDatabase_DefaultGlobal` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODFormattedJsonDatabaseIds_DefaultGlobal {
|
||||
@@ -102,7 +102,7 @@ export class ODFormattedJsonDatabase_DefaultGlobal extends ODFormattedJsonDataba
|
||||
}
|
||||
|
||||
/**## ODFormattedJsonDatabaseIds_DefaultTickets `type`
|
||||
* This type is an array of ids available in the `ODDatabaseManager_Default` class.
|
||||
* This interface is a list of ids available in the `ODDatabaseManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODFormattedJsonDatabaseIds_DefaultTickets {
|
||||
@@ -153,7 +153,7 @@ export class ODFormattedJsonDatabase_DefaultTickets extends ODFormattedJsonDatab
|
||||
}
|
||||
|
||||
/**## ODFormattedJsonDatabaseIds_DefaultUsers `type`
|
||||
* This type is an array of ids available in the `ODDatabaseManager_Default` class.
|
||||
* This interface is a list of ids available in the `ODDatabaseManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODFormattedJsonDatabaseIds_DefaultUsers {
|
||||
@@ -205,7 +205,7 @@ export class ODFormattedJsonDatabase_DefaultUsers extends ODFormattedJsonDatabas
|
||||
|
||||
|
||||
/**## ODFormattedJsonDatabaseIds_DefaultOptions `type`
|
||||
* This type is an array of ids available in the `ODDatabaseManager_Default` class.
|
||||
* This interface is a list of ids available in the `ODDatabaseManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODFormattedJsonDatabaseIds_DefaultOptions {
|
||||
|
||||
@@ -32,6 +32,7 @@ import { ODPostManager_Default } from "./post"
|
||||
import { ODVerifyBarManager_Default } from "./verifybar"
|
||||
import { ODStartScreenManager_Default } from "./startscreen"
|
||||
import { ODLiveStatusManager_Default } from "./console"
|
||||
import { ODProgressBarManager_Default, ODProgressBarRendererManager_Default } from "./progressbar"
|
||||
|
||||
//OPEN TICKET MODULES
|
||||
import { ODOptionManager, ODTicketOption } from "../openticket/option"
|
||||
@@ -42,8 +43,8 @@ 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.
|
||||
/**## ODEventIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODEvent_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODEventIds_Default {
|
||||
@@ -56,11 +57,18 @@ export interface ODEventIds_Default {
|
||||
"onPluginClassLoad": ODEvent_Default<(classes:ODPluginClassManager_Default, plugins:ODPluginManager_Default) => ODPromiseVoid>
|
||||
"afterPluginClassesLoaded": ODEvent_Default<(classes:ODPluginClassManager_Default, plugins:ODPluginManager_Default) => ODPromiseVoid>
|
||||
|
||||
//flags
|
||||
"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>
|
||||
|
||||
//progres bars
|
||||
"onProgressBarRendererLoad": ODEvent_Default<(renderers:ODProgressBarRendererManager_Default) => ODPromiseVoid>
|
||||
"afterProgressBarRenderersLoaded": ODEvent_Default<(renderers:ODProgressBarRendererManager_Default) => ODPromiseVoid>
|
||||
"onProgressBarLoad": ODEvent_Default<(progressbars:ODProgressBarManager_Default) => ODPromiseVoid>
|
||||
"afterProgressBarsLoaded": ODEvent_Default<(progressbars:ODProgressBarManager_Default) => ODPromiseVoid>
|
||||
|
||||
//configs
|
||||
"onConfigLoad": ODEvent_Default<(configs:ODConfigManager_Default) => ODPromiseVoid>
|
||||
"afterConfigsLoaded": ODEvent_Default<(configs:ODConfigManager_Default) => ODPromiseVoid>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
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.
|
||||
/**## ODFlagManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODFlagManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODFlagManagerIds_Default {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
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.
|
||||
/**## ODHelpMenuManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODHelpMenuManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerIds_Default {
|
||||
@@ -48,7 +48,7 @@ export class ODHelpMenuManager_Default extends ODHelpMenuManager {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultGeneral `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultGeneral` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultGeneral` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultGeneral {
|
||||
@@ -86,7 +86,7 @@ export class ODHelpMenuCategory_DefaultGeneral extends ODHelpMenuCategory {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultTicketBasic `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultTicketBasic` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultTicketBasic` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultTicketBasic {
|
||||
@@ -125,7 +125,7 @@ export class ODHelpMenuCategory_DefaultTicketBasic extends ODHelpMenuCategory {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultTicketAdvanced` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultTicketAdvanced` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultTicketAdvanced {
|
||||
@@ -165,7 +165,7 @@ export class ODHelpMenuCategory_DefaultTicketAdvanced extends ODHelpMenuCategory
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultTicketUser `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultTicketUser` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultTicketUser` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultTicketUser {
|
||||
@@ -205,7 +205,7 @@ export class ODHelpMenuCategory_DefaultTicketUser extends ODHelpMenuCategory {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultAdmin `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultAdmin` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultAdmin` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultAdmin {
|
||||
@@ -246,7 +246,7 @@ export class ODHelpMenuCategory_DefaultAdmin extends ODHelpMenuCategory {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultAdvanced `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultAdvanced` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultAdvanced` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultAdvanced {
|
||||
@@ -288,7 +288,7 @@ export class ODHelpMenuCategory_DefaultAdvanced extends ODHelpMenuCategory {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuManagerCategoryIds_DefaultExtra `type`
|
||||
* This type is an array of ids available in the `ODHelpMenuCategory_DefaultExtra` class.
|
||||
* This interface is a list of ids available in the `ODHelpMenuCategory_DefaultExtra` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODHelpMenuManagerCategoryIds_DefaultExtra {}
|
||||
|
||||
@@ -5,7 +5,7 @@ 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.
|
||||
* This interface is a list of ids available in the `ODLanguageManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export type ODLanguageManagerTranslations_Default = (
|
||||
@@ -439,8 +439,8 @@ export type ODLanguageManagerTranslations_Default = (
|
||||
"stats.properties.transcriptsCreated"
|
||||
)
|
||||
|
||||
/**## ODLanguageManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODLanguageManager_Default` class.
|
||||
/**## ODLanguageManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODLanguageManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODLanguageManagerIds_Default {
|
||||
@@ -464,6 +464,9 @@ export interface ODLanguageManagerIds_Default {
|
||||
"openticket:turkish":ODLanguage,
|
||||
"openticket:french":ODLanguage,
|
||||
"openticket:arabic":ODLanguage,
|
||||
"openticket:hindi":ODLanguage,
|
||||
"openticket:lithuanian":ODLanguage,
|
||||
"openticket:polish":ODLanguage,
|
||||
//ADD NEW LANGUAGES HERE!!!
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { ODValidId, ODManagerData } from "../modules/base"
|
||||
import { ODPlugin, ODPluginClassManager, ODPluginManager } from "../modules/plugin"
|
||||
|
||||
/**## ODPluginManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODPluginManager_Default` class.
|
||||
/**## ODPluginManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODPluginManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODPluginManagerIds_Default {}
|
||||
@@ -41,8 +41,8 @@ export class ODPluginManager_Default extends ODPluginManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODPluginClassManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODPluginClassManager_Default` class.
|
||||
/**## ODPluginClassManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODPluginClassManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODPluginClassManagerIds_Default {}
|
||||
|
||||
@@ -5,8 +5,8 @@ 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.
|
||||
/**## ODPostManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODPostManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODPostManagerIds_Default {
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
///////////////////////////////////////
|
||||
//DEFAULT PROGRESS BAR MODULE
|
||||
///////////////////////////////////////
|
||||
import { ODValidId } from "../modules/base"
|
||||
import { ODValidConsoleColor } from "../modules/console"
|
||||
import { ODManualProgressBar, ODProgressBar, ODProgressBarManager, ODProgressBarRenderer, ODProgressBarRendererManager } from "../modules/progressbar"
|
||||
import ansis from "ansis"
|
||||
|
||||
/**## ODProgressBarRenderer_DefaultSettingsLabel `type`
|
||||
* All available label types for the default progress bar renderer
|
||||
*/
|
||||
export type ODProgressBarRenderer_DefaultSettingsLabel = "value"|"percentage"|"fraction"|"time-ms"|"time-sec"|"time-min"
|
||||
|
||||
/**## ODProgressBarRenderer_DefaultSettings `interface`
|
||||
* This interface contains the settings for the default progress bar renderer.
|
||||
*/
|
||||
export interface ODProgressBarRenderer_DefaultSettings {
|
||||
/**The color of the progress bar border. */
|
||||
borderColor:ODValidConsoleColor|"openticket",
|
||||
/**The color of the progress bar (filled side). */
|
||||
filledBarColor:ODValidConsoleColor|"openticket",
|
||||
/**The color of the progress bar (empty side). */
|
||||
emptyBarColor:ODValidConsoleColor|"openticket",
|
||||
/**The color of the text before the progress bar. */
|
||||
prefixColor:ODValidConsoleColor|"openticket",
|
||||
/**The color of the text after the progress bar. */
|
||||
suffixColor:ODValidConsoleColor|"openticket",
|
||||
/**The color of the progress bar label. */
|
||||
labelColor:ODValidConsoleColor|"openticket",
|
||||
|
||||
/**The character used in the left border. */
|
||||
leftBorderChar:string,
|
||||
/**The character used in the right border. */
|
||||
rightBorderChar:string,
|
||||
/**The character used in the filled side of the progress bar. */
|
||||
filledBarChar:string,
|
||||
/**The character used in the empty side of the progress bar. */
|
||||
emptyBarChar:string,
|
||||
/**The label type. (will show a number related to the progress) */
|
||||
labelType:ODProgressBarRenderer_DefaultSettingsLabel,
|
||||
/**The position of the label. */
|
||||
labelPosition:"start"|"end",
|
||||
/**The width of the bar. (50 characters by default) */
|
||||
barWidth:number,
|
||||
|
||||
/**Show the bar. */
|
||||
showBar:boolean,
|
||||
/**Show the label. */
|
||||
showLabel:boolean,
|
||||
/**Show the border. */
|
||||
showBorder:boolean,
|
||||
}
|
||||
|
||||
export class ODProgressBarRenderer_Default extends ODProgressBarRenderer<ODProgressBarRenderer_DefaultSettings> {
|
||||
constructor(id:ODValidId,settings:ODProgressBarRenderer_DefaultSettings){
|
||||
super(id,(settings,min,max,value,rawPrefix,rawSuffix) => {
|
||||
const percentage = (value-min)/(max-min)
|
||||
const barLevel = Math.round(percentage*settings.barWidth)
|
||||
|
||||
const borderAnsis = (settings.borderColor == "openticket") ? ansis.hex("#f8ba00") : ansis[settings.borderColor]
|
||||
const filledBarAnsis = (settings.filledBarColor == "openticket") ? ansis.hex("#f8ba00") : ansis[settings.filledBarColor]
|
||||
const emptyBarAnsis = (settings.emptyBarColor == "openticket") ? ansis.hex("#f8ba00") : ansis[settings.emptyBarColor]
|
||||
const labelAnsis = (settings.labelColor == "openticket") ? ansis.hex("#f8ba00") : ansis[settings.labelColor]
|
||||
const prefixAnsis = (settings.prefixColor == "openticket") ? ansis.hex("#f8ba00") : ansis[settings.prefixColor]
|
||||
const suffixAnsis = (settings.suffixColor == "openticket") ? ansis.hex("#f8ba00") : ansis[settings.suffixColor]
|
||||
|
||||
const leftBorder = (settings.showBorder) ? borderAnsis(settings.leftBorderChar) : ""
|
||||
const rightBorder = (settings.showBorder) ? borderAnsis(settings.rightBorderChar) : ""
|
||||
const bar = (settings.showBar) ? filledBarAnsis(settings.filledBarChar.repeat(barLevel))+emptyBarAnsis(settings.emptyBarChar.repeat(settings.barWidth-barLevel)) : ""
|
||||
const prefix = (rawPrefix) ? prefixAnsis(rawPrefix)+" " : ""
|
||||
const suffix = (rawSuffix) ? " "+suffixAnsis(rawSuffix) : ""
|
||||
let label: string
|
||||
if (!settings.showLabel) label = ""
|
||||
if (settings.labelType == "fraction") label = labelAnsis(value+"/"+max)
|
||||
else if (settings.labelType == "percentage") label = labelAnsis(Math.round(percentage*100)+"%")
|
||||
else if (settings.labelType == "time-ms") label = labelAnsis(value+"ms")
|
||||
else if (settings.labelType == "time-sec") label = labelAnsis(Math.round(value*10)/10+"sec")
|
||||
else if (settings.labelType == "time-min") label = labelAnsis(Math.round(value*10)/10+"min")
|
||||
else label = labelAnsis(value.toString())
|
||||
|
||||
const labelWithPrefixAndSuffix = prefix+label+suffix
|
||||
return (settings.labelPosition == "start") ? labelWithPrefixAndSuffix+" "+leftBorder+bar+rightBorder : leftBorder+bar+rightBorder+" "+labelWithPrefixAndSuffix
|
||||
},settings)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODProgressBarRendererManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODProgressBarRendererManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODProgressBarRendererManagerIds_Default {
|
||||
"openticket:value-renderer":ODProgressBarRenderer_Default,
|
||||
"openticket:fraction-renderer":ODProgressBarRenderer_Default,
|
||||
"openticket:percentage-renderer":ODProgressBarRenderer_Default,
|
||||
"openticket:time-ms-renderer":ODProgressBarRenderer_Default,
|
||||
"openticket:time-sec-renderer":ODProgressBarRenderer_Default,
|
||||
"openticket:time-min-renderer":ODProgressBarRenderer_Default,
|
||||
}
|
||||
|
||||
/**## ODProgressBarRendererManager_Default `default_class`
|
||||
* This is a special class that adds type definitions & typescript to the ODProgressBarRendererManager class.
|
||||
* It doesn't add any extra features!
|
||||
*
|
||||
* This default class is made for the global variable `openticket.progressbars.renderers`!
|
||||
*/
|
||||
export class ODProgressBarRendererManager_Default extends ODProgressBarRendererManager {
|
||||
get<ProgressBarId extends keyof ODProgressBarRendererManagerIds_Default>(id:ProgressBarId): ODProgressBarRendererManagerIds_Default[ProgressBarId]
|
||||
get(id:ODValidId): ODProgressBarRenderer<{}>|null
|
||||
|
||||
get(id:ODValidId): ODProgressBarRenderer<{}>|null {
|
||||
return super.get(id)
|
||||
}
|
||||
|
||||
remove<ProgressBarId extends keyof ODProgressBarRendererManagerIds_Default>(id:ProgressBarId): ODProgressBarRendererManagerIds_Default[ProgressBarId]
|
||||
remove(id:ODValidId): ODProgressBarRenderer<{}>|null
|
||||
|
||||
remove(id:ODValidId): ODProgressBarRenderer<{}>|null {
|
||||
return super.remove(id)
|
||||
}
|
||||
|
||||
exists(id:keyof ODProgressBarRendererManagerIds_Default): boolean
|
||||
exists(id:ODValidId): boolean
|
||||
|
||||
exists(id:ODValidId): boolean {
|
||||
return super.exists(id)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODProgressBarManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODProgressBarManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODProgressBarManagerIds_Default {
|
||||
"openticket:slash-command-remove":ODManualProgressBar,
|
||||
"openticket:slash-command-create":ODManualProgressBar,
|
||||
"openticket:slash-command-update":ODManualProgressBar,
|
||||
}
|
||||
|
||||
/**## ODProgressBarManager_Default `default_class`
|
||||
* This is a special class that adds type definitions & typescript to the ODProgressBarManager class.
|
||||
* It doesn't add any extra features!
|
||||
*
|
||||
* This default class is made for the global variable `openticket.progressbars`!
|
||||
*/
|
||||
export class ODProgressBarManager_Default extends ODProgressBarManager {
|
||||
declare renderers: ODProgressBarRendererManager_Default
|
||||
|
||||
get<ProgressBarId extends keyof ODProgressBarManagerIds_Default>(id:ProgressBarId): ODProgressBarManagerIds_Default[ProgressBarId]
|
||||
get(id:ODValidId): ODProgressBar|null
|
||||
|
||||
get(id:ODValidId): ODProgressBar|null {
|
||||
return super.get(id)
|
||||
}
|
||||
|
||||
remove<ProgressBarId extends keyof ODProgressBarManagerIds_Default>(id:ProgressBarId): ODProgressBarManagerIds_Default[ProgressBarId]
|
||||
remove(id:ODValidId): ODProgressBar|null
|
||||
|
||||
remove(id:ODValidId): ODProgressBar|null {
|
||||
return super.remove(id)
|
||||
}
|
||||
|
||||
exists(id:keyof ODProgressBarManagerIds_Default): boolean
|
||||
exists(id:ODValidId): boolean
|
||||
|
||||
exists(id:ODValidId): boolean {
|
||||
return super.exists(id)
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,8 @@ export class ODResponderManager_Default extends ODResponderManager {
|
||||
declare modals: ODModalResponderManager_Default
|
||||
}
|
||||
|
||||
/**## ODCommandResponderManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODCommandResponderManager_Default` class.
|
||||
/**## ODCommandResponderManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODCommandResponderManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODCommandResponderManagerIds_Default {
|
||||
@@ -86,8 +86,8 @@ export class ODCommandResponder_Default<Source extends "slash"|"text", Params, W
|
||||
declare workers: ODWorkerManager_Default<ODCommandResponderInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODButtonResponderManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODButtonResponderManager_Default` class.
|
||||
/**## ODButtonResponderManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODButtonResponderManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODButtonResponderManagerIds_Default {
|
||||
@@ -153,8 +153,8 @@ export class ODButtonResponder_Default<Source extends string, Params, WorkerIds
|
||||
declare workers: ODWorkerManager_Default<ODButtonResponderInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODDropdownResponderManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODDropdownResponderManager_Default` class.
|
||||
/**## ODDropdownResponderManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODDropdownResponderManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODDropdownResponderManagerIds_Default {
|
||||
@@ -200,8 +200,8 @@ export class ODDropdownResponder_Default<Source extends string, Params, WorkerId
|
||||
declare workers: ODWorkerManager_Default<ODDropdownResponderInstance,Source,Params,WorkerIds>
|
||||
}
|
||||
|
||||
/**## ODModalResponderManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODModalResponderManager_Default` class.
|
||||
/**## ODModalResponderManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODModalResponderManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODModalResponderManagerIds_Default {
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
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.
|
||||
/**## ODSessionManagerIds_Default `interface`
|
||||
* This interface is a list 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
|
||||
//"test-session":ODSession
|
||||
}
|
||||
|
||||
/**## ODSessionManager_Default `default_class`
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
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.
|
||||
/**## ODStartScreenManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODStartScreenManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStartScreenManagerIds_Default {
|
||||
|
||||
@@ -5,8 +5,8 @@ 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.
|
||||
/**## ODStatsManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODStatsManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStatsManagerIds_Default {
|
||||
@@ -47,7 +47,7 @@ export class ODStatsManager_Default extends ODStatsManager {
|
||||
}
|
||||
|
||||
/**## ODStatGlobalScopeIds_DefaultGlobal `type`
|
||||
* This type is an array of ids available in the `ODStatGlobalScope_DefaultGlobal` class.
|
||||
* This interface is a list of ids available in the `ODStatGlobalScope_DefaultGlobal` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStatGlobalScopeIds_DefaultGlobal {
|
||||
@@ -115,7 +115,7 @@ export class ODStatGlobalScope_DefaultGlobal extends ODStatGlobalScope {
|
||||
}
|
||||
|
||||
/**## ODStatGlobalScopeIds_DefaultSystem `type`
|
||||
* This type is an array of ids available in the `ODStatScope_DefaultSystem` class.
|
||||
* This interface is a list of ids available in the `ODStatScope_DefaultSystem` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStatGlobalScopeIds_DefaultSystem {
|
||||
@@ -174,7 +174,7 @@ export class ODStatGlobalScope_DefaultSystem extends ODStatGlobalScope {
|
||||
}
|
||||
|
||||
/**## ODStatScopeIds_DefaultUser `type`
|
||||
* This type is an array of ids available in the `ODStatScope_DefaultUser` class.
|
||||
* This interface is a list of ids available in the `ODStatScope_DefaultUser` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStatScopeIds_DefaultUser {
|
||||
@@ -242,7 +242,7 @@ export class ODStatScope_DefaultUser extends ODStatScope {
|
||||
}
|
||||
|
||||
/**## ODStatScopeIds_DefaultTicket `type`
|
||||
* This type is an array of ids available in the `ODStatScope_DefaultTicket` class.
|
||||
* This interface is a list of ids available in the `ODStatScope_DefaultTicket` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStatScopeIds_DefaultTicket {
|
||||
@@ -305,7 +305,7 @@ export class ODStatScope_DefaultTicket extends ODStatScope {
|
||||
}
|
||||
|
||||
/**## ODStatScopeIds_DefaultParticipants `type`
|
||||
* This type is an array of ids available in the `ODStatScope_DefaultParticipants` class.
|
||||
* This interface is a list of ids available in the `ODStatScope_DefaultParticipants` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODStatScopeIds_DefaultParticipants {
|
||||
|
||||
@@ -7,8 +7,8 @@ import { ODWorkerManager_Default } from "../defaults/worker"
|
||||
import { ODVerifyBarManager, ODVerifyBar } from "../modules/verifybar"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/**## ODVerifyBarManagerIds_Default `type`
|
||||
* This type is an array of ids available in the `ODVerifyBarManager_Default` class.
|
||||
/**## ODVerifyBarManagerIds_Default `interface`
|
||||
* This interface is a list of ids available in the `ODVerifyBarManager_Default` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODVerifyBarManagerIds_Default {
|
||||
|
||||
@@ -25,6 +25,7 @@ import { ODCodeManager_Default } from "./defaults/code"
|
||||
import { ODCooldownManager_Default } from "./defaults/cooldown"
|
||||
import { ODPostManager_Default } from "./defaults/post"
|
||||
import { ODVerifyBarManager_Default } from "./defaults/verifybar"
|
||||
import { ODProgressBarManager_Default } from "./defaults/progressbar"
|
||||
import { ODStartScreenManager_Default } from "./defaults/startscreen"
|
||||
import { ODLiveStatusManager_Default } from "./defaults/console"
|
||||
|
||||
@@ -65,6 +66,8 @@ export class ODMain {
|
||||
plugins: ODPluginManager_Default
|
||||
/**The manager that manages & checks all the console flags of the bot. (like `--debug`) */
|
||||
flags: ODFlagManager_Default
|
||||
/**The manager responsible for progress bars in the console. */
|
||||
progressbars: ODProgressBarManager_Default
|
||||
/**The manager that manages & contains all the config files of the bot. (like `config/general.json`) */
|
||||
configs: ODConfigManager_Default
|
||||
/**The manager that manages & contains all the databases of the bot. (like `database/global.json`) */
|
||||
@@ -136,9 +139,10 @@ export class ODMain {
|
||||
this.console = new ODConsoleManager(100,this.debugfile)
|
||||
this.debug = new ODDebugger(this.console)
|
||||
this.events = new ODEventManager_Default(this.debug)
|
||||
|
||||
|
||||
this.plugins = new ODPluginManager_Default(this.debug)
|
||||
this.flags = new ODFlagManager_Default(this.debug)
|
||||
this.progressbars = new ODProgressBarManager_Default(this.debug)
|
||||
this.configs = new ODConfigManager_Default(this.debug)
|
||||
this.databases = new ODDatabaseManager_Default(this.debug)
|
||||
this.sessions = new ODSessionManager_Default(this.debug)
|
||||
@@ -169,7 +173,7 @@ export class ODMain {
|
||||
this.panels = new ODPanelManager(this.debug)
|
||||
this.tickets = new ODTicketManager(this.debug,this.client)
|
||||
this.blacklist = new ODBlacklistManager(this.debug)
|
||||
this.transcripts = new ODTranscriptManager_Default(this.debug,this.tickets)
|
||||
this.transcripts = new ODTranscriptManager_Default(this.debug,this.tickets,this.client)
|
||||
this.roles = new ODRoleManager(this.debug)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
|
||||
import { ODDebugger } from "./console"
|
||||
|
||||
/**## ODActionImplementation `class`
|
||||
* This is an open ticket action implementation.
|
||||
* This is an Open Ticket action implementation.
|
||||
*
|
||||
* It is a basic implementation of the `ODWorkerManager` used by all `ODAction` classes.
|
||||
*
|
||||
@@ -28,7 +28,7 @@ export class ODActionImplementation<Source extends string,Params extends object,
|
||||
}
|
||||
|
||||
/**## ODActionManager `class`
|
||||
* This is an open ticket action manager.
|
||||
* This is an Open Ticket action manager.
|
||||
*
|
||||
* It contains all Open Ticket actions. You can compare actions with some sort of "procedure".
|
||||
* It's a complicated task that is divided into multiple functions.
|
||||
|
||||
@@ -21,9 +21,9 @@ export type ODOptionalPromise<T> = T|Promise<T>
|
||||
export type ODValidButtonColor = "gray"|"red"|"green"|"blue"
|
||||
|
||||
/**## ODValidId `type`
|
||||
* This is a valid open ticket identifier. It can be an `ODId` or `string`!
|
||||
* This is a valid Open Ticket identifier. It can be an `ODId` or `string`!
|
||||
*
|
||||
* You will see this type in many functions from open ticket.
|
||||
* You will see this type in many functions from Open Ticket.
|
||||
*/
|
||||
export type ODValidId = string|ODId
|
||||
|
||||
@@ -41,21 +41,21 @@ export type ODValidJsonType = string|number|boolean|object|ODValidJsonType[]|nul
|
||||
export type ODInterfaceWithPartialProperty<Interface,Key extends keyof Interface> = Omit<Interface,Key> & Partial<Pick<Interface,Key>>
|
||||
|
||||
/**## ODId `class`
|
||||
* This is an open ticket identifier.
|
||||
* This is an Open Ticket identifier.
|
||||
*
|
||||
* It can only contain the following characters: `a-z`, `A-Z`, `0-9`, `:`, `-` & `_`
|
||||
*
|
||||
* You will use this class to assign a unique id when creating configs, databases, languages & more!
|
||||
* You can use this class to assign a unique id when creating configs, databases, languages & more!
|
||||
* @example
|
||||
* const id = new api.ODId("openticket:test-id") //this is valid
|
||||
* const id = new api.ODId("example%id?") //this is invalid
|
||||
*/
|
||||
export class ODId {
|
||||
/**The full value of this `ODId` as a `string` */
|
||||
/**The full value of this `ODId` as a `string`. */
|
||||
value: string
|
||||
/**The source of the id (part before `:`). For example `openticket` for all built-in ids! */
|
||||
/**The source of the id (text before `:`). (e.g. `openticket` for all built-in ids) */
|
||||
source: string
|
||||
/**The identifier of the id (part after `:`). */
|
||||
/**The identifier of the id (text after `:`). */
|
||||
identifier: string
|
||||
|
||||
constructor(id:ODValidId){
|
||||
@@ -99,10 +99,10 @@ export class ODId {
|
||||
}
|
||||
|
||||
/**## ODManagerChangeHelper `class`
|
||||
* This is an open ticket manager change helper.
|
||||
* This is an Open Ticket manager change helper.
|
||||
*
|
||||
* It is used to let the "onChange" event in the `ODManager` class work.
|
||||
* You will probably use this class when extending your own `ODManager`
|
||||
* You can use this class when extending your own `ODManager`
|
||||
*/
|
||||
export class ODManagerChangeHelper {
|
||||
#change: (() => void)|null = null
|
||||
@@ -117,14 +117,14 @@ export class ODManagerChangeHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
/****(❌ SYSTEM ONLY!!)** Set the callback executed when a value inside this class changes */
|
||||
/****(❌ SYSTEM ONLY!!)** Set the callback executed when a value inside this class changes. */
|
||||
changed(callback:(() => void)|null){
|
||||
this.#change = callback
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODManagerRedirectHelper `class`
|
||||
* This is open ticket ticket manager redirect helper.
|
||||
* This is Open Ticket ticket manager redirect helper.
|
||||
*
|
||||
* It is used to redirect a source to another source when the id isn't found.
|
||||
*
|
||||
@@ -163,14 +163,14 @@ export class ODManagerRedirectHelper {
|
||||
}
|
||||
|
||||
/**## ODManagerData `class`
|
||||
* This is open ticket manager data.
|
||||
* This is Open Ticket manager data.
|
||||
*
|
||||
* It provides a template for all classes that are used in the `ODManager`.
|
||||
*
|
||||
* There is an `id:ODId` property & also some events used in the manager.
|
||||
*/
|
||||
export class ODManagerData extends ODManagerChangeHelper {
|
||||
/**The id of this data */
|
||||
/**The id of this data. */
|
||||
id: ODId
|
||||
|
||||
constructor(id:ODValidId){
|
||||
@@ -190,15 +190,16 @@ export type ODManagerCallback<DataType extends ODManagerData> = (data:DataType)
|
||||
export type ODManagerAddCallback<DataType extends ODManagerData> = (data:DataType, overwritten:boolean) => void
|
||||
|
||||
/**## ODManager `class`
|
||||
* This is an open ticket manager.
|
||||
* This is an Open Ticket manager.
|
||||
*
|
||||
* It can be used to store & manage different aspects of the bot!
|
||||
* You will probably to extend this class when creating your own classes & managers.
|
||||
* It can be used to store & manage classes based on their `ODId`.
|
||||
* It is somewhat the same as the default JS `Map()`.
|
||||
* You can extend this class when creating your own classes & managers.
|
||||
*
|
||||
* This class has many useful functions based on `ODId` (add, get, remove, getAll, getFiltered, exists)
|
||||
* This class has many useful functions based on `ODId` (add, get, remove, getAll, getFiltered, exists, loopAll, ...)
|
||||
*/
|
||||
export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHelper {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug?: ODDebugger
|
||||
/**The message to send when debugging this manager. */
|
||||
#debugname?: string
|
||||
@@ -382,7 +383,7 @@ export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHe
|
||||
await cb(data,data.id)
|
||||
}
|
||||
}
|
||||
/**Use the open ticket debugger in this manager for logs*/
|
||||
/**Use the Open Ticket debugger in this manager for logs*/
|
||||
useDebug(debug?:ODDebugger, debugname?:string){
|
||||
this.#debug = debug
|
||||
this.#debugname = debugname
|
||||
@@ -402,7 +403,7 @@ export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHe
|
||||
}
|
||||
|
||||
/**## ODManagerWithSafety `class`
|
||||
* This is an open ticket safe manager.
|
||||
* This is an Open Ticket safe manager.
|
||||
*
|
||||
* It functions exactly the same as a normal `ODManager`, but it has 1 function extra!
|
||||
* The `getSafe()` function will always return data, because when it doesn't find an id, it returns pre-configured backup data.
|
||||
@@ -434,7 +435,7 @@ export class ODManagerWithSafety<DataType extends ODManagerData> extends ODManag
|
||||
}
|
||||
|
||||
/**## ODVersionManager `class`
|
||||
* A open ticket version manager.
|
||||
* A Open Ticket version manager.
|
||||
*
|
||||
* It is used to manage different `ODVersion`'s from the bot. You will use it to check which version of the bot is used.
|
||||
*/
|
||||
@@ -445,11 +446,11 @@ export class ODVersionManager extends ODManager<ODVersion> {
|
||||
}
|
||||
|
||||
/**## ODVersion `class`
|
||||
* This is an open ticket version.
|
||||
* This is an Open Ticket version.
|
||||
*
|
||||
* It has many features like comparing versions & checking if they are compatible.
|
||||
*
|
||||
* You can use it in your own plugin, but most of the time you will use it to check the open ticket version!
|
||||
* You can use it in your own plugin, but most of the time you will use it to check the Open Ticket version!
|
||||
*/
|
||||
export class ODVersion extends ODManagerData {
|
||||
/**The first number of the version (example: `v1.2.3` => `1`) */
|
||||
@@ -725,7 +726,7 @@ export class ODEnvHelper {
|
||||
/**## ODSystemError `class`
|
||||
* A wrapper for the node.js `Error` class that makes the error look better in the console!
|
||||
*
|
||||
* This wrapper is made for open ticket system errors! **It can only be used by open ticket itself!**
|
||||
* This wrapper is made for Open Ticket system errors! **It can only be used by Open Ticket itself!**
|
||||
*/
|
||||
export class ODSystemError extends Error {
|
||||
/**This variable gets detected by the error handling system to know how to render it */
|
||||
@@ -741,7 +742,7 @@ export class ODSystemError extends Error {
|
||||
/**## ODPluginError `class`
|
||||
* A wrapper for the node.js `Error` class that makes the error look better in the console!
|
||||
*
|
||||
* This wrapper is made for open ticket plugin errors! **It can only be used by plugins!**
|
||||
* This wrapper is made for Open Ticket plugin errors! **It can only be used by plugins!**
|
||||
*/
|
||||
export class ODPluginError extends Error {
|
||||
/**This variable gets detected by the error handling system to know how to render it */
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
|
||||
import { ODDebugger } from "./console"
|
||||
|
||||
/**## ODBuilderImplementation `class`
|
||||
* This is an open ticket builder implementation.
|
||||
* This is an Open Ticket builder implementation.
|
||||
*
|
||||
* It is a basic implementation of the `ODWorkerManager` used by all `ODBuilder` classes.
|
||||
*
|
||||
@@ -48,7 +48,7 @@ export class ODBuilderImplementation<Instance,Source extends string,Params,Build
|
||||
}
|
||||
|
||||
/**## ODBuilderManager `class`
|
||||
* This is an open ticket builder manager.
|
||||
* This is an Open Ticket builder manager.
|
||||
*
|
||||
* It contains all Open Ticket builders. You can find messages, embeds, files & dropdowns, buttons & modals all here!
|
||||
*
|
||||
@@ -96,7 +96,7 @@ export interface ODComponentBuildResult {
|
||||
}
|
||||
|
||||
/**## ODButtonManager `class`
|
||||
* This is an open ticket button manager.
|
||||
* This is an Open Ticket button manager.
|
||||
*
|
||||
* It contains all Open Ticket button builders. Here, you can add your own buttons or edit existing ones!
|
||||
*
|
||||
@@ -147,7 +147,7 @@ export interface ODButtonData {
|
||||
}
|
||||
|
||||
/**## ODButtonInstance `class`
|
||||
* This is an open ticket button instance.
|
||||
* This is an Open Ticket button instance.
|
||||
*
|
||||
* It contains all properties & functions to build a button!
|
||||
*/
|
||||
@@ -201,7 +201,7 @@ export class ODButtonInstance {
|
||||
}
|
||||
|
||||
/**## ODButton `class`
|
||||
* This is an open ticket button builder.
|
||||
* This is an Open Ticket button builder.
|
||||
*
|
||||
* With this class, you can create a button to use in a message.
|
||||
* The only difference with normal buttons is that this one can be edited by Open Ticket plugins!
|
||||
@@ -246,7 +246,7 @@ export class ODButton<Source extends string,Params> extends ODBuilderImplementat
|
||||
}
|
||||
|
||||
/**## ODDropdownManager `class`
|
||||
* This is an open ticket dropdown manager.
|
||||
* This is an Open Ticket dropdown manager.
|
||||
*
|
||||
* It contains all Open Ticket dropdown builders. Here, you can add your own dropdowns or edit existing ones!
|
||||
*
|
||||
@@ -309,7 +309,7 @@ export interface ODDropdownData {
|
||||
}
|
||||
|
||||
/**## ODDropdownInstance `class`
|
||||
* This is an open ticket dropdown instance.
|
||||
* This is an Open Ticket dropdown instance.
|
||||
*
|
||||
* It contains all properties & functions to build a dropdown!
|
||||
*/
|
||||
@@ -394,7 +394,7 @@ export class ODDropdownInstance {
|
||||
}
|
||||
|
||||
/**## ODDropdown `class`
|
||||
* This is an open ticket dropdown builder.
|
||||
* This is an Open Ticket dropdown builder.
|
||||
*
|
||||
* With this class, you can create a dropdown to use in a message.
|
||||
* The only difference with normal dropdowns is that this one can be edited by Open Ticket plugins!
|
||||
@@ -500,7 +500,7 @@ export class ODDropdown<Source extends string,Params> extends ODBuilderImplement
|
||||
}
|
||||
|
||||
/**## ODFileManager `class`
|
||||
* This is an open ticket file manager.
|
||||
* This is an Open Ticket file manager.
|
||||
*
|
||||
* It contains all Open Ticket file builders. Here, you can add your own files or edit existing ones!
|
||||
*
|
||||
@@ -544,7 +544,7 @@ export interface ODFileBuildResult {
|
||||
}
|
||||
|
||||
/**## ODFileInstance `class`
|
||||
* This is an open ticket file instance.
|
||||
* This is an Open Ticket file instance.
|
||||
*
|
||||
* It contains all properties & functions to build a file!
|
||||
*/
|
||||
@@ -585,7 +585,7 @@ export class ODFileInstance {
|
||||
}
|
||||
|
||||
/**## ODFile `class`
|
||||
* This is an open ticket file builder.
|
||||
* This is an Open Ticket file builder.
|
||||
*
|
||||
* With this class, you can create a file to use in a message.
|
||||
* The only difference with normal files is that this one can be edited by Open Ticket plugins!
|
||||
@@ -623,7 +623,7 @@ export class ODFile<Source extends string,Params> extends ODBuilderImplementatio
|
||||
}
|
||||
|
||||
/**## ODEmbedManager `class`
|
||||
* This is an open ticket embed manager.
|
||||
* This is an Open Ticket embed manager.
|
||||
*
|
||||
* It contains all Open Ticket embed builders. Here, you can add your own embeds or edit existing ones!
|
||||
*
|
||||
@@ -686,7 +686,7 @@ export interface ODEmbedBuildResult {
|
||||
}
|
||||
|
||||
/**## ODEmbedInstance `class`
|
||||
* This is an open ticket embed instance.
|
||||
* This is an Open Ticket embed instance.
|
||||
*
|
||||
* It contains all properties & functions to build an embed!
|
||||
*/
|
||||
@@ -786,7 +786,7 @@ export class ODEmbedInstance {
|
||||
}
|
||||
|
||||
/**## ODEmbed `class`
|
||||
* This is an open ticket embed builder.
|
||||
* This is an Open Ticket embed builder.
|
||||
*
|
||||
* With this class, you can create a embed to use in a message.
|
||||
* The only difference with normal embeds is that this one can be edited by Open Ticket plugins!
|
||||
@@ -837,7 +837,7 @@ export class ODEmbed<Source extends string,Params> extends ODBuilderImplementati
|
||||
}
|
||||
|
||||
/**## ODMessageManager `class`
|
||||
* This is an open ticket message manager.
|
||||
* This is an Open Ticket message manager.
|
||||
*
|
||||
* It contains all Open Ticket message builders. Here, you can add your own messages or edit existing ones!
|
||||
*
|
||||
@@ -899,7 +899,7 @@ export interface ODMessageBuildSentResult<InGuild extends boolean> {
|
||||
}
|
||||
|
||||
/**## ODMessageInstance `class`
|
||||
* This is an open ticket message instance.
|
||||
* This is an Open Ticket message instance.
|
||||
*
|
||||
* It contains all properties & functions to build a message!
|
||||
*/
|
||||
@@ -1002,7 +1002,7 @@ export class ODMessageInstance {
|
||||
}
|
||||
|
||||
/**## ODMessage `class`
|
||||
* This is an open ticket message builder.
|
||||
* This is an Open Ticket message builder.
|
||||
*
|
||||
* With this class, you can create a message to send in a discord channel.
|
||||
* The only difference with normal messages is that this one can be edited by Open Ticket plugins!
|
||||
@@ -1078,7 +1078,7 @@ export class ODMessage<Source extends string,Params> extends ODBuilderImplementa
|
||||
}
|
||||
|
||||
/**## ODModalManager `class`
|
||||
* This is an open ticket modal manager.
|
||||
* This is an Open Ticket modal manager.
|
||||
*
|
||||
* It contains all Open Ticket modal builders. Here, you can add your own modals or edit existing ones!
|
||||
*
|
||||
@@ -1149,7 +1149,7 @@ export interface ODModalBuildResult {
|
||||
}
|
||||
|
||||
/**## ODModalInstance `class`
|
||||
* This is an open ticket modal instance.
|
||||
* This is an Open Ticket modal instance.
|
||||
*
|
||||
* It contains all properties & functions to build a modal!
|
||||
*/
|
||||
@@ -1196,7 +1196,7 @@ export class ODModalInstance {
|
||||
}
|
||||
|
||||
/**## ODModal `class`
|
||||
* This is an open ticket modal builder.
|
||||
* This is an Open Ticket modal builder.
|
||||
*
|
||||
* With this class, you can create a modal to use as response in interactions.
|
||||
* The only difference with normal modals is that this one can be edited by Open Ticket plugins!
|
||||
|
||||
@@ -15,11 +15,11 @@ export interface ODCheckerResult {
|
||||
}
|
||||
|
||||
/**## ODCheckerManager `class`
|
||||
* This is an open ticket checker manager.
|
||||
* This is an Open Ticket checker manager.
|
||||
*
|
||||
* It manages all config checkers in the bot and allows plugins to access config checkers from open ticket & other plugins!
|
||||
* It manages all config checkers in the bot and allows plugins to access config checkers from Open Ticket & other plugins!
|
||||
*
|
||||
* You will use this class to get/add a config checker (`ODChecker`) in your plugin!
|
||||
* You can use this class to get/add a config checker (`ODChecker`) in your plugin!
|
||||
* @example
|
||||
* //get checker for ./config/general.json => ODChecker class
|
||||
* const testChecker = openticket.checkers.get("openticket:general")
|
||||
@@ -93,13 +93,13 @@ export class ODCheckerManager extends ODManager<ODChecker> {
|
||||
}
|
||||
|
||||
/**## ODCheckerStorage `class`
|
||||
* This is an open ticket checker storage.
|
||||
* This is an Open Ticket checker storage.
|
||||
*
|
||||
* It stores temporary data to share between config checkers!
|
||||
* (e.g. The `messages.json` needs to access the `"id"` from `options.json`)
|
||||
*
|
||||
*
|
||||
* You will probably use this class when you create your own config checker!
|
||||
* You can use this class when you create your own config checker implementation! (not required for using the built-in config checker)
|
||||
*/
|
||||
export class ODCheckerStorage {
|
||||
/**This is the array that stores all the data. ❌ **(don't edit unless really needed!)***/
|
||||
@@ -145,12 +145,12 @@ export class ODCheckerStorage {
|
||||
}
|
||||
|
||||
/**## ODCheckerRenderer `class`
|
||||
* This is an open ticket checker renderer.
|
||||
* This is an Open Ticket checker renderer.
|
||||
*
|
||||
* It's responsible for rendering the config checker result in the console.
|
||||
* This class doesn't provide any components! You need to create them by extending this class
|
||||
*
|
||||
* You will only use this class if you want to change how the config checker looks!
|
||||
* You can use this class if you want to change how the config checker looks!
|
||||
*/
|
||||
export class ODCheckerRenderer {
|
||||
/**Get all components */
|
||||
@@ -169,12 +169,12 @@ export class ODCheckerRenderer {
|
||||
}
|
||||
|
||||
/**## ODCheckerTranslationRegister `class`
|
||||
* This is an open ticket checker translation register.
|
||||
* This is an Open Ticket checker translation register.
|
||||
*
|
||||
* It's used to store & manage the translation for each message from the config checker!
|
||||
* Most translations are stored by message id, but there are some exceptions like the additional text on the checker report.
|
||||
*
|
||||
* You will use this class if you want to translate your config checker messages! **This is optional & isn't required for the checker to work!**
|
||||
* You can use this class if you want to translate your config checker messages! **This is optional & isn't required for the checker to work!**
|
||||
*/
|
||||
export class ODCheckerTranslationRegister {
|
||||
/**This is the array that stores all the data. ❌ **(don't edit unless really needed!)***/
|
||||
@@ -227,7 +227,7 @@ export class ODCheckerTranslationRegister {
|
||||
}
|
||||
|
||||
/**## ODCheckerFunction `class`
|
||||
* This is an open ticket config checker function.
|
||||
* This is an Open Ticket config checker function.
|
||||
*
|
||||
* It is a global function that will be executed after all config checkers. It can do additional checks for invalid/missing configurations.
|
||||
* It's mostly used for things that need to be checked globally!
|
||||
@@ -243,7 +243,7 @@ export class ODCheckerFunction extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODCheckerFunctionManager `class`
|
||||
* This is an open ticket config checker function manager.
|
||||
* This is an Open Ticket config checker function manager.
|
||||
*
|
||||
* It manages all `ODCheckerFunction`'s and it has some extra shortcuts for frequently used methods.
|
||||
*/
|
||||
@@ -293,12 +293,12 @@ export class ODCheckerFunctionManager extends ODManager<ODCheckerFunction> {
|
||||
export type ODCheckerLocationTrace = (string|number)[]
|
||||
|
||||
/**## ODChecker `class`
|
||||
* This is an open ticket config checker.
|
||||
* This is an Open Ticket config checker.
|
||||
*
|
||||
* It checks a specific config file for invalid/missing configurations. This data can then be used to show to the user what's wrong!
|
||||
* You can check for example if a string is longer/shorter than a certain amount of characters & more!
|
||||
*
|
||||
* You will use this class when you create your own custom config file & you want to check it for syntax errors.
|
||||
* You can use this class when you create your own custom config file & you want to check it for syntax errors.
|
||||
* @example
|
||||
* //create a new checker with id "test" => ./config/test.json
|
||||
* const testConfig = new api.ODConfig("test","test.json")
|
||||
@@ -398,19 +398,19 @@ export interface ODCheckerMessage {
|
||||
* This interface has the basic options for the `ODCheckerStructure`!
|
||||
*/
|
||||
export interface ODCheckerStructureOptions {
|
||||
/**Add a custom checker function */
|
||||
/**Add a custom checker function. Returns `true` when valid. */
|
||||
custom?:(checker:ODChecker, value:ODValidJsonType, locationTrace:ODCheckerLocationTrace, locationId:ODId, locationDocs:string|null) => boolean,
|
||||
/**Set the url to the documentation of this variable. */
|
||||
docs?:string
|
||||
}
|
||||
|
||||
/**## ODCheckerStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for a single variable in a config file, customise it in the settings!
|
||||
* If you want prebuilt checkers (for strings, booleans, numbers, ...), check the other `ODCheckerStructure`'s!
|
||||
*
|
||||
* You will almost never use this class! It's better if you extend on another `ODConfigCheckerStructure`!
|
||||
* **Not recommended to use!** It's recommended to extend from another `ODConfigCheckerStructure` class!
|
||||
*/
|
||||
export class ODCheckerStructure {
|
||||
/**The id of this checker structure */
|
||||
@@ -423,7 +423,7 @@ export class ODCheckerStructure {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
/**Check a variable if it matches all settings in this checker. This function is automatically executed by open ticket! */
|
||||
/**Check a variable if it matches all settings in this checker. This function is automatically executed by Open Ticket! */
|
||||
check(checker:ODChecker, value:ODValidJsonType, locationTrace:ODCheckerLocationTrace): boolean {
|
||||
if (typeof this.options.custom != "undefined"){
|
||||
return this.options.custom(checker,value,locationTrace,this.id,(this.options.docs ?? null))
|
||||
@@ -440,7 +440,7 @@ export interface ODCheckerObjectStructureOptions extends ODCheckerStructureOptio
|
||||
}
|
||||
|
||||
/**## ODCheckerObjectStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for an object variable in a config file, customise it in the settings!
|
||||
* A checker for the children can be set in the settings.
|
||||
@@ -514,7 +514,7 @@ export interface ODCheckerStringStructureOptions extends ODCheckerStructureOptio
|
||||
}
|
||||
|
||||
/**## ODCheckerStringStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for a string variable in a config file, customise it in the settings!
|
||||
*/
|
||||
@@ -599,7 +599,7 @@ export interface ODCheckerNumberStructureOptions extends ODCheckerStructureOptio
|
||||
}
|
||||
|
||||
/**## ODCheckerNumberStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for a number variable in a config file, customise it in the settings!
|
||||
*/
|
||||
@@ -681,7 +681,7 @@ export interface ODCheckerBooleanStructureOptions extends ODCheckerStructureOpti
|
||||
}
|
||||
|
||||
/**## ODCheckerBooleanStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for a boolean variable in a config file, customise it in the settings!
|
||||
*/
|
||||
@@ -732,7 +732,7 @@ export interface ODCheckerArrayStructureOptions extends ODCheckerStructureOption
|
||||
}
|
||||
|
||||
/**## ODCheckerArrayStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for an array variable in a config file, customise it in the settings!
|
||||
*/
|
||||
@@ -835,7 +835,7 @@ export interface ODCheckerNullStructureOptions extends ODCheckerStructureOptions
|
||||
}
|
||||
|
||||
/**## ODCheckerNullStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will check for a null variable in a config file, customise it in the settings!
|
||||
*/
|
||||
@@ -885,7 +885,7 @@ export interface ODCheckerTypeSwitchStructureOptions extends ODCheckerStructureO
|
||||
}
|
||||
|
||||
/**## ODCheckerTypeSwitchStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will switch checkers based on the type of the variable in a config file, customise it in the settings!
|
||||
*/
|
||||
@@ -948,7 +948,7 @@ export interface ODCheckerObjectSwitchStructureOptions extends ODCheckerStructur
|
||||
}
|
||||
|
||||
/**## ODCheckerObjectSwitchStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will switch object checkers based on a variable match in one of the objects, customise it in the settings!
|
||||
*/
|
||||
@@ -1011,7 +1011,7 @@ export interface ODCheckerEnabledObjectStructureOptions extends ODCheckerStructu
|
||||
}
|
||||
|
||||
/**## ODCheckerEnabledObjectStructure `class`
|
||||
* This is an open ticket config checker structure.
|
||||
* This is an Open Ticket config checker structure.
|
||||
*
|
||||
* This class will enable an object checker based on a variable match in the object, customise it in the settings!
|
||||
*/
|
||||
@@ -1049,7 +1049,7 @@ export class ODCheckerEnabledObjectStructure extends ODCheckerStructure {
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_DiscordId `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1089,7 +1089,7 @@ export class ODCheckerCustomStructure_DiscordId extends ODCheckerStringStructure
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_DiscordIdArray `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1113,7 +1113,7 @@ export class ODCheckerCustomStructure_DiscordIdArray extends ODCheckerArrayStruc
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_DiscordToken `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1138,7 +1138,7 @@ export class ODCheckerCustomStructure_DiscordToken extends ODCheckerStringStruct
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_DiscordToken `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1172,7 +1172,7 @@ export class ODCheckerCustomStructure_HexColor extends ODCheckerStringStructure
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_EmojiString `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1239,7 +1239,7 @@ export interface ODCheckerCustomStructureOptions_UrlString {
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_UrlString `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1343,7 +1343,7 @@ export class ODCheckerCustomStructure_UrlString extends ODCheckerStringStructure
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_UniqueId `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1382,7 +1382,7 @@ export class ODCheckerCustomStructure_UniqueId extends ODCheckerStringStructure
|
||||
}
|
||||
|
||||
/**## ODCheckerCustomStructure_UniqueIdArray `class`
|
||||
* This is an open ticket custom checker structure.
|
||||
* This is an Open Ticket custom checker structure.
|
||||
*
|
||||
* This class extends a primitive config checker & adds another layer of checking in the `custom` function.
|
||||
* You can compare it to a blueprint for a specific checker.
|
||||
@@ -1468,4 +1468,4 @@ export class ODCheckerCustomStructure_Template extends ODCheckerTemplateStructur
|
||||
this.idk = idk
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
+463
-153
@@ -3,8 +3,10 @@
|
||||
///////////////////////////////////////
|
||||
import { ODId, ODManager, ODManagerData, ODSystemError, ODValidId } from "./base"
|
||||
import * as discord from "discord.js"
|
||||
import {REST} from "@discordjs/rest"
|
||||
import { ODConsoleWarningMessage, ODDebugger } from "./console"
|
||||
import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder"
|
||||
import { ODManualProgressBar } from "./progressbar"
|
||||
|
||||
/**## ODClientIntents `type`
|
||||
* A list of intents required when inviting the bot.
|
||||
@@ -24,14 +26,14 @@ export type ODClientPartials = ("User"|"Channel"|"GuildMember"|"Message"|"Reacti
|
||||
export type ODClientPermissions = ("CreateInstantInvite"|"KickMembers"|"BanMembers"|"Administrator"|"ManageChannels"|"ManageGuild"|"AddReactions"|"ViewAuditLog"|"PrioritySpeaker"|"Stream"|"ViewChannel"|"SendMessages"|"SendTTSMessages"|"ManageMessages"|"EmbedLinks"|"AttachFiles"|"ReadMessageHistory"|"MentionEveryone"|"UseExternalEmojis"|"ViewGuildInsights"|"Connect"|"Speak"|"MuteMembers"|"DeafenMembers"|"MoveMembers"|"UseVAD"|"ChangeNickname"|"ManageNicknames"|"ManageRoles"|"ManageWebhooks"|"ManageGuildExpressions"|"UseApplicationCommands"|"RequestToSpeak"|"ManageEvents"|"ManageThreads"|"CreatePublicThreads"|"CreatePrivateThreads"|"UseExternalStickers"|"SendMessagesInThreads"|"UseEmbeddedActivities"|"ModerateMembers"|"ViewCreatorMonetizationAnalytics"|"UseSoundboard"|"UseExternalSounds"|"SendVoiceMessages")
|
||||
|
||||
/**## ODClientManager `class`
|
||||
* This is an open ticket client manager.
|
||||
* This is an Open Ticket client manager.
|
||||
*
|
||||
* It is responsible for managing the discord.js client. Here, you can set the status, register slash commands and much more!
|
||||
*
|
||||
* If you want, you can also listen for custom events on the `ODClientManager.client` variable (`discord.Client`)
|
||||
*/
|
||||
export class ODClientManager {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
/**List of required bot intents. Add intents to this list using the `onClientLoad` event. */
|
||||
@@ -42,11 +44,21 @@ export class ODClientManager {
|
||||
partials: ODClientPartials[] = []
|
||||
/**List of required bot permissions. Add permissions to this list using the `onClientLoad` event. */
|
||||
permissions: ODClientPermissions[] = []
|
||||
/**The bot token, empty by default. */
|
||||
token: string = ""
|
||||
/**The discord bot token, empty by default. */
|
||||
set token(value:string){
|
||||
this.#token = value
|
||||
this.rest.setToken(value)
|
||||
}
|
||||
get token(){
|
||||
return this.#token
|
||||
}
|
||||
/**The discord bot token. **DON'T USE THIS!!!** (use `ODClientManager.token` instead) */
|
||||
#token: string = ""
|
||||
|
||||
/**The discord.js `discord.Client`. Only use it when initiated! */
|
||||
client: discord.Client<true> = new discord.Client({intents:[]}) //temporary client
|
||||
/**The discord.js REST client. Used for stuff that discord.js can't handle :) */
|
||||
rest: discord.REST = new REST({version:"10"})
|
||||
/**Is the bot initiated? */
|
||||
initiated: boolean = false
|
||||
/**Is the bot logged in? */
|
||||
@@ -56,7 +68,7 @@ export class ODClientManager {
|
||||
|
||||
/**The main server of the bot. Provided by serverId in the config */
|
||||
mainServer: discord.Guild|null = null
|
||||
/**(❌ DO NOD OVERWRITE ❌) Internal open ticket function to continue the startup when the client is ready! */
|
||||
/**(❌ DO NOD OVERWRITE ❌) Internal Open Ticket function to continue the startup when the client is ready! */
|
||||
readyListener: (() => Promise<void>)|null = null
|
||||
/**The status manager is responsible for setting the bot status. */
|
||||
activity: ODClientActivityManager
|
||||
@@ -146,9 +158,11 @@ export class ODClientManager {
|
||||
this.#debug.debug("Finished discord.js client.login()")
|
||||
this.loggedIn = true
|
||||
}catch(err){
|
||||
if (err.message.toLowerCase() == "used disallowed intents"){
|
||||
if (err.message.toLowerCase().includes("used disallowed intents")){
|
||||
process.emit("uncaughtException",new ODSystemError("Used disallowed intents"))
|
||||
}else reject("login error: "+err)
|
||||
}else if (err.message.toLowerCase().includes("tokeninvalid") || err.message.toLowerCase().includes("an invalid token was provided")){
|
||||
process.emit("uncaughtException",new ODSystemError("Invalid discord bot token provided"))
|
||||
}else reject("OT Login Error: "+err)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -319,14 +333,14 @@ export type ODClientActivityStatus = ("online"|"invisible"|"idle"|"dnd")
|
||||
|
||||
|
||||
/**## ODClientActivityManager `class`
|
||||
* This is an open ticket client activity manager.
|
||||
* This is an Open Ticket client activity manager.
|
||||
*
|
||||
* It's responsible for managing the client status. Here, you can set the activity & status of the bot.
|
||||
*
|
||||
* It also has a built-in refresh function, so the status will refresh every 10 minutes to keep it visible.
|
||||
*/
|
||||
export class ODClientActivityManager {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
/**Copy of discord.js client */
|
||||
@@ -381,7 +395,7 @@ export class ODClientActivityManager {
|
||||
this.manager.client.user.setPresence({
|
||||
activities:[{
|
||||
type:this.#getStatusTypeEnum(type),
|
||||
state:text,
|
||||
state:undefined,
|
||||
name:text,
|
||||
}],
|
||||
status:this.status
|
||||
@@ -402,23 +416,366 @@ export class ODClientActivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODSlashCommandUniversalTranslation `interface`
|
||||
* A universal template for a slash command translation. (used in names & descriptions)
|
||||
*
|
||||
* Why universal? Both **existing slash commands** & **unregistered templates** can be converted to this type.
|
||||
*/
|
||||
export interface ODSlashCommandUniversalTranslation {
|
||||
/**The language code or locale of this language. */
|
||||
language:`${discord.Locale}`,
|
||||
/**The translation of the name in this language. */
|
||||
value:string
|
||||
}
|
||||
|
||||
/**## ODSlashCommandUniversalOptionChoice `interface`
|
||||
* A universal template for a slash command option choice. (used in `string` options)
|
||||
*
|
||||
* Why universal? Both **existing slash commands** & **unregistered templates** can be converted to this type.
|
||||
*/
|
||||
export interface ODSlashCommandUniversalOptionChoice {
|
||||
/**The name of this choice. */
|
||||
name:string,
|
||||
/**All localized names of this choice. */
|
||||
nameLocalizations:readonly ODSlashCommandUniversalTranslation[],
|
||||
/**The value of this choice. */
|
||||
value:string
|
||||
}
|
||||
|
||||
/**## ODSlashCommandUniversalOption `interface`
|
||||
* A universal template for a slash command option.
|
||||
*
|
||||
* Why universal? Both **existing slash commands** & **unregistered templates** can be converted to this type.
|
||||
*/
|
||||
export interface ODSlashCommandUniversalOption {
|
||||
/**The type of this option. */
|
||||
type:discord.ApplicationCommandOptionType,
|
||||
/**The name of this option. */
|
||||
name:string,
|
||||
/**All localized names of this option. */
|
||||
nameLocalizations:readonly ODSlashCommandUniversalTranslation[],
|
||||
/**The description of this option. */
|
||||
description:string,
|
||||
/**All localized descriptions of this option. */
|
||||
descriptionLocalizations:readonly ODSlashCommandUniversalTranslation[],
|
||||
/**Is this option required? */
|
||||
required:boolean,
|
||||
|
||||
/**Is autocomplete enabled in this option? */
|
||||
autocomplete:boolean|null,
|
||||
/**Choices for this option (only when type is `string`) */
|
||||
choices:ODSlashCommandUniversalOptionChoice[],
|
||||
/**A list of sub-options for this option (only when type is `subCommand` or `subCommandGroup`) */
|
||||
options:readonly ODSlashCommandUniversalOption[],
|
||||
/**A list of allowed channel types for this option (only when type is `channel`) */
|
||||
channelTypes:readonly discord.ChannelType[],
|
||||
/**The minimum amount required for this option (only when type is `number` or `integer`) */
|
||||
minValue:number|null,
|
||||
/**The maximum amount required for this option (only when type is `number` or `integer`) */
|
||||
maxValue:number|null,
|
||||
/**The minimum length required for this option (only when type is `string`) */
|
||||
minLength:number|null,
|
||||
/**The maximum length required for this option (only when type is `string`) */
|
||||
maxLength:number|null
|
||||
}
|
||||
|
||||
/**## ODSlashCommandUniversalCommand `interface`
|
||||
* A universal template for a slash command.
|
||||
*
|
||||
* Why universal? Both **existing slash commands** & **unregistered templates** can be converted to this type.
|
||||
*/
|
||||
export interface ODSlashCommandUniversalCommand {
|
||||
/**The type of this command. (required => `ChatInput`) */
|
||||
type:discord.ApplicationCommandType.ChatInput,
|
||||
/**The name of this command. */
|
||||
name:string,
|
||||
/**All localized names of this command. */
|
||||
nameLocalizations:readonly ODSlashCommandUniversalTranslation[],
|
||||
/**The description of this command. */
|
||||
description:string,
|
||||
/**All localized descriptions of this command. */
|
||||
descriptionLocalizations:readonly ODSlashCommandUniversalTranslation[],
|
||||
/**The id of the guild this command is registered in. */
|
||||
guildId:string|null,
|
||||
/**Is this command for 18+ users only? */
|
||||
nsfw:boolean,
|
||||
/**A list of options for this command. */
|
||||
options:readonly ODSlashCommandUniversalOption[],
|
||||
/**A bitfield of the user permissions required to use this command. */
|
||||
defaultMemberPermissions:bigint,
|
||||
/**Is this command available in DM? */
|
||||
dmPermission:boolean,
|
||||
/**A list of contexts where you can install this command. */
|
||||
integrationTypes:readonly discord.ApplicationIntegrationType[],
|
||||
/**A list of contexts where you can use this command. */
|
||||
contexts:readonly discord.InteractionContextType[]
|
||||
}
|
||||
|
||||
/**## ODSlashCommandBuilder `interface`
|
||||
* The builder for slash commands. Here you can add options to the command.
|
||||
*/
|
||||
export interface ODSlashCommandBuilder extends discord.ChatInputApplicationCommandData {
|
||||
/**@deprecated `dmPermission` is deprecated. Use `context` instead! (Not using contexts might result in the slash command being re-registered on every startup!) */
|
||||
dmPermission?:boolean
|
||||
/**This field is required in Open Ticket for future compatibility. */
|
||||
integrationTypes:discord.ApplicationIntegrationType[],
|
||||
/**This field is required in Open Ticket for future compatibility. */
|
||||
contexts:discord.InteractionContextType[]
|
||||
}
|
||||
|
||||
export class ODSlashCommandComparator {
|
||||
/**Convert a `discord.ApplicationCommandOptionChoiceData<string>` to a universal Open Ticket slash command option choice object for comparison. */
|
||||
#convertOptionChoice(choice:discord.ApplicationCommandOptionChoiceData<string>): ODSlashCommandUniversalOptionChoice {
|
||||
const nameLoc = choice.nameLocalizations ?? {}
|
||||
return {
|
||||
name:choice.name,
|
||||
nameLocalizations:Object.keys(nameLoc).map((key) => {return {language:key as `${discord.Locale}`,value:nameLoc[key]}}),
|
||||
value:choice.value
|
||||
}
|
||||
}
|
||||
/**Convert a `discord.ApplicationCommandOptionData` to a universal Open Ticket slash command option object for comparison. */
|
||||
#convertBuilderOption(option:discord.ApplicationCommandOptionData): ODSlashCommandUniversalOption {
|
||||
const nameLoc = option.nameLocalizations ?? {}
|
||||
const descLoc = option.descriptionLocalizations ?? {}
|
||||
return {
|
||||
type:option.type,
|
||||
name:option.name,
|
||||
nameLocalizations:Object.keys(nameLoc).map((key) => {return {language:key as `${discord.Locale}`,value:nameLoc[key]}}),
|
||||
description:option.description,
|
||||
descriptionLocalizations:Object.keys(descLoc).map((key) => {return {language:key as `${discord.Locale}`,value:descLoc[key]}}),
|
||||
required:(option.type != discord.ApplicationCommandOptionType.SubcommandGroup && option.type != discord.ApplicationCommandOptionType.Subcommand && option.required) ? true : false,
|
||||
|
||||
autocomplete:option.autocomplete ?? false,
|
||||
choices:(option.type == discord.ApplicationCommandOptionType.String && !option.autocomplete && option.choices) ? option.choices.map((choice) => this.#convertOptionChoice(choice)) : [],
|
||||
options:((option.type == discord.ApplicationCommandOptionType.SubcommandGroup || option.type == discord.ApplicationCommandOptionType.Subcommand) && option.options) ? option.options.map((opt) => this.#convertBuilderOption(opt)) : [],
|
||||
channelTypes:(option.type == discord.ApplicationCommandOptionType.Channel && option.channelTypes) ? option.channelTypes : [],
|
||||
minValue:(option.type == discord.ApplicationCommandOptionType.Number && option.minValue) ? option.minValue : null,
|
||||
maxValue:(option.type == discord.ApplicationCommandOptionType.Number && option.maxValue) ? option.maxValue : null,
|
||||
minLength:(option.type == discord.ApplicationCommandOptionType.String && option.minLength) ? option.minLength : null,
|
||||
maxLength:(option.type == discord.ApplicationCommandOptionType.String && option.maxLength) ? option.maxLength : null
|
||||
}
|
||||
}
|
||||
/**Convert a `discord.ApplicationCommandOption` to a universal Open Ticket slash command option object for comparison. */
|
||||
#convertCommandOption(option:discord.ApplicationCommandOption): ODSlashCommandUniversalOption {
|
||||
const nameLoc = option.nameLocalizations ?? {}
|
||||
const descLoc = option.descriptionLocalizations ?? {}
|
||||
|
||||
return {
|
||||
type:option.type,
|
||||
name:option.name,
|
||||
nameLocalizations:Object.keys(nameLoc).map((key) => {return {language:key as `${discord.Locale}`,value:nameLoc[key]}}),
|
||||
description:option.description,
|
||||
descriptionLocalizations:Object.keys(descLoc).map((key) => {return {language:key as `${discord.Locale}`,value:descLoc[key]}}),
|
||||
required:(option.type != discord.ApplicationCommandOptionType.SubcommandGroup && option.type != discord.ApplicationCommandOptionType.Subcommand && option.required) ? true : false,
|
||||
|
||||
autocomplete:option.autocomplete ?? false,
|
||||
choices:(option.type == discord.ApplicationCommandOptionType.String && !option.autocomplete && option.choices) ? option.choices.map((choice) => this.#convertOptionChoice(choice)) : [],
|
||||
options:((option.type == discord.ApplicationCommandOptionType.SubcommandGroup || option.type == discord.ApplicationCommandOptionType.Subcommand) && option.options) ? option.options.map((opt) => this.#convertBuilderOption(opt)) : [],
|
||||
channelTypes:(option.type == discord.ApplicationCommandOptionType.Channel && option.channelTypes) ? option.channelTypes : [],
|
||||
minValue:(option.type == discord.ApplicationCommandOptionType.Number && option.minValue) ? option.minValue : null,
|
||||
maxValue:(option.type == discord.ApplicationCommandOptionType.Number && option.maxValue) ? option.maxValue : null,
|
||||
minLength:(option.type == discord.ApplicationCommandOptionType.String && option.minLength) ? option.minLength : null,
|
||||
maxLength:(option.type == discord.ApplicationCommandOptionType.String && option.maxLength) ? option.maxLength : null
|
||||
}
|
||||
}
|
||||
/**Convert a `ODSlashCommandBuilder` to a universal Open Ticket slash command object for comparison. */
|
||||
convertBuilder(builder:ODSlashCommandBuilder,guildId:string|null): ODSlashCommandUniversalCommand {
|
||||
if (builder.type != discord.ApplicationCommandType.ChatInput) throw new ODSystemError("ODSlashCommandComparator:convertBuilder() is not supported for other types than 'ChatInput'!")
|
||||
const nameLoc = builder.nameLocalizations ?? {}
|
||||
const descLoc = builder.descriptionLocalizations ?? {}
|
||||
return {
|
||||
type:1,
|
||||
name:builder.name,
|
||||
nameLocalizations:Object.keys(nameLoc).map((key) => {return {language:key as `${discord.Locale}`,value:nameLoc[key]}}),
|
||||
description:builder.description,
|
||||
descriptionLocalizations:Object.keys(descLoc).map((key) => {return {language:key as `${discord.Locale}`,value:descLoc[key]}}),
|
||||
guildId:guildId,
|
||||
nsfw:builder.nsfw ?? false,
|
||||
options:builder.options ? builder.options.map((opt) => this.#convertBuilderOption(opt)) : [],
|
||||
defaultMemberPermissions:discord.PermissionsBitField.resolve(builder.defaultMemberPermissions ?? ["ViewChannel"]),
|
||||
dmPermission:(builder.contexts && builder.contexts.includes(discord.InteractionContextType.BotDM)) ?? false,
|
||||
integrationTypes:builder.integrationTypes ?? [discord.ApplicationIntegrationType.GuildInstall],
|
||||
contexts:builder.contexts ?? []
|
||||
}
|
||||
}
|
||||
/**Convert a `discord.ApplicationCommand` to a universal Open Ticket slash command object for comparison. */
|
||||
convertCommand(cmd:discord.ApplicationCommand): ODSlashCommandUniversalCommand {
|
||||
if (cmd.type != discord.ApplicationCommandType.ChatInput) throw new ODSystemError("ODSlashCommandComparator:convertCommand() is not supported for other types than 'ChatInput'!")
|
||||
const nameLoc = cmd.nameLocalizations ?? {}
|
||||
const descLoc = cmd.descriptionLocalizations ?? {}
|
||||
return {
|
||||
type:1,
|
||||
name:cmd.name,
|
||||
nameLocalizations:Object.keys(nameLoc).map((key) => {return {language:key as `${discord.Locale}`,value:nameLoc[key]}}),
|
||||
description:cmd.description,
|
||||
descriptionLocalizations:Object.keys(descLoc).map((key) => {return {language:key as `${discord.Locale}`,value:descLoc[key]}}),
|
||||
guildId:cmd.guildId,
|
||||
nsfw:cmd.nsfw,
|
||||
options:cmd.options ? cmd.options.map((opt) => this.#convertCommandOption(opt)) : [],
|
||||
defaultMemberPermissions:discord.PermissionsBitField.resolve(cmd.defaultMemberPermissions ?? ["ViewChannel"]),
|
||||
dmPermission:(cmd.contexts && cmd.contexts.includes(discord.InteractionContextType.BotDM)) ? true : false,
|
||||
integrationTypes:cmd.integrationTypes ?? [discord.ApplicationIntegrationType.GuildInstall],
|
||||
contexts:cmd.contexts ?? []
|
||||
}
|
||||
}
|
||||
/**Returns `true` when the 2 slash command options are the same. */
|
||||
compareOption(optA:ODSlashCommandUniversalOption,optB:ODSlashCommandUniversalOption): boolean {
|
||||
if (optA.name != optB.name) return false
|
||||
if (optA.description != optB.description) return false
|
||||
if (optA.type != optB.type) return false
|
||||
if (optA.required != optB.required) return false
|
||||
if (optA.autocomplete != optB.autocomplete) return false
|
||||
if (optA.minValue != optB.minValue) return false
|
||||
if (optA.maxValue != optB.maxValue) return false
|
||||
if (optA.minLength != optB.minLength) return false
|
||||
if (optA.maxLength != optB.maxLength) return false
|
||||
|
||||
//nameLocalizations
|
||||
if (optA.nameLocalizations.length != optB.nameLocalizations.length) return false
|
||||
if (!optA.nameLocalizations.every((nameA) => {
|
||||
const nameB = optB.nameLocalizations.find((nameB) => nameB.language == nameA.language)
|
||||
if (!nameB || nameA.value != nameB.value) return false
|
||||
else return true
|
||||
})) return false
|
||||
|
||||
//descriptionLocalizations
|
||||
if (optA.descriptionLocalizations.length != optB.descriptionLocalizations.length) return false
|
||||
if (!optA.descriptionLocalizations.every((descA) => {
|
||||
const descB = optB.descriptionLocalizations.find((descB) => descB.language == descA.language)
|
||||
if (!descB || descA.value != descB.value) return false
|
||||
else return true
|
||||
})) return false
|
||||
|
||||
//choices
|
||||
if (optA.choices.length != optB.choices.length) return false
|
||||
if (!optA.choices.every((choiceA,index) => {
|
||||
const choiceB = optB.choices[index]
|
||||
if (choiceA.name != choiceB.name) return false
|
||||
if (choiceA.value != choiceB.value) return false
|
||||
|
||||
//nameLocalizations
|
||||
if (choiceA.nameLocalizations.length != choiceB.nameLocalizations.length) return false
|
||||
if (!choiceA.nameLocalizations.every((nameA) => {
|
||||
const nameB = choiceB.nameLocalizations.find((nameB) => nameB.language == nameA.language)
|
||||
if (!nameB || nameA.value != nameB.value) return false
|
||||
else return true
|
||||
})) return false
|
||||
|
||||
return true
|
||||
})) return false
|
||||
|
||||
//channelTypes
|
||||
if (optA.channelTypes.length != optB.channelTypes.length) return false
|
||||
if (!optA.channelTypes.every((typeA) => {
|
||||
return optB.channelTypes.includes(typeA)
|
||||
})) return false
|
||||
|
||||
//options
|
||||
if (optA.options.length != optB.options.length) return false
|
||||
if (!optA.options.every((subOptA,index) => {
|
||||
return this.compareOption(subOptA,optB.options[index])
|
||||
})) return false
|
||||
|
||||
return true
|
||||
}
|
||||
/**Returns `true` when the 2 slash commands are the same. */
|
||||
compare(cmdA:ODSlashCommandUniversalCommand,cmdB:ODSlashCommandUniversalCommand): boolean {
|
||||
if (cmdA.name != cmdB.name) return false
|
||||
if (cmdA.description != cmdB.description) return false
|
||||
if (cmdA.type != cmdB.type) return false
|
||||
if (cmdA.nsfw != cmdB.nsfw) return false
|
||||
if (cmdA.guildId != cmdB.guildId) return false
|
||||
if (cmdA.dmPermission != cmdB.dmPermission) return false
|
||||
if (cmdA.defaultMemberPermissions != cmdB.defaultMemberPermissions) return false
|
||||
|
||||
//nameLocalizations
|
||||
if (cmdA.nameLocalizations.length != cmdB.nameLocalizations.length) return false
|
||||
if (!cmdA.nameLocalizations.every((nameA) => {
|
||||
const nameB = cmdB.nameLocalizations.find((nameB) => nameB.language == nameA.language)
|
||||
if (!nameB || nameA.value != nameB.value) return false
|
||||
else return true
|
||||
})) return false
|
||||
|
||||
//descriptionLocalizations
|
||||
if (cmdA.descriptionLocalizations.length != cmdB.descriptionLocalizations.length) return false
|
||||
if (!cmdA.descriptionLocalizations.every((descA) => {
|
||||
const descB = cmdB.descriptionLocalizations.find((descB) => descB.language == descA.language)
|
||||
if (!descB || descA.value != descB.value) return false
|
||||
else return true
|
||||
})) return false
|
||||
|
||||
//contexts
|
||||
if (cmdA.contexts.length != cmdB.contexts.length) return false
|
||||
if (!cmdA.contexts.every((contextA) => {
|
||||
return cmdB.contexts.includes(contextA)
|
||||
})) return false
|
||||
|
||||
//integrationTypes
|
||||
if (cmdA.integrationTypes.length != cmdB.integrationTypes.length) return false
|
||||
if (!cmdA.integrationTypes.every((integrationA) => {
|
||||
return cmdB.integrationTypes.includes(integrationA)
|
||||
})) return false
|
||||
|
||||
//options
|
||||
if (cmdA.options.length != cmdB.options.length) return false
|
||||
if (!cmdA.options.every((optA,index) => {
|
||||
return this.compareOption(optA,cmdB.options[index])
|
||||
})) return false
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODSlashCommandInteractionCallback `type`
|
||||
* Callback for the slash command interaction listener.
|
||||
*/
|
||||
export type ODSlashCommandInteractionCallback = (interaction:discord.ChatInputCommandInteraction,cmd:ODSlashCommand) => void
|
||||
|
||||
/**## ODSlashCommandRegisteredResult `type`
|
||||
* The result which will be returned when getting all (un)registered slash commands from the manager.
|
||||
*/
|
||||
export type ODSlashCommandRegisteredResult = {
|
||||
/**A list of all registered commands. */
|
||||
registered:{
|
||||
/**The instance (`ODSlashCommand`) from this command. */
|
||||
instance:ODSlashCommand,
|
||||
/**The (universal) slash command object/template of this command. */
|
||||
cmd:ODSlashCommandUniversalCommand,
|
||||
/**Does this command require an update? */
|
||||
requiresUpdate:boolean
|
||||
}[],
|
||||
/**A list of all unregistered commands. */
|
||||
unregistered:{
|
||||
/**The instance (`ODSlashCommand`) from this command. */
|
||||
instance:ODSlashCommand,
|
||||
/**The (universal) slash command object/template of this command. */
|
||||
cmd:null,
|
||||
/**Does this command require an update? */
|
||||
requiresUpdate:true
|
||||
}[],
|
||||
/**A list of all unused commands (not found in `ODSlashCommandManager`). */
|
||||
unused:{
|
||||
/**The instance (`ODSlashCommand`) from this command. */
|
||||
instance:null,
|
||||
/**The (universal) slash command object/template of this command. */
|
||||
cmd:ODSlashCommandUniversalCommand,
|
||||
/**Does this command require an update? */
|
||||
requiresUpdate:false
|
||||
}[]
|
||||
}
|
||||
|
||||
/**## ODSlashCommandManager `class`
|
||||
* This is an open ticket client slash manager.
|
||||
* This is an Open Ticket client slash manager.
|
||||
*
|
||||
* It's responsible for managing all the slash commands from the client.
|
||||
*
|
||||
* Here, you can add & remove slash commands & the bot will do the (de)registering.
|
||||
*/
|
||||
export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
/**Copy of discord.js client. */
|
||||
/**Refrerence to discord.js client. */
|
||||
manager: ODClientManager
|
||||
/**Discord.js application commands manager. */
|
||||
commandManager: discord.ApplicationCommandManager|null
|
||||
@@ -426,6 +783,8 @@ export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
|
||||
#interactionListeners: {name:string|RegExp, callback:ODSlashCommandInteractionCallback}[] = []
|
||||
/**Set the soft limit for maximum amount of listeners. A warning will be shown when there are more listeners than this limit. */
|
||||
listenerLimit: number = 100
|
||||
/**A utility class used to compare 2 slash commands with each other. */
|
||||
comparator: ODSlashCommandComparator = new ODSlashCommandComparator()
|
||||
|
||||
constructor(debug:ODDebugger, manager:ODClientManager){
|
||||
super(debug,"slash command")
|
||||
@@ -434,41 +793,98 @@ export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
|
||||
this.commandManager = (manager.client.application) ? manager.client.application.commands : null
|
||||
}
|
||||
|
||||
/**Create all commands that don't exist yet. (global by default OR guildId for per-server) */
|
||||
async createNewCommands(guildId?:string){
|
||||
if (!this.manager.ready) throw new ODSystemError("Client isn't ready yet! Unable to register slash commands!")
|
||||
const cmds = await this.#existsCmd(guildId)
|
||||
|
||||
let i = 0
|
||||
while (i < cmds.nonExisting.length){
|
||||
await this.#createCmd(cmds.nonExisting[i])
|
||||
this.#debug.debug("Created new slash command",[{key:"id",value:cmds.nonExisting[i].id.value},{key:"name",value:cmds.nonExisting[i].name}])
|
||||
i++
|
||||
}
|
||||
}
|
||||
/**Update all commands that already exist. (global by default OR guildId for per-server) */
|
||||
async updateExistingCommands(guildId?:string,force?:boolean){
|
||||
if (!this.manager.ready) throw new ODSystemError("Client isn't ready yet! Unable to register slash commands!")
|
||||
const cmds = await this.#existsCmd(guildId)
|
||||
const filtered = cmds.existing.filter((cmd) => (cmd.requiresUpdate == true || force))
|
||||
/**Get all registered & unregistered slash commands. */
|
||||
async getAllRegisteredCommands(guildId?:string): Promise<ODSlashCommandRegisteredResult> {
|
||||
if (!this.commandManager) throw new ODSystemError("Couldn't get client application to register slash commands!")
|
||||
|
||||
for (const cmd of filtered){
|
||||
await this.#createCmd(cmd.cmd)
|
||||
this.#debug.debug("Updated existing slash command",[
|
||||
{key:"id",value:cmd.cmd.id.value},
|
||||
{key:"name",value:cmd.cmd.name},
|
||||
{key:"force",value:force ? "true" : "false"}
|
||||
const cmds = (await this.commandManager.fetch({guildId})).toJSON()
|
||||
const registered: {instance:ODSlashCommand, cmd:ODSlashCommandUniversalCommand, requiresUpdate:boolean}[] = []
|
||||
const unregistered: {instance:ODSlashCommand, cmd:null, requiresUpdate:true}[] = []
|
||||
const unused: {instance:null, cmd:ODSlashCommandUniversalCommand, requiresUpdate:false}[] = []
|
||||
|
||||
await this.loopAll((instance) => {
|
||||
if (guildId && instance.guildId != guildId) return
|
||||
|
||||
const index = cmds.findIndex((cmd) => cmd.name == instance.name)
|
||||
const cmd = cmds[index]
|
||||
cmds.splice(index,1)
|
||||
if (cmd){
|
||||
//command is registered (and may need to be updated)
|
||||
const universalBuilder = this.comparator.convertBuilder(instance.builder,instance.guildId)
|
||||
const universalCmd = this.comparator.convertCommand(cmd)
|
||||
const didChange = !this.comparator.compare(universalBuilder,universalCmd)
|
||||
const requiresUpdate = didChange || (instance.requiresUpdate ? instance.requiresUpdate(universalCmd) : false)
|
||||
registered.push({instance,cmd:universalCmd,requiresUpdate})
|
||||
|
||||
//command is not registered
|
||||
}else unregistered.push({instance,cmd:null,requiresUpdate:true})
|
||||
})
|
||||
|
||||
cmds.forEach((cmd) => {
|
||||
//command does not exist in the manager
|
||||
unused.push({instance:null,cmd:this.comparator.convertCommand(cmd),requiresUpdate:false})
|
||||
})
|
||||
|
||||
return {registered,unregistered,unused}
|
||||
}
|
||||
/**Create all commands that are not registered yet.*/
|
||||
async createNewCommands(instances:ODSlashCommand[],progress?:ODManualProgressBar){
|
||||
if (!this.manager.ready) throw new ODSystemError("Client isn't ready yet! Unable to register slash commands!")
|
||||
if (instances.length > 0 && progress){
|
||||
progress.max = instances.length
|
||||
progress.start()
|
||||
}
|
||||
|
||||
for (const instance of instances){
|
||||
await this.createCmd(instance)
|
||||
this.#debug.debug("Created new slash command",[
|
||||
{key:"id",value:instance.id.value},
|
||||
{key:"name",value:instance.name}
|
||||
])
|
||||
if (progress) progress.increase(1)
|
||||
}
|
||||
}
|
||||
/**Remove all commands that exist but aren't used by open ticket. (global by default OR guildId for per-server) */
|
||||
async removeUnusedCommands(guildId?:string){
|
||||
/**Update all commands that are already registered. */
|
||||
async updateExistingCommands(instances:ODSlashCommand[],progress?:ODManualProgressBar){
|
||||
if (!this.manager.ready) throw new ODSystemError("Client isn't ready yet! Unable to register slash commands!")
|
||||
const cmds = (await this.#unusedCmd(guildId)).map((cmd) => cmd.name)
|
||||
await this.#removeCmd(cmds,guildId)
|
||||
if (instances.length > 0 && progress){
|
||||
progress.max = instances.length
|
||||
progress.start()
|
||||
}
|
||||
|
||||
for (const instance of instances){
|
||||
await this.createCmd(instance)
|
||||
this.#debug.debug("Updated existing slash command",[{key:"id",value:instance.id.value},{key:"name",value:instance.name}])
|
||||
if (progress) progress.increase(1)
|
||||
}
|
||||
}
|
||||
/**Create a slash command from an `ODSlashCommand` class */
|
||||
async #createCmd(cmd:ODSlashCommand){
|
||||
/**Remove all commands that are registered but unused by Open Ticket. */
|
||||
async removeUnusedCommands(instances:ODSlashCommandUniversalCommand[],guildId?:string,progress?:ODManualProgressBar){
|
||||
if (!this.manager.ready) throw new ODSystemError("Client isn't ready yet! Unable to register slash commands!")
|
||||
if (!this.commandManager) throw new ODSystemError("Couldn't get client application to register slash commands!")
|
||||
if (instances.length > 0 && progress){
|
||||
progress.max = instances.length
|
||||
progress.start()
|
||||
}
|
||||
|
||||
const cmds = await this.commandManager.fetch({guildId})
|
||||
|
||||
for (const instance of instances){
|
||||
const cmd = cmds.find((cmd) => cmd.name == instance.name)
|
||||
if (cmd){
|
||||
try {
|
||||
await cmd.delete()
|
||||
this.#debug.debug("Removed existing slash command",[{key:"name",value:cmd.name},{key:"guildId",value:guildId ?? "/"}])
|
||||
}catch(err){
|
||||
process.emit("uncaughtException",err)
|
||||
throw new ODSystemError("Failed to delete slash command '/"+cmd.name+"'!")
|
||||
}
|
||||
}
|
||||
if (progress) progress.increase(1)
|
||||
}
|
||||
}
|
||||
/**Create a slash command. **(SYSTEM ONLY)** => Use `ODSlashCommandManager` for registering commands the default way! */
|
||||
async createCmd(cmd:ODSlashCommand){
|
||||
if (!this.commandManager) throw new ODSystemError("Couldn't get client application to register slash commands!")
|
||||
try {
|
||||
await this.commandManager.create(cmd.builder,(cmd.guildId ?? undefined))
|
||||
@@ -477,107 +893,6 @@ export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
|
||||
throw new ODSystemError("Failed to register slash command '/"+cmd.name+"'!")
|
||||
}
|
||||
}
|
||||
/**Remove slash cmds by name */
|
||||
async #removeCmd(names:string[],guildId?:string){
|
||||
if (!this.commandManager) throw new ODSystemError("Couldn't get client application to register slash commands!")
|
||||
|
||||
const cmds = await this.commandManager.fetch({guildId})
|
||||
|
||||
cmds?.forEach((cmd) => {
|
||||
if (!names.includes(cmd.name)) return
|
||||
cmd.delete()
|
||||
this.#debug.debug("Removed existing slash command",[{key:"name",value:cmd.name}])
|
||||
})
|
||||
}
|
||||
/**Get all existing & non-existing slash commands. */
|
||||
async #existsCmd(guildId?:string){
|
||||
if (!this.commandManager) throw new ODSystemError("Couldn't get client application to register slash commands!")
|
||||
|
||||
const cmds = await this.commandManager.fetch({guildId})
|
||||
const existing: {cmd:ODSlashCommand, requiresUpdate:boolean}[] = []
|
||||
const nonExisting: ODSlashCommand[] = []
|
||||
|
||||
await this.loopAll((cmd) => {
|
||||
if (guildId && cmd.guildId != guildId) return
|
||||
const result = cmds.find((cmddata) => cmddata.name == cmd.name)
|
||||
if (result){
|
||||
//command already exists (and may need to be updated)
|
||||
const requiresUpdate = cmd.requiresUpdate ? cmd.requiresUpdate({
|
||||
name:result.name,
|
||||
description:result.description,
|
||||
options:result.options as readonly discord.ApplicationCommandOptionData[],
|
||||
nsfw:result.nsfw,
|
||||
dmPermission:result.dmPermission ?? undefined,
|
||||
defaultMemberPermissions:result.defaultMemberPermissions,
|
||||
nameLocalizations:result.nameLocalizations ?? undefined,
|
||||
descriptionLocalizations:result.descriptionLocalizations ?? undefined
|
||||
}) : false
|
||||
existing.push({cmd,requiresUpdate})
|
||||
|
||||
//command doesn't exists yet
|
||||
}else nonExisting.push(cmd)
|
||||
})
|
||||
|
||||
return {existing,nonExisting}
|
||||
}
|
||||
/**Get all unused slash commands. */
|
||||
async #unusedCmd(guildId?:string){
|
||||
if (!this.commandManager) throw new ODSystemError("Couldn't get client application to register slash commands!")
|
||||
|
||||
const cmds = await this.commandManager.fetch({guildId})
|
||||
const unused: discord.ApplicationCommand[] = []
|
||||
|
||||
const allCommands = this.getAll()
|
||||
cmds.forEach((cmddata) => {
|
||||
if (guildId && cmddata.guildId != guildId) return
|
||||
|
||||
if (!allCommands.find((cmd) => {
|
||||
if (cmd.name != cmddata.name) return false
|
||||
if (cmd.builder.description != cmddata.description) return false
|
||||
return this.#checkUnusedOptions(cmddata.options,cmd.builder.options ?? [])
|
||||
|
||||
})) unused.push(cmddata)
|
||||
})
|
||||
|
||||
return unused
|
||||
}
|
||||
/**Returns `true` if the options are the same in both arrays. It will work recursively! */
|
||||
#checkUnusedOptions(currentOptions:readonly discord.ApplicationCommandOption[], newOptions:readonly discord.ApplicationCommandOptionData[]){
|
||||
if ((!newOptions || newOptions.length == 0) && currentOptions.length == 0) return true
|
||||
else if (newOptions && newOptions.length != currentOptions.length) return false
|
||||
|
||||
if (!currentOptions.every((currentOpt,index) => {
|
||||
const newOpt = newOptions[index]
|
||||
if (newOpt.name != currentOpt.name) return false
|
||||
if (newOpt.type != currentOpt.type) return false
|
||||
if (newOpt.description != currentOpt.description) return false
|
||||
|
||||
if (newOpt.type == discord.ApplicationCommandOptionType.Number && currentOpt.type == discord.ApplicationCommandOptionType.Number){
|
||||
//check for min & max values when type is number
|
||||
if (newOpt.minValue != currentOpt.minValue) return false
|
||||
if (newOpt.maxValue != currentOpt.maxValue) return false
|
||||
}
|
||||
if (newOpt.type == discord.ApplicationCommandOptionType.String && currentOpt.type == discord.ApplicationCommandOptionType.String){
|
||||
//check for min & max length values when type is string
|
||||
if (newOpt.minLength != currentOpt.minLength) return false
|
||||
if (newOpt.maxLength != currentOpt.maxLength) return false
|
||||
}
|
||||
|
||||
//check for required normal options
|
||||
if (currentOpt.type != discord.ApplicationCommandOptionType.SubcommandGroup && currentOpt.type != discord.ApplicationCommandOptionType.Subcommand && newOpt.type != discord.ApplicationCommandOptionType.SubcommandGroup && newOpt.type != discord.ApplicationCommandOptionType.Subcommand){
|
||||
if (currentOpt.required != newOpt.required) return false
|
||||
|
||||
//check for sub-options in subcommands
|
||||
}else if ((currentOpt.type == discord.ApplicationCommandOptionType.SubcommandGroup && newOpt.type == discord.ApplicationCommandOptionType.SubcommandGroup) || (currentOpt.type == discord.ApplicationCommandOptionType.Subcommand && newOpt.type == discord.ApplicationCommandOptionType.Subcommand)){
|
||||
if (currentOpt.options && newOpt.options){
|
||||
return this.#checkUnusedOptions(currentOpt.options,newOpt.options)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
})) return false
|
||||
return true
|
||||
}
|
||||
/**Start listening to the discord.js client `interactionCreate` event. */
|
||||
startListeningToInteractions(){
|
||||
this.manager.client.on("interactionCreate",(interaction) => {
|
||||
@@ -612,18 +927,13 @@ export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODSlashCommandBuilder `interface`
|
||||
* The builder for slash commands. Here you can add options to the command.
|
||||
*/
|
||||
export interface ODSlashCommandBuilder extends discord.ChatInputApplicationCommandData {}
|
||||
|
||||
/**## ODSlashCommandUpdateFunction `type`
|
||||
* The function responsible for updating slash commands when they already exist.
|
||||
*/
|
||||
export type ODSlashCommandUpdateFunction = (current:ODSlashCommandBuilder) => boolean
|
||||
export type ODSlashCommandUpdateFunction = (command:ODSlashCommandUniversalCommand) => boolean
|
||||
|
||||
/**## ODSlashCommand `class`
|
||||
* This is an open ticket slash command.
|
||||
* This is an Open Ticket slash command.
|
||||
*
|
||||
* When registered, you can listen for this command using the `ODCommandResponder`. The advantages of using this class for creating a slash command are:
|
||||
* - automatic option parsing (even for channels, users, roles & mentions)!
|
||||
@@ -796,7 +1106,7 @@ export interface ODTextCommandBuilder {
|
||||
}
|
||||
|
||||
/**## ODTextCommand `class`
|
||||
* This is an open ticket text command.
|
||||
* This is an Open Ticket text command.
|
||||
*
|
||||
* When registered, you can listen for this command using the `ODCommandResponder`. The advantages of using this class for creating a text command are:
|
||||
* - automatic option parsing (even for channels, users, roles & mentions)!
|
||||
@@ -953,14 +1263,14 @@ export type ODTextCommandError = (
|
||||
export type ODTextCommandErrorCallback = (error:ODTextCommandError) => void
|
||||
|
||||
/**## ODTextCommandManager `class`
|
||||
* This is an open ticket client text manager.
|
||||
* This is an Open Ticket client text manager.
|
||||
*
|
||||
* It's responsible for managing all the text commands from the client.
|
||||
*
|
||||
* Here, you can add & remove text commands & the bot will do the (de)registering.
|
||||
*/
|
||||
export class ODTextCommandManager extends ODManager<ODTextCommand> {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
/**Copy of discord.js client. */
|
||||
manager: ODClientManager
|
||||
|
||||
@@ -6,13 +6,16 @@ import { ODDebugger } from "./console"
|
||||
|
||||
|
||||
/**## ODCode `class`
|
||||
* This is an open ticket code runner.
|
||||
* This is an Open Ticket code runner.
|
||||
*
|
||||
* It is just a function that will run just before the bot has started completely!
|
||||
* This can be used for code that needs to run at startup, but isn't really time dependent.
|
||||
*
|
||||
* - It has an `id` for identification of the function
|
||||
* - A `priority` to know when to execute this function (related to others)
|
||||
* Using this, you're able to execute a function just before the startup screen. (90% of the code is already loaded)
|
||||
* You can also specify a priority to change the execution order.
|
||||
* In Open Ticket, this is used for the following processes:
|
||||
* - Autoclose/delete
|
||||
* - Database syncronisation (with tickets, stats & used options)
|
||||
* - Panel auto-update
|
||||
* - Database Garbage Collection (removing tickets that don't exist anymore)
|
||||
* - And more!
|
||||
*/
|
||||
export class ODCode extends ODManagerData {
|
||||
/**The priority of this code */
|
||||
@@ -28,18 +31,18 @@ export class ODCode extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODCodeManager `class`
|
||||
* This is an open ticket code manager.
|
||||
* This is an Open Ticket code manager.
|
||||
*
|
||||
* It manages & executes `ODCode`'s in the correct order.
|
||||
*
|
||||
* You will probably register a function/code in this class for something that doesn't really need to be timed.
|
||||
* Use this to register a function/code which executes just before the startup screen. (90% is already loaded)
|
||||
*/
|
||||
export class ODCodeManager extends ODManager<ODCode> {
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"code")
|
||||
}
|
||||
|
||||
/**Execute all functions or code. */
|
||||
/**Execute all `ODCode` functions in order of their priority (high to low). */
|
||||
async execute(){
|
||||
const derefArray = [...this.getAll()]
|
||||
const workers = derefArray.sort((a,b) => b.priority-a.priority)
|
||||
|
||||
@@ -7,11 +7,11 @@ import { ODDebugger } from "./console"
|
||||
import fs from "fs"
|
||||
|
||||
/**## ODConfigManager `class`
|
||||
* This is an open ticket config manager.
|
||||
* This is an Open Ticket config manager.
|
||||
*
|
||||
* It manages all config files in the bot and allows plugins to access config files from open ticket & other plugins!
|
||||
* It manages all config files in the bot and allows plugins to access config files from Open Ticket & other plugins!
|
||||
*
|
||||
* You will use this class to get/add a config file (`ODConfig`) in your plugin!
|
||||
* You can use this class to get/change/add a config file (`ODConfig`) in your plugin!
|
||||
*/
|
||||
export class ODConfigManager extends ODManager<ODConfig> {
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -30,10 +30,10 @@ export class ODConfigManager extends ODManager<ODConfig> {
|
||||
}
|
||||
|
||||
/**## ODConfig `class`
|
||||
* This is an open ticket config helper.
|
||||
* This is an Open Ticket config helper.
|
||||
* This class doesn't do anything at all, it just gives a template & basic methods for a config. Use `ODJsonConfig` instead!
|
||||
*
|
||||
* You will only use this class if you want to create your own config implementation (e.g. `yml`, `xml`,...)!
|
||||
* You can use this class if you want to create your own config implementation (e.g. `yml`, `xml`,...)!
|
||||
*/
|
||||
export class ODConfig extends ODManagerData {
|
||||
/**The name of the file with extension. */
|
||||
@@ -55,8 +55,8 @@ export class ODConfig extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODJsonConfig `class`
|
||||
* This is an open ticket config helper.
|
||||
* You will use this class to get & edit variables from the config files or to create your own config!
|
||||
* This is an Open Ticket JSON config.
|
||||
* You can use this class to get & edit variables from the config files or to create your own JSON config!
|
||||
* @example
|
||||
* //create a config from: ./config/test.json with the id "some-config"
|
||||
* const config = new api.ODJsonConfig("some-config","test.json")
|
||||
|
||||
@@ -25,7 +25,7 @@ export interface ODConsoleMessageParam {
|
||||
}
|
||||
|
||||
/**## ODConsoleMessage `class`
|
||||
* This is an open ticket console message.
|
||||
* This is an Open Ticket console message.
|
||||
*
|
||||
* It is used to create beautiful & styled logs in the console with a prefix, message & parameters.
|
||||
* It also has full color support using `ansis` and parameters are parsed for you!
|
||||
@@ -73,7 +73,7 @@ export class ODConsoleMessage {
|
||||
})
|
||||
const pstring = (pstrings.length > 0) ? " ("+pstrings.join(", ")+")" : ""
|
||||
const date = new Date()
|
||||
const dstring = `${date.getDate()}/${date.getMonth()}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
|
||||
const dstring = `${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
|
||||
return `[${dstring} ${this.prefix}] ${this.message}${pstring}`
|
||||
}
|
||||
/**Render the parameters of this message in a specific color. */
|
||||
@@ -117,7 +117,7 @@ export class ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODConsoleInfoMessage `class`
|
||||
* This is an open ticket console info message.
|
||||
* This is an Open Ticket console info message.
|
||||
*
|
||||
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "INFO" messages!
|
||||
*/
|
||||
@@ -128,7 +128,7 @@ export class ODConsoleInfoMessage extends ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODConsoleSystemMessage `class`
|
||||
* This is an open ticket console system message.
|
||||
* This is an Open Ticket console system message.
|
||||
*
|
||||
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "SYSTEM" messages!
|
||||
*/
|
||||
@@ -139,7 +139,7 @@ export class ODConsoleSystemMessage extends ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODConsolePluginMessage `class`
|
||||
* This is an open ticket console plugin message.
|
||||
* This is an Open Ticket console plugin message.
|
||||
*
|
||||
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "PLUGIN" messages!
|
||||
*/
|
||||
@@ -150,7 +150,7 @@ export class ODConsolePluginMessage extends ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODConsoleDebugMessage `class`
|
||||
* This is an open ticket console debug message.
|
||||
* This is an Open Ticket console debug message.
|
||||
*
|
||||
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "DEBUG" messages!
|
||||
*/
|
||||
@@ -161,7 +161,7 @@ export class ODConsoleDebugMessage extends ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODConsoleWarningMessage `class`
|
||||
* This is an open ticket console warning message.
|
||||
* This is an Open Ticket console warning message.
|
||||
*
|
||||
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "WARNING" messages!
|
||||
*/
|
||||
@@ -172,7 +172,7 @@ export class ODConsoleWarningMessage extends ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODConsoleErrorMessage `class`
|
||||
* This is an open ticket console error message.
|
||||
* This is an Open Ticket console error message.
|
||||
*
|
||||
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "ERROR" messages!
|
||||
*/
|
||||
@@ -183,7 +183,7 @@ export class ODConsoleErrorMessage extends ODConsoleMessage {
|
||||
}
|
||||
|
||||
/**## ODError `class`
|
||||
* This is an open ticket error.
|
||||
* This is an Open Ticket error.
|
||||
*
|
||||
* It is used to render and log Node.js errors & crashes in a styled way to the console & `otdebug.txt` file!
|
||||
*/
|
||||
@@ -227,7 +227,7 @@ export class ODError {
|
||||
export type ODConsoleMessageTypes = "info"|"system"|"plugin"|"debug"|"warning"|"error"
|
||||
|
||||
/**## ODConsoleManager `class`
|
||||
* This is the open ticket console manager.
|
||||
* This is the Open Ticket console manager.
|
||||
*
|
||||
* It handles the entire console system of Open Ticket. It's also the place where you need to log `ODConsoleMessage`'s.
|
||||
* This manager keeps a short history of messages sent to the console which is configurable by plugins.
|
||||
@@ -285,7 +285,7 @@ export class ODConsoleManager {
|
||||
}
|
||||
|
||||
/**## ODDebugFileManager `class`
|
||||
* This is the open ticket debug file manager.
|
||||
* This is the Open Ticket debug file manager.
|
||||
*
|
||||
* It manages the Open Ticket debug file (`otdebug.txt`) which keeps a history of all system logs.
|
||||
* There are even internal logs that aren't logged to the console which are available in this file!
|
||||
@@ -348,7 +348,7 @@ export class ODDebugFileManager {
|
||||
/**Generate the stats/header of the debug file (containing the version) */
|
||||
#createStatsText(){
|
||||
const date = new Date()
|
||||
const dstring = `${date.getDate()}/${date.getMonth()}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
|
||||
const dstring = `${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
|
||||
return [
|
||||
"=========================",
|
||||
"OPEN TICKET DEBUG FILE:",
|
||||
@@ -398,7 +398,7 @@ export class ODDebugFileManager {
|
||||
}
|
||||
|
||||
/**## ODDebugger `class`
|
||||
* This is the open ticket debugger.
|
||||
* This is the Open Ticket debugger.
|
||||
*
|
||||
* It is a simple wrapper around the `ODConsoleManager` to handle debugging (primarily for `ODManagers`).
|
||||
* Messages created using this debugger are only logged to the debug file unless specified otherwise.
|
||||
@@ -408,7 +408,7 @@ export class ODDebugFileManager {
|
||||
* Using this system, all additions & removals inside a manager are logged to the debug file. This makes searching for errors a lot easier!
|
||||
*/
|
||||
export class ODDebugger {
|
||||
/**An alias to the open ticket console manager. */
|
||||
/**An alias to the Open Ticket console manager. */
|
||||
console: ODConsoleManager
|
||||
/**When enabled, debug logs are also shown in the console. */
|
||||
visible: boolean = false
|
||||
@@ -475,7 +475,7 @@ export interface ODLiveStatusSourceData {
|
||||
}
|
||||
|
||||
/**## ODLiveStatusSource `class`
|
||||
* This is the open ticket livestatus source.
|
||||
* This is the Open Ticket livestatus source.
|
||||
*
|
||||
* It is an empty template for a livestatus source.
|
||||
* By default, you should use `ODLiveStatusUrlSource` or `ODLiveStatusFileSource`,
|
||||
@@ -526,7 +526,7 @@ export class ODLiveStatusSource extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODLiveStatusFileSource `class`
|
||||
* This is the open ticket livestatus file source.
|
||||
* This is the Open Ticket livestatus file source.
|
||||
*
|
||||
* It is a LiveStatus source that will read the data from a local file.
|
||||
*
|
||||
@@ -545,7 +545,7 @@ export class ODLiveStatusFileSource extends ODLiveStatusSource {
|
||||
}
|
||||
|
||||
/**## ODLiveStatusUrlSource `class`
|
||||
* This is the open ticket livestatus url source.
|
||||
* This is the Open Ticket livestatus url source.
|
||||
*
|
||||
* It is a LiveStatus source that will read the data from a http URL (json file).
|
||||
*
|
||||
@@ -579,11 +579,11 @@ export class ODLiveStatusUrlSource extends ODLiveStatusSource {
|
||||
}
|
||||
|
||||
/**## ODLiveStatusManager `class`
|
||||
* This is the open ticket livestatus manager.
|
||||
* This is the Open Ticket livestatus manager.
|
||||
*
|
||||
* It manages all LiveStatus sources and has the renderer for all LiveStatus messages.
|
||||
*
|
||||
* You will probably use this to customise or add stuff to the LiveStatus system.
|
||||
* You can use this to customise or add stuff to the LiveStatus system.
|
||||
* Access it in the global `openticket.startscreen.livestatus` variable!
|
||||
*/
|
||||
export class ODLiveStatusManager extends ODManager<ODLiveStatusSource> {
|
||||
@@ -611,7 +611,7 @@ export class ODLiveStatusManager extends ODManager<ODLiveStatusSource> {
|
||||
}
|
||||
|
||||
/**## ODLiveStatusRenderer `class`
|
||||
* This is the open ticket livestatus renderer.
|
||||
* This is the Open Ticket livestatus renderer.
|
||||
*
|
||||
* It's responsible for rendering all LiveStatus messages to the console.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData } from "./base
|
||||
import { ODDebugger } from "./console"
|
||||
|
||||
/**## ODCooldownManager `class`
|
||||
* This is an open ticket cooldown manager.
|
||||
* This is an Open Ticket cooldown manager.
|
||||
*
|
||||
* It is responsible for managing all cooldowns in Open Ticket. An example of this is the ticket creation cooldown.
|
||||
*
|
||||
@@ -24,7 +24,7 @@ export class ODCooldownManager extends ODManager<ODCooldown<object>> {
|
||||
}
|
||||
|
||||
/**## ODCooldownData `class`
|
||||
* This is open ticket cooldown data.
|
||||
* This is Open Ticket cooldown data.
|
||||
*
|
||||
* It contains the instance of an active cooldown (e.g. for a user). It is handled by the cooldown itself.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ export class ODCooldownData<Data extends object> extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODCooldown `class`
|
||||
* This is an open ticket cooldown.
|
||||
* This is an Open Ticket cooldown.
|
||||
*
|
||||
* It doesn't do anything on it's own, but it provides the methods that are used to interact with a cooldown.
|
||||
* This class can be extended from to create a working cooldown.
|
||||
@@ -77,7 +77,7 @@ export class ODCooldown<Data extends object> extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODCounterCooldown `class`
|
||||
* This is an open ticket counter cooldown.
|
||||
* This is an Open Ticket counter cooldown.
|
||||
*
|
||||
* It is is a cooldown based on a counter. When the number exceeds the limit, the cooldown is activated.
|
||||
* The number will automatically be decreased with a set amount & interval.
|
||||
@@ -154,7 +154,7 @@ export class ODCounterCooldown extends ODCooldown<{value:number}> {
|
||||
}
|
||||
|
||||
/**## ODIncrementalCounterCooldown `class`
|
||||
* This is an open ticket incremental counter cooldown.
|
||||
* This is an Open Ticket incremental counter cooldown.
|
||||
*
|
||||
* It is is a cooldown based on an incremental counter. It is exactly the same as the normal counter,
|
||||
* with the only difference being that it still increments when the limit is already exeeded.
|
||||
@@ -232,7 +232,7 @@ export class ODIncrementalCounterCooldown extends ODCooldown<{value:number}> {
|
||||
}
|
||||
|
||||
/**## ODTimeoutCooldown `class`
|
||||
* This is an open ticket timeout cooldown.
|
||||
* This is an Open Ticket timeout cooldown.
|
||||
*
|
||||
* It is a cooldown based on a timer. When triggered/updated, the cooldown is activated for the set amount of time.
|
||||
* After the timer has timed out, the cooldown will be deleted.
|
||||
@@ -288,7 +288,7 @@ export class ODTimeoutCooldown extends ODCooldown<{date:number}> {
|
||||
}
|
||||
|
||||
/**## ODIncrementalTimeoutCooldown `class`
|
||||
* This is an open ticket incremental timeout cooldown.
|
||||
* This is an Open Ticket incremental timeout cooldown.
|
||||
*
|
||||
* It is is a cooldown based on an incremental timer. It is exactly the same as the normal timer,
|
||||
* with the only difference being that it adds additional time when triggered/updated while the cooldown is already active.
|
||||
|
||||
@@ -8,11 +8,11 @@ import { ODDebugger } from "./console"
|
||||
import * as fjs from "formatted-json-stringify"
|
||||
|
||||
/**## ODDatabaseManager `class`
|
||||
* This is an open ticket database manager.
|
||||
* This is an Open Ticket database manager.
|
||||
*
|
||||
* It manages all databases in the bot and allows to permanently store data from the bot!
|
||||
*
|
||||
* You will use this class to get/add a database (`ODDatabase`) in your plugin!
|
||||
* You can use this class to get/add a database (`ODDatabase`) in your plugin!
|
||||
*/
|
||||
export class ODDatabaseManager extends ODManager<ODDatabase> {
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -32,10 +32,10 @@ export class ODDatabaseManager extends ODManager<ODDatabase> {
|
||||
}
|
||||
|
||||
/**## ODDatabase `class`
|
||||
* This is an open ticket database template.
|
||||
* This is an Open Ticket database template.
|
||||
* This class doesn't do anything at all, it just gives a template & basic methods for a database. Use `ODJsonDatabase` instead!
|
||||
*
|
||||
* You will only use this class if you want to create your own database implementation (e.g. `mongodb`, `mysql`,...)!
|
||||
* You can use this class if you want to create your own database implementation (e.g. `mongodb`, `mysql`,...)!
|
||||
*/
|
||||
export class ODDatabase extends ODManagerData {
|
||||
/**The name of the file with extension. */
|
||||
@@ -79,11 +79,11 @@ export class ODDatabase extends ODManagerData {
|
||||
export type ODJsonDatabaseStructure = {category:string, key:string, value:ODValidJsonType}[]
|
||||
|
||||
/**## ODJsonDatabase `class`
|
||||
* This is an open ticket JSON database.
|
||||
* This is an Open Ticket JSON database.
|
||||
* It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy.
|
||||
* You can store the following types: `string`, `number`, `boolean`, `array`, `object` & `null`!
|
||||
*
|
||||
* You will use this class if you want to create your own database or use an existing one!
|
||||
* You can use this class if you want to add your own database or to use an existing one!
|
||||
*/
|
||||
export class ODJsonDatabase extends ODDatabase {
|
||||
constructor(id:ODValidId, file:string, customPath?:string){
|
||||
@@ -179,7 +179,7 @@ export class ODJsonDatabase extends ODDatabase {
|
||||
|
||||
|
||||
/**## ODFormattedJsonDatabase `class`
|
||||
* This is an open ticket Formatted JSON database.
|
||||
* This is an Open Ticket Formatted JSON database.
|
||||
* It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy.
|
||||
* You can store the following types: `string`, `number`, `boolean`, `array`, `object` & `null`!
|
||||
*
|
||||
|
||||
@@ -20,27 +20,31 @@ export interface ODDefaults {
|
||||
/**Don't crash the bot when a plugin crashes! */
|
||||
softPluginLoading:boolean,
|
||||
|
||||
/**Load the default open ticket plugin classes. */
|
||||
/**Load the default Open Ticket plugin classes. */
|
||||
pluginClassLoading:boolean,
|
||||
|
||||
/**Load the default open ticket flags. */
|
||||
/**Load the default Open Ticket flags. */
|
||||
flagLoading:boolean,
|
||||
/**Enable the default initializer for open ticket flags. */
|
||||
/**Enable the default initializer for Open Ticket flags. */
|
||||
flagInitiating:boolean,
|
||||
/**Load the default open ticket configs. */
|
||||
/**Load the default Open Ticket progress bar renderers. */
|
||||
progressBarRendererLoading:boolean,
|
||||
/**Load the default Open Ticket progress bars. */
|
||||
progressBarLoading:boolean,
|
||||
/**Load the default Open Ticket configs. */
|
||||
configLoading:boolean,
|
||||
/**Enable the default initializer for open ticket config. */
|
||||
/**Enable the default initializer for Open Ticket config. */
|
||||
configInitiating:boolean,
|
||||
/**Load the default open ticket databases. */
|
||||
/**Load the default Open Ticket databases. */
|
||||
databaseLoading:boolean,
|
||||
/**Enable the default initializer for open ticket database. */
|
||||
/**Enable the default initializer for Open Ticket database. */
|
||||
databaseInitiating:boolean,
|
||||
/**Load the default open ticket sessions. */
|
||||
/**Load the default Open Ticket sessions. */
|
||||
sessionLoading:boolean,
|
||||
|
||||
/**Load the default open ticket languages. */
|
||||
/**Load the default Open Ticket languages. */
|
||||
languageLoading:boolean,
|
||||
/**Enable the default initializer for open ticket languages. */
|
||||
/**Enable the default initializer for Open Ticket languages. */
|
||||
languageInitiating:boolean,
|
||||
/**Enable selecting the current language from `config/general.json`. */
|
||||
languageSelection:boolean,
|
||||
@@ -49,13 +53,13 @@ export interface ODDefaults {
|
||||
/****[NOT FOR PLUGIN TRANSLATIONS]** The full list of available languages (used in the default config checker). */
|
||||
languageList:string[],
|
||||
|
||||
/**Load the default open ticket config checker. */
|
||||
/**Load the default Open Ticket config checker. */
|
||||
checkerLoading:boolean,
|
||||
/**Load the default open ticket config checker functions. */
|
||||
/**Load the default Open Ticket config checker functions. */
|
||||
checkerFunctionLoading:boolean,
|
||||
/**Enable the default execution of the config checkers. */
|
||||
checkerExecution:boolean,
|
||||
/**Load the default open ticket config checker translations. */
|
||||
/**Load the default Open Ticket config checker translations. */
|
||||
checkerTranslationLoading:boolean,
|
||||
/**Enable the default rendering of the config checkers. */
|
||||
checkerRendering:boolean,
|
||||
@@ -64,109 +68,111 @@ export interface ODDefaults {
|
||||
/**Render the checker even when there are no errors & warnings. */
|
||||
checkerRenderEmpty:boolean,
|
||||
|
||||
/**Load the default open ticket client configuration. */
|
||||
/**Load the default Open Ticket client configuration. */
|
||||
clientLoading:boolean,
|
||||
/**Load the default open ticket client initialization. */
|
||||
/**Load the default Open Ticket client initialization. */
|
||||
clientInitiating:boolean,
|
||||
/**Load the default open ticket client ready actions (status, commands, permissions, ...). */
|
||||
/**Load the default Open Ticket client ready actions (status, commands, permissions, ...). */
|
||||
clientReady:boolean,
|
||||
/**Create a warning when the bot is present in multiple guilds. */
|
||||
clientMultiGuildWarning:boolean,
|
||||
/**Load the default open ticket client activity (from `config/general.json`). */
|
||||
/**Load the default Open Ticket client activity (from `config/general.json`). */
|
||||
clientActivityLoading:boolean,
|
||||
/**Load the default open ticket client activity initialization (& status refresh). */
|
||||
/**Load the default Open Ticket client activity initialization (& status refresh). */
|
||||
clientActivityInitiating:boolean,
|
||||
|
||||
/**Load the default open ticket slash commands. */
|
||||
/**Load the default Open Ticket slash commands. */
|
||||
slashCommandLoading:boolean,
|
||||
/**Load the default open ticket slash command registerer (register slash cmds in discord). */
|
||||
/**Load the default Open Ticket slash command registerer (register slash cmds in discord). */
|
||||
slashCommandRegistering:boolean,
|
||||
/**When enabled, the bot is forced to re-register all slash commands in the server. This can be used in case of a auto-update malfunction. */
|
||||
forceSlashCommandRegistration:boolean,
|
||||
/**Load the default open ticket text commands. */
|
||||
/**When enabled, the bot is allowed to unregister all slash commands which aren't used in Open Ticket. Disable this if you don't want to use the Open Ticket `ODSlashCommand` classes. */
|
||||
allowSlashCommandRemoval:boolean,
|
||||
/**Load the default Open Ticket text commands. */
|
||||
textCommandLoading:boolean,
|
||||
|
||||
/**Load the default open ticket questions (from `config/questions.json`) */
|
||||
/**Load the default Open Ticket questions (from `config/questions.json`) */
|
||||
questionLoading:boolean,
|
||||
/**Load the default open ticket options (from `config/options.json`) */
|
||||
/**Load the default Open Ticket options (from `config/options.json`) */
|
||||
optionLoading:boolean,
|
||||
/**Load the default open ticket panels (from `config/panels.json`) */
|
||||
/**Load the default Open Ticket panels (from `config/panels.json`) */
|
||||
panelLoading:boolean,
|
||||
/**Load the default open ticket tickets (from `database/tickets.json`) */
|
||||
/**Load the default Open Ticket tickets (from `database/tickets.json`) */
|
||||
ticketLoading:boolean,
|
||||
/**Load the default open ticket reaction roles (from `config/options.json`) */
|
||||
/**Load the default Open Ticket reaction roles (from `config/options.json`) */
|
||||
roleLoading:boolean,
|
||||
/**Load the default open ticket blacklist (from `database/users.json`) */
|
||||
/**Load the default Open Ticket blacklist (from `database/users.json`) */
|
||||
blacklistLoading:boolean,
|
||||
/**Load the default open ticket transcript compilers. */
|
||||
/**Load the default Open Ticket transcript compilers. */
|
||||
transcriptCompilerLoading:boolean,
|
||||
/**Load the default open ticket transcript history (from `database/transcripts.json`) */
|
||||
/**Load the default Open Ticket transcript history (from `database/transcripts.json`) */
|
||||
transcriptHistoryLoading:boolean,
|
||||
|
||||
/**Load the default open ticket button builders. */
|
||||
/**Load the default Open Ticket button builders. */
|
||||
buttonBuildersLoading:boolean,
|
||||
/**Load the default open ticket dropdown builders. */
|
||||
/**Load the default Open Ticket dropdown builders. */
|
||||
dropdownBuildersLoading:boolean,
|
||||
/**Load the default open ticket file builders. */
|
||||
/**Load the default Open Ticket file builders. */
|
||||
fileBuildersLoading:boolean,
|
||||
/**Load the default open ticket embed builders. */
|
||||
/**Load the default Open Ticket embed builders. */
|
||||
embedBuildersLoading:boolean,
|
||||
/**Load the default open ticket message builders. */
|
||||
/**Load the default Open Ticket message builders. */
|
||||
messageBuildersLoading:boolean,
|
||||
/**Load the default open ticket modal builders. */
|
||||
/**Load the default Open Ticket modal builders. */
|
||||
modalBuildersLoading:boolean,
|
||||
|
||||
/**Load the default open ticket command responders. */
|
||||
/**Load the default Open Ticket command responders. */
|
||||
commandRespondersLoading:boolean,
|
||||
/**Load the default open ticket button responders. */
|
||||
/**Load the default Open Ticket button responders. */
|
||||
buttonRespondersLoading:boolean,
|
||||
/**Load the default open ticket dropdown responders. */
|
||||
/**Load the default Open Ticket dropdown responders. */
|
||||
dropdownRespondersLoading:boolean,
|
||||
/**Load the default open ticket modal responders. */
|
||||
/**Load the default Open Ticket modal responders. */
|
||||
modalRespondersLoading:boolean,
|
||||
/**Set the time (in ms) before open ticket sends an error message when no reply is sent in a responder. */
|
||||
/**Set the time (in ms) before Open Ticket sends an error message when no reply is sent in a responder. */
|
||||
responderTimeoutMs:number,
|
||||
|
||||
/**Load the default open ticket actions. */
|
||||
/**Load the default Open Ticket actions. */
|
||||
actionsLoading:boolean,
|
||||
|
||||
/**Load the default open ticket verify bars. */
|
||||
/**Load the default Open Ticket verify bars. */
|
||||
verifyBarsLoading:boolean,
|
||||
/**Load the default open ticket permissions. */
|
||||
/**Load the default Open Ticket permissions. */
|
||||
permissionsLoading:boolean,
|
||||
/**Load the default open ticket posts. */
|
||||
/**Load the default Open Ticket posts. */
|
||||
postsLoading:boolean,
|
||||
/**Initiate the default open ticket posts. */
|
||||
/**Initiate the default Open Ticket posts. */
|
||||
postsInitiating:boolean,
|
||||
/**Load the default open ticket cooldowns. */
|
||||
/**Load the default Open Ticket cooldowns. */
|
||||
cooldownsLoading:boolean,
|
||||
/**Initiate the default open ticket cooldowns. */
|
||||
/**Initiate the default Open Ticket cooldowns. */
|
||||
cooldownsInitiating:boolean,
|
||||
/**Load the default open ticket help menu categories. */
|
||||
/**Load the default Open Ticket help menu categories. */
|
||||
helpMenuCategoryLoading:boolean,
|
||||
/**Load the default open ticket help menu components. */
|
||||
/**Load the default Open Ticket help menu components. */
|
||||
helpMenuComponentLoading:boolean,
|
||||
|
||||
/**Load the default open ticket stat scopes. */
|
||||
/**Load the default Open Ticket stat scopes. */
|
||||
statScopesLoading:boolean,
|
||||
/**Load the default open ticket stats. */
|
||||
/**Load the default Open Ticket stats. */
|
||||
statLoading:boolean,
|
||||
/**Initiate the default open ticket stats. */
|
||||
/**Initiate the default Open Ticket stats. */
|
||||
statInitiating:boolean,
|
||||
|
||||
/**Load the default open ticket code/functions. */
|
||||
/**Load the default Open Ticket code/functions. */
|
||||
codeLoading:boolean,
|
||||
/**Execute the default open ticket code/functions. */
|
||||
/**Execute the default Open Ticket code/functions. */
|
||||
codeExecution:boolean,
|
||||
|
||||
/**Load the default open ticket livestatus. */
|
||||
/**Load the default Open Ticket livestatus. */
|
||||
liveStatusLoading:boolean,
|
||||
/**Load the default open ticket startscreen. */
|
||||
/**Load the default Open Ticket startscreen. */
|
||||
startScreenLoading:boolean,
|
||||
/**Render the default open ticket startscreen. */
|
||||
/**Render the default Open Ticket startscreen. */
|
||||
startScreenRendering:boolean,
|
||||
|
||||
/**Load the emoji style from the open ticket general config. */
|
||||
/**Load the emoji style from the Open Ticket general config. */
|
||||
emojiTitleStyleLoading:boolean,
|
||||
/**The emoji style to use in embed & message titles using `utilities.emoijTitle()` */
|
||||
emojiTitleStyle:"disabled"|"before"|"after"|"double",
|
||||
@@ -211,9 +217,9 @@ export type ODDefaultsStringArray = {
|
||||
}[keyof ODDefaults]
|
||||
|
||||
/**## ODDefaultsManager `class`
|
||||
* This is an open ticket defaults manager.
|
||||
* This is an Open Ticket defaults manager.
|
||||
*
|
||||
* It manages all settings in open ticket that are not meant to be in the config.
|
||||
* It manages all settings in Open Ticket that are not meant to be in the config.
|
||||
* Here you can disable certain default features to replace them or to specifically enable them!
|
||||
*
|
||||
* You are unable to add your own defaults, you can only edit Open Ticket defaults!
|
||||
@@ -235,6 +241,8 @@ export class ODDefaultsManager {
|
||||
|
||||
flagLoading:true,
|
||||
flagInitiating:true,
|
||||
progressBarRendererLoading:true,
|
||||
progressBarLoading:true,
|
||||
configLoading:true,
|
||||
configInitiating:true,
|
||||
databaseLoading:true,
|
||||
@@ -265,6 +273,7 @@ export class ODDefaultsManager {
|
||||
slashCommandLoading:true,
|
||||
slashCommandRegistering:true,
|
||||
forceSlashCommandRegistration:false,
|
||||
allowSlashCommandRemoval:true,
|
||||
textCommandLoading:true,
|
||||
|
||||
questionLoading:true,
|
||||
|
||||
@@ -5,13 +5,13 @@ import { ODManagerData, ODManager, ODValidId } from "./base"
|
||||
import { ODConsoleWarningMessage, ODDebugger } from "./console"
|
||||
|
||||
/**## ODEvent `class`
|
||||
* This is an open ticket event.
|
||||
* This is an Open Ticket event.
|
||||
*
|
||||
* This class is made to work with the `ODEventManager` to handle events.
|
||||
* The function of this specific class is to manage all listeners for a specifc event!
|
||||
*/
|
||||
export class ODEvent extends ODManagerData {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug?: ODDebugger
|
||||
/**The list of permanent listeners. */
|
||||
listeners: Function[] = []
|
||||
@@ -20,7 +20,7 @@ export class ODEvent extends ODManagerData {
|
||||
/**The max listener limit before a possible memory leak will be announced */
|
||||
listenerLimit: number = 25
|
||||
|
||||
/**Use the open ticket debugger in this manager for logs*/
|
||||
/**Use the Open Ticket debugger in this manager for logs*/
|
||||
useDebug(debug:ODDebugger|null){
|
||||
this.#debug = debug ?? undefined
|
||||
}
|
||||
@@ -71,12 +71,12 @@ export class ODEvent extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODEventManager `class`
|
||||
* This is an open ticket event manager.
|
||||
* This is an Open Ticket event manager.
|
||||
*
|
||||
* This class is made to manage all events in the bot. You can compare it with the built-in node.js `EventEmitter`
|
||||
*
|
||||
* You will probably not create this class yourself, but use it globaly instead!
|
||||
* Check out the `openticket.events` class!
|
||||
* It's not recommended to create this class yourself. Plugin events should be registered in their `plugin.json` file instead.
|
||||
* All events are available in the `openticket.events` global!
|
||||
*/
|
||||
export class ODEventManager extends ODManager<ODEvent> {
|
||||
/**Reference to the Open Ticket debugger */
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ODId, ODValidId, ODManager, ODManagerData } from "./base"
|
||||
import { ODDebugger } from "./console"
|
||||
|
||||
/**## ODFlag `class`
|
||||
* This is an open ticket flag.
|
||||
* This is an Open Ticket flag.
|
||||
*
|
||||
* A flag is a boolean that can be specified by a parameter in the console.
|
||||
* It's useful for small settings that are only required once in a while.
|
||||
@@ -54,7 +54,7 @@ export class ODFlag extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODFlagManager `class`
|
||||
* This is an open ticket flag manager.
|
||||
* This is an Open Ticket flag manager.
|
||||
*
|
||||
* This class is responsible for managing & initiating all flags of the bot.
|
||||
* It also contains a shortcut for initiating all flags.
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ODDebugger } from "./console"
|
||||
export type ODHelpMenuComponentRenderer = (page:number, category:number, location:number, mode:"slash"|"text") => string|Promise<string>
|
||||
|
||||
/**## ODHelpMenuComponent `class`
|
||||
* This is an open ticket help menu component.
|
||||
* This is an Open Ticket help menu component.
|
||||
*
|
||||
* It can render something on the Open Ticket help menu.
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ export class ODHelpMenuComponent extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuTextComponent `class`
|
||||
* This is an open ticket help menu text component.
|
||||
* This is an Open Ticket help menu text component.
|
||||
*
|
||||
* It can render a static piece of text on the Open Ticket help menu.
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ export interface ODHelpMenuCommandComponentSettings {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuCommandComponent `class`
|
||||
* This is an open ticket help menu command component.
|
||||
* This is an Open Ticket help menu command component.
|
||||
*
|
||||
* It contains a useful helper to render a command in the Open Ticket help menu.
|
||||
*/
|
||||
@@ -93,7 +93,7 @@ export class ODHelpMenuCommandComponent extends ODHelpMenuComponent {
|
||||
}
|
||||
|
||||
/**## ODHelpMenuCategory `class`
|
||||
* This is an open ticket help menu category.
|
||||
* This is an Open Ticket help menu category.
|
||||
*
|
||||
* Every category in the help menu is an embed field by default.
|
||||
* Try to limit the amount of components per category.
|
||||
@@ -148,7 +148,7 @@ export class ODHelpMenuCategory extends ODManager<ODHelpMenuComponent> {
|
||||
export type ODHelpMenuRenderResult = {name:string, value:string}[][]
|
||||
|
||||
/**## ODHelpMenuManager `class`
|
||||
* This is an open ticket help menu manager.
|
||||
* This is an Open Ticket help menu manager.
|
||||
*
|
||||
* It is responsible for rendering the entire help menu content.
|
||||
* You are also able to configure the amount of categories per page here.
|
||||
@@ -156,7 +156,7 @@ export type ODHelpMenuRenderResult = {name:string, value:string}[][]
|
||||
* Fewer Categories == More Clean Menu
|
||||
*/
|
||||
export class ODHelpMenuManager extends ODManager<ODHelpMenuCategory> {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
/**The amount of categories per-page. */
|
||||
categoriesPerPage: number = 3
|
||||
|
||||
@@ -6,17 +6,36 @@ import nodepath from "path"
|
||||
import { ODDebugger } from "./console"
|
||||
import fs from "fs"
|
||||
|
||||
/**## ODLanguageMetadata `interface`
|
||||
* This interface contains all metadata available in the language files.
|
||||
*/
|
||||
export interface ODLanguageMetadata {
|
||||
/**The version of Open Ticket this translation is made for. */
|
||||
otversion:string,
|
||||
/**The name of the language in english (with capital letter). */
|
||||
language:string,
|
||||
/**A list of translators (discord/github username) who've contributed to this language. */
|
||||
translators:string[],
|
||||
/**The last date that this translation has been modified (format: DD/MM/YYYY) */
|
||||
lastedited:string,
|
||||
/**When `true`, the translator made use of some sort of automation while creating the translation. (e.g. ChatGPT, Google Translate, DeepL, ...) */
|
||||
automated:boolean
|
||||
}
|
||||
|
||||
/**## ODLanguageManager `class`
|
||||
* This is an Open Ticket language manager.
|
||||
*
|
||||
* It manages all languages in the bot and manages translation for you!
|
||||
* Get a translation via the `getTranslation()` or `getTranslationWithParams()` methods.
|
||||
*
|
||||
* Add new languages using the `ODlanguage` class in your plugin!
|
||||
*/
|
||||
export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
/**The currently selected language. */
|
||||
current: ODLanguage|null = null
|
||||
/**The currently selected backup language. (used when translation missing in current language) */
|
||||
backup: ODLanguage|null = null
|
||||
/**An alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
constructor(debug:ODDebugger, presets:boolean){
|
||||
@@ -27,6 +46,7 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
this.#debug = debug
|
||||
}
|
||||
|
||||
/**Set the current language by providing the ID of a language which is registered in this manager. */
|
||||
setCurrentLanguage(id:ODValidId){
|
||||
this.current = this.get(id)
|
||||
const languageId = this.current?.id.value ?? "<unknown-id>"
|
||||
@@ -36,9 +56,11 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
{key:"automated",value:languageAutomated},
|
||||
])
|
||||
}
|
||||
/**Get the current language (same as `this.current`) */
|
||||
getCurrentLanguage(){
|
||||
return (this.current) ? this.current : null
|
||||
}
|
||||
/**Set the backup language by providing the ID of a language which is registered in this manager. */
|
||||
setBackupLanguage(id:ODValidId){
|
||||
this.backup = this.get(id)
|
||||
const languageId = this.backup?.id.value ?? "<unknown-id>"
|
||||
@@ -48,16 +70,20 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
{key:"automated",value:languageAutomated},
|
||||
])
|
||||
}
|
||||
/**Get the backup language (same as `this.backup`) */
|
||||
getBackupLanguage(){
|
||||
return (this.backup) ? this.backup : null
|
||||
}
|
||||
/**Get the metadata of the current/backup language. */
|
||||
getLanguageMetadata(frombackup?:boolean): ODLanguageMetadata|null {
|
||||
if (frombackup) return (this.backup) ? this.backup.metadata : null
|
||||
return (this.current) ? this.current.metadata : null
|
||||
}
|
||||
/**Get the ID (string) of the current language. (Not backup language) */
|
||||
getCurrentLanguageId(){
|
||||
return (this.current) ? this.current.id.value : ""
|
||||
}
|
||||
/**Get a translation string by JSON location. (e.g. `"checker.system.typeError"`) */
|
||||
getTranslation(id:string): string|null {
|
||||
if (!this.current) return this.#getBackupTranslation(id)
|
||||
|
||||
@@ -75,7 +101,7 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
if (typeof result == "string") return result
|
||||
else return this.#getBackupTranslation(id)
|
||||
}
|
||||
|
||||
/**Get a backup translation string by JSON location. (system only) */
|
||||
#getBackupTranslation(id:string): string|null {
|
||||
if (!this.backup) return null
|
||||
|
||||
@@ -93,7 +119,7 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
if (typeof result == "string") return result
|
||||
else return null
|
||||
}
|
||||
|
||||
/**Get a backup translation string by JSON location and replace `{0}`,`{1}`,`{2}`,... with the provided parameters. */
|
||||
getTranslationWithParams(id:string, params:string[]): string|null {
|
||||
let translation = this.getTranslation(id)
|
||||
if (!translation) return translation
|
||||
@@ -117,6 +143,14 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODLanguage `class`
|
||||
* This is an Open Ticket language file.
|
||||
*
|
||||
* It contains metadata and all translation strings available in this language.
|
||||
* Register this class to an `ODLanguageManager` to use it!
|
||||
*
|
||||
* JSON languages should be created using the `ODJsonLanguage` class instead!
|
||||
*/
|
||||
export class ODLanguage extends ODManagerData {
|
||||
/**The name of the file with extension. */
|
||||
file: string = ""
|
||||
@@ -138,6 +172,14 @@ export class ODLanguage extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODJsonLanguage `class`
|
||||
* This is an Open Ticket JSON language file.
|
||||
*
|
||||
* It contains metadata and all translation strings from a certain JSON file (in `./languages/`).
|
||||
* Register this class to an `ODLanguageManager` to use it!
|
||||
*
|
||||
* Use the `ODLanguage` class to use translations from non-JSON files!
|
||||
*/
|
||||
export class ODJsonLanguage extends ODLanguage {
|
||||
constructor(id:ODValidId, file:string, customPath?:string){
|
||||
super(id,{})
|
||||
|
||||
@@ -5,28 +5,65 @@ import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData } from "./base
|
||||
import * as discord from "discord.js"
|
||||
import { ODDebugger } from "./console"
|
||||
|
||||
/**## ODPermissionType `type`
|
||||
* All available permission types/levels. Can be used in the `ODPermission` class.
|
||||
*/
|
||||
export type ODPermissionType = "member"|"support"|"moderator"|"admin"|"owner"|"developer"
|
||||
|
||||
/**## ODPermissionScope `type`
|
||||
* The scope in which a certain permission is active.
|
||||
*/
|
||||
export type ODPermissionScope = "global-user"|"channel-user"|"global-role"|"channel-role"
|
||||
|
||||
/**## ODPermissionResult `interface`
|
||||
* The result returned by `ODPermissionManager.getPermissions()`.
|
||||
*/
|
||||
export interface ODPermissionResult {
|
||||
/**The permission type. */
|
||||
type:ODPermissionType
|
||||
/**The permission scope. */
|
||||
scope:ODPermissionScope|"default"
|
||||
/**The highest level available for this scope. */
|
||||
level:ODPermissionLevel,
|
||||
/**The permission which returned this level. */
|
||||
source:ODPermission|null
|
||||
}
|
||||
|
||||
/**## ODPermissionLevel `enum`
|
||||
* All available permission types/levels. But as `enum` instead of `type`. Used to calculate the level.
|
||||
*/
|
||||
export enum ODPermissionLevel {
|
||||
/**A normal member. (Default for everyone) */
|
||||
member,
|
||||
/**Support team. Higher than a normal member. (Used for ticket-admins) */
|
||||
support,
|
||||
/**Moderator. Higher than the support team. (Unused) */
|
||||
moderator,
|
||||
/**Admin. Higher than a moderator. (Used for global-admins) */
|
||||
admin,
|
||||
/**Server owner. (Able to use all commands including `/stats reset`) */
|
||||
owner,
|
||||
/**Bot owner or all users from dev team. (Able to use all commands including `/stats reset`) */
|
||||
developer
|
||||
}
|
||||
|
||||
/**## ODPermission `class`
|
||||
* This is an Open Ticket permission.
|
||||
*
|
||||
* It defines a single permission level for a specific scope (global/channel & user/role)
|
||||
* These permissions only apply to commands & interactions.
|
||||
* They are not related to channel permissions in the ticket system.
|
||||
*
|
||||
* Register this class to an `ODPermissionManager` to use it!
|
||||
*/
|
||||
export class ODPermission extends ODManagerData {
|
||||
/**The scope of this permission. */
|
||||
readonly scope: ODPermissionScope
|
||||
/**The type/level of this permission. */
|
||||
readonly permission: ODPermissionType
|
||||
/**The user/role of this permission. */
|
||||
readonly value: discord.Role|discord.User
|
||||
/**The channel that this permission applies to. (`null` when global) */
|
||||
readonly channel: discord.Channel|null
|
||||
|
||||
constructor(id:ODValidId, scope:"global-user", permission:ODPermissionType, value:discord.User)
|
||||
@@ -42,18 +79,39 @@ export class ODPermission extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODPermissionSettings `interface`
|
||||
* Optional settings for the `getPermissions()` method in the `ODPermissionManager`.
|
||||
*/
|
||||
export interface ODPermissionSettings {
|
||||
/**Include permissions from the global user scope. */
|
||||
allowGlobalUserScope?:boolean,
|
||||
/**Include permissions from the global role scope. */
|
||||
allowGlobalRoleScope?:boolean,
|
||||
/**Include permissions from the channel user scope. */
|
||||
allowChannelUserScope?:boolean,
|
||||
/**Include permissions from the channel role scope. */
|
||||
allowChannelRoleScope?:boolean,
|
||||
/**Only include permissions of which the id matches this regex. */
|
||||
idRegex?:RegExp
|
||||
}
|
||||
|
||||
/**## ODPermissionCalculationCallback `type`
|
||||
* The callback of the permission calculation. (Used in `ODPermissionManager`)
|
||||
*/
|
||||
export type ODPermissionCalculationCallback = (user:discord.User, channel?:discord.Channel|null, guild?:discord.Guild|null, settings?:ODPermissionSettings|null) => Promise<ODPermissionResult>
|
||||
|
||||
/**## ODPermissionManager `class`
|
||||
* This is an Open Ticket permission manager.
|
||||
*
|
||||
* It manages all permissions in the bot!
|
||||
* Use the `getPermissions()` and `hasPermissions()` methods to get user perms.
|
||||
*
|
||||
* Add new permissions using the `ODPermission` class in your plugin!
|
||||
*/
|
||||
export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
/**The function for calculating permissions in this manager. */
|
||||
#calculation: ODPermissionCalculationCallback|null
|
||||
/**The result which is returned when no other permissions match. (`member` by default) */
|
||||
defaultResult: ODPermissionResult = {
|
||||
level:ODPermissionLevel["member"],
|
||||
scope:"default",
|
||||
@@ -66,12 +124,15 @@ export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
this.#calculation = useDefaultCalculation ? this.#defaultCalculation : null
|
||||
}
|
||||
|
||||
/**Edit the permission calculation function in this manager. */
|
||||
setCalculation(calculation:ODPermissionCalculationCallback){
|
||||
this.#calculation = calculation
|
||||
}
|
||||
/**Edit the result which is returned when no other permissions match. (`member` by default) */
|
||||
setDefaultResult(result:ODPermissionResult){
|
||||
this.defaultResult = result
|
||||
}
|
||||
/**Get an `ODPermissionResult` based on a few context factors. Use `hasPermissions()` to simplify the result. */
|
||||
getPermissions(user:discord.User, channel?:discord.Channel|null, guild?:discord.Guild|null, settings?:ODPermissionSettings|null): Promise<ODPermissionResult> {
|
||||
try{
|
||||
if (!this.#calculation) throw new ODSystemError("ODPermissionManager:getPermissions() => missing perms calculation")
|
||||
@@ -81,6 +142,7 @@ export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
throw new ODSystemError("ODPermissionManager:getPermissions() => failed perms calculation")
|
||||
}
|
||||
}
|
||||
/**Simplifies the `ODPermissionResult` returned from `getPermissions()` and returns a boolean to check if the user matches the required permissions. */
|
||||
hasPermissions(minimum:ODPermissionType, data:ODPermissionResult){
|
||||
if (minimum == "member") return true
|
||||
else if (minimum == "support") return (data.level >= ODPermissionLevel["support"])
|
||||
@@ -90,6 +152,7 @@ export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
else if (minimum == "developer") return (data.level >= ODPermissionLevel["developer"])
|
||||
else throw new ODSystemError("Invalid minimum permission type at ODPermissionManager.hasPermissions()")
|
||||
}
|
||||
/**Check for permissions. (default calculation) */
|
||||
async #defaultCalculation(user:discord.User,channel?:discord.Channel|null,guild?:discord.Guild|null, settings?:ODPermissionSettings|null): Promise<ODPermissionResult> {
|
||||
const globalCalc = await this.#defaultGlobalCalculation(user,channel,guild,settings)
|
||||
const channelCalc = await this.#defaultChannelCalculation(user,channel,guild,settings)
|
||||
@@ -97,7 +160,7 @@ export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
if (globalCalc.level > channelCalc.level) return globalCalc
|
||||
else return channelCalc
|
||||
}
|
||||
/**Check for global permissions. Then this result can be compared with the channel one. */
|
||||
/**Check for global permissions. Result will be compared with the channel perms in `#defaultCalculation()`. */
|
||||
async #defaultGlobalCalculation(user:discord.User,channel?:discord.Channel|null,guild?:discord.Guild|null, settings?:ODPermissionSettings|null): Promise<ODPermissionResult> {
|
||||
const idRegex = (settings && typeof settings.idRegex != "undefined") ? settings.idRegex : null
|
||||
const allowGlobalUserScope = (settings && typeof settings.allowGlobalUserScope != "undefined") ? settings.allowGlobalUserScope : true
|
||||
@@ -160,7 +223,7 @@ export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
//spread result to prevent accidental referencing
|
||||
return {...this.defaultResult}
|
||||
}
|
||||
/**Check for channel permissions. Then this result can be compared with the global one. */
|
||||
/**Check for channel permissions. Result will be compared with the global perms in `#defaultCalculation()`. */
|
||||
async #defaultChannelCalculation(user:discord.User,channel?:discord.Channel|null,guild?:discord.Guild|null, settings?:ODPermissionSettings|null): Promise<ODPermissionResult> {
|
||||
const idRegex = (settings && typeof settings.idRegex != "undefined") ? settings.idRegex : null
|
||||
const allowChannelUserScope = (settings && typeof settings.allowChannelUserScope != "undefined") ? settings.allowChannelUserScope : true
|
||||
@@ -220,7 +283,7 @@ export class ODPermissionManager extends ODManager<ODPermission> {
|
||||
}
|
||||
}
|
||||
|
||||
//spread result to prevent accidental referencing
|
||||
//spread result to prevent accidental modification because of referencing
|
||||
return {...this.defaultResult}
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,29 @@ import { ODId, ODManager, ODManagerData, ODSystemError, ODValidId, ODVersion } f
|
||||
import nodepath from "path"
|
||||
import { ODConsolePluginMessage, ODConsoleWarningMessage, ODDebugger } from "./console"
|
||||
|
||||
/**## ODUnknownCrashedPlugin `interface`
|
||||
* Basic details for a plugin that crashed while loading the `plugin.json` file.
|
||||
*/
|
||||
export interface ODUnknownCrashedPlugin {
|
||||
/**The name of the plugin. (path when plugin crashed before `name` was loaded) */
|
||||
name:string,
|
||||
/**The description of the plugin. (when found before crashing) */
|
||||
description:string
|
||||
}
|
||||
|
||||
/**## ODPluginManager `class`
|
||||
* This is an Open Ticket plugin manager.
|
||||
*
|
||||
* It manages all active plugins in the bot!
|
||||
* It also contains all "plugin classes" which are managers registered by plugins.
|
||||
* These are accessible via the `openticket.plugins.classes` global.
|
||||
*
|
||||
* Use `isPluginLoaded()` to check if a plugin has been loaded.
|
||||
*/
|
||||
export class ODPluginManager extends ODManager<ODPlugin> {
|
||||
/**A manager for all custom managers registered by plugins. */
|
||||
classes: ODPluginClassManager
|
||||
/**A list of basic details from all plugins that crashed while loading the `plugin.json` file. */
|
||||
unknownCrashedPlugins: ODUnknownCrashedPlugin[] = []
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -19,51 +35,92 @@ export class ODPluginManager extends ODManager<ODPlugin> {
|
||||
this.classes = new ODPluginClassManager(debug)
|
||||
}
|
||||
|
||||
/**Check if a plugin has loaded successfully.*/
|
||||
isPluginLoaded(id:ODValidId){
|
||||
/**Check if a plugin has been loaded successfully and is available for usage.*/
|
||||
isPluginLoaded(id:ODValidId): boolean {
|
||||
const newId = new ODId(id)
|
||||
const plugin = this.get(newId)
|
||||
return (plugin && plugin.executed)
|
||||
return (plugin !== null && plugin.executed)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODPluginData `interface`
|
||||
* Parsed data from the `plugin.json` file in a plugin.
|
||||
*/
|
||||
export interface ODPluginData {
|
||||
/**The name of this plugin (shown on startup) */
|
||||
name:string,
|
||||
/**The id of this plugin. (Must be identical to directory name) */
|
||||
id:string,
|
||||
/**The version of this plugin. */
|
||||
version:string,
|
||||
/**The location of the start file of the plugin relative to the rootDir of the plugin */
|
||||
startFile:string,
|
||||
|
||||
/**Is this plugin enabled? */
|
||||
enabled:boolean,
|
||||
/**The priority of this plugin. Higher priority will load before lower priority. */
|
||||
priority:number,
|
||||
/**A list of events to register to the `openticket.events` global before loading any plugins. This way, plugins with a higher priority are able to use events from this plugin as well! */
|
||||
events:string[]
|
||||
|
||||
/**Npm dependencies which are required for this plugin to work. */
|
||||
npmDependencies:string[],
|
||||
/**Plugins which are required for this plugin to work. */
|
||||
requiredPlugins:string[],
|
||||
/**Plugins which are incompatible with this plugin. */
|
||||
incompatiblePlugins:string[],
|
||||
|
||||
/**Additional details about this plugin. */
|
||||
details:ODPluginDetails
|
||||
}
|
||||
|
||||
/**## ODPluginDetails `interface`
|
||||
* Additional details in the `plugin.json` file from a plugin.
|
||||
*/
|
||||
export interface ODPluginDetails {
|
||||
/**The author of the plugin. */
|
||||
author:string,
|
||||
/**A short description of this plugin. */
|
||||
shortDescription:string,
|
||||
/**A large description of this plugin. */
|
||||
longDescription:string,
|
||||
/**A URL to a cover image of this plugin. (currently unused) */
|
||||
imageUrl:string,
|
||||
/**A URL to the website/project page of this plugin. (currently unused) */
|
||||
projectUrl:string,
|
||||
/**A list of tags/categories that this plugin affects. */
|
||||
tags:string[]
|
||||
}
|
||||
|
||||
/**## ODPlugin `class`
|
||||
* This is an Open Ticket plugin.
|
||||
*
|
||||
* It represents a single plugin in the `./plugins/` directory.
|
||||
* All plugins are accessible via the `openticket.plugins` global.
|
||||
*
|
||||
* Don't re-execute plugins which are already enabled! It might break the bot or plugin.
|
||||
*/
|
||||
export class ODPlugin extends ODManagerData {
|
||||
/**The name of the directory of this plugin. (same as id) */
|
||||
dir: string
|
||||
/**All plugin data found in the `plugin.json` file. */
|
||||
data: ODPluginData
|
||||
/**The name of this plugin. */
|
||||
name: string
|
||||
/**The priority of this plugin. */
|
||||
priority: number
|
||||
/**The version of this plugin. */
|
||||
version: ODVersion
|
||||
/**The additional details of this plugin. */
|
||||
details: ODPluginDetails
|
||||
|
||||
/**Is this plugin enabled? */
|
||||
enabled: boolean
|
||||
/**Did this plugin execute successfully?. */
|
||||
executed: boolean
|
||||
/**Did this plugin crash? (A reason is available in the `crashReason`) */
|
||||
crashed: boolean
|
||||
/**The reason which caused this plugin to crash. */
|
||||
crashReason: null|"incompatible.plugin"|"missing.plugin"|"missing.dependency"|"executed" = null
|
||||
|
||||
constructor(dir:string, jsondata:ODPluginData){
|
||||
@@ -160,6 +217,16 @@ export class ODPlugin extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODPluginClassManager `class`
|
||||
* This is an Open Ticket plugin class manager.
|
||||
*
|
||||
* It manages all managers registered by plugins!
|
||||
* Plugins are able to register their own managers, handlers, functions, classes, ... here.
|
||||
* By doing this, other plugins are also able to make use of it.
|
||||
* This can be useful for plugins that want to extend other plugins.
|
||||
*
|
||||
* Use `isPluginLoaded()` to check if a plugin has been loaded before trying to access the manager.
|
||||
*/
|
||||
export class ODPluginClassManager extends ODManager<ODManagerData> {
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"plugin class")
|
||||
|
||||
@@ -7,11 +7,11 @@ import { ODDebugger } from "./console"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/**## ODPostManager `class`
|
||||
* This is an open ticket post manager.
|
||||
* This is an Open Ticket post manager.
|
||||
*
|
||||
* It manages `ODPosts`'s for you.
|
||||
*
|
||||
* You will probably use this to get the logs channel of the bot (or some other static channel/category).
|
||||
* You can use this to get the logs channel of the bot (or some other static channel/category).
|
||||
*/
|
||||
export class ODPostManager extends ODManager<ODPost<discord.GuildBasedChannel>> {
|
||||
/**A reference to the main server of the bot */
|
||||
@@ -36,7 +36,7 @@ export class ODPostManager extends ODManager<ODPost<discord.GuildBasedChannel>>
|
||||
}
|
||||
|
||||
/**## ODPost `class`
|
||||
* This is an open ticket post class.
|
||||
* This is an Open Ticket post class.
|
||||
*
|
||||
* A post is just a shortcut to a static discord channel or category.
|
||||
* This can be used to get a specific channel over and over again!
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
///////////////////////////////////////
|
||||
//PROGRESS BAR MODULE
|
||||
///////////////////////////////////////
|
||||
import { ODSystemError, ODManager, ODManagerData, ODValidId } from "./base"
|
||||
import { ODDebugger } from "./console"
|
||||
import readline from "readline"
|
||||
|
||||
/**## ODProgressBarRendererManager `class`
|
||||
* This is an Open Ticket progress bar renderer manager.
|
||||
*
|
||||
* It is responsible for managing all console progress bar renderers in Open Ticket.
|
||||
*
|
||||
* A renderer is a function which will try to visualize the progress bar in the console.
|
||||
*/
|
||||
export class ODProgressBarRendererManager extends ODManager<ODProgressBarRenderer<{}>> {
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"progress bar renderer")
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODProgressBarManager `class`
|
||||
* This is an Open Ticket progress bar manager.
|
||||
*
|
||||
* It is responsible for managing all console progress bars in Open Ticket. An example of this is the slash command registration progress bar.
|
||||
*
|
||||
* There are many types of progress bars available, but you can also create your own!
|
||||
*/
|
||||
export class ODProgressBarManager extends ODManager<ODProgressBar> {
|
||||
renderers: ODProgressBarRendererManager
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"progress bar")
|
||||
this.renderers = new ODProgressBarRendererManager(debug)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODProgressBarRenderFunc `type`
|
||||
* This is the render function for an Open Ticket console progress bar.
|
||||
*/
|
||||
export type ODProgressBarRenderFunc<Settings extends {}> = (settings:Settings,min:number,max:number,value:number,prefix:string|null,suffix:string|null) => string
|
||||
|
||||
/**## ODProgressBarRenderer `class`
|
||||
* This is an Open Ticket console progress bar renderer.
|
||||
*
|
||||
* It is used to render a progress bar in the console of the bot.
|
||||
*
|
||||
* There are already a lot of default options available if you just want an easy progress bar!
|
||||
*/
|
||||
export class ODProgressBarRenderer<Settings extends {}> extends ODManagerData {
|
||||
settings: Settings
|
||||
#render: ODProgressBarRenderFunc<Settings>
|
||||
|
||||
constructor(id:ODValidId,render:ODProgressBarRenderFunc<Settings>,settings:Settings){
|
||||
super(id)
|
||||
this.#render = render
|
||||
this.settings = settings
|
||||
}
|
||||
|
||||
/**Render a progress bar using this renderer. */
|
||||
render(min:number,max:number,value:number,prefix:string|null,suffix:string|null){
|
||||
try {
|
||||
return this.#render(this.settings,min,max,value,prefix,suffix)
|
||||
}catch(err){
|
||||
process.emit("uncaughtException",err)
|
||||
return "<PROGRESS-BAR-ERROR>"
|
||||
}
|
||||
}
|
||||
|
||||
withAdditionalSettings(settings:Partial<Settings>): ODProgressBarRenderer<Settings> {
|
||||
const newSettings: Settings = {...this.settings}
|
||||
for (const key of Object.keys(settings)){
|
||||
if (typeof settings[key] != "undefined") newSettings[key] = settings[key]
|
||||
}
|
||||
return new ODProgressBarRenderer(this.id,this.#render,newSettings)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODProgressBar `class`
|
||||
* This is an Open Ticket console progress bar.
|
||||
*
|
||||
* It is used to create a simple or advanced progress bar in the console of the bot.
|
||||
* These progress bars are not visible in the `otdebug.txt` file and should only be used as extra visuals.
|
||||
*
|
||||
* Use other classes as existing templates or create your own progress bar from scratch using this class.
|
||||
*/
|
||||
export class ODProgressBar extends ODManagerData {
|
||||
/**The renderer of this progress bar. */
|
||||
renderer: ODProgressBarRenderer<{}>
|
||||
/**Is this progress bar currently active? */
|
||||
#active: boolean = false
|
||||
/**A list of listeners when the progress bar stops. */
|
||||
#stopListeners: Function[] = []
|
||||
/**The current value of the progress bar. */
|
||||
protected value: number
|
||||
/**The minimum value of the progress bar. */
|
||||
min: number
|
||||
/**The maximum value of the progress bar. */
|
||||
max: number
|
||||
/**The initial value of the progress bar. */
|
||||
initialValue: number
|
||||
/**The prefix displayed in the progress bar. */
|
||||
prefix:string|null
|
||||
/**The prefix displayed in the progress bar. */
|
||||
suffix:string|null
|
||||
|
||||
/**Enable automatic stopping when reaching `min` or `max`. */
|
||||
autoStop: null|"min"|"max"
|
||||
|
||||
constructor(id:ODValidId,renderer:ODProgressBarRenderer<{}>,min:number,max:number,value:number,autoStop:null|"min"|"max",prefix:string|null,suffix:string|null){
|
||||
super(id)
|
||||
this.renderer = renderer
|
||||
this.min = min
|
||||
this.max = max
|
||||
this.initialValue = this.#parseValue(value)
|
||||
this.value = this.#parseValue(value)
|
||||
this.autoStop = autoStop
|
||||
this.prefix = prefix
|
||||
this.suffix = suffix
|
||||
}
|
||||
/**Parse a value in such a way that it doesn't go below/above the min/max limits. */
|
||||
#parseValue(value:number){
|
||||
if (value > this.max) return this.max
|
||||
else if (value < this.min) return this.min
|
||||
else return value
|
||||
}
|
||||
/**Render progress bar to the console. */
|
||||
#renderStdout(){
|
||||
if (!this.#active) return
|
||||
readline.clearLine(process.stdout,0)
|
||||
readline.cursorTo(process.stdout,0)
|
||||
process.stdout.write(this.renderer.render(this.min,this.max,this.value,this.prefix,this.suffix))
|
||||
}
|
||||
/**Start showing this progress bar in the console. */
|
||||
start(): boolean {
|
||||
if (this.#active) return false
|
||||
this.value = this.#parseValue(this.initialValue)
|
||||
this.#active = true
|
||||
this.#renderStdout()
|
||||
return true
|
||||
}
|
||||
/**Update this progress bar while active. (will automatically update the progress bar in the console) */
|
||||
protected update(value:number,stop?:boolean): boolean {
|
||||
if (!this.#active) return false
|
||||
this.value = this.#parseValue(value)
|
||||
this.#renderStdout()
|
||||
if (stop || (this.autoStop == "max" && this.value == this.max) || (this.autoStop == "min" && this.value == this.min)){
|
||||
process.stdout.write("\n")
|
||||
this.#active = false
|
||||
this.#stopListeners.forEach((cb) => cb())
|
||||
this.#stopListeners = []
|
||||
}
|
||||
return true
|
||||
}
|
||||
/**Wait for the progress bar to finish. */
|
||||
finished(): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
this.#stopListeners.push(resolve)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTimedProgressBar `class`
|
||||
* This is an Open Ticket timed console progress bar.
|
||||
*
|
||||
* It is used to create a simple timed progress bar in the console.
|
||||
* You can set a fixed duration (milliseconds) in the constructor.
|
||||
*/
|
||||
export class ODTimedProgressBar extends ODProgressBar {
|
||||
/**The time in milliseconds. */
|
||||
time: number
|
||||
/**The mode of the timer. */
|
||||
mode: "increasing"|"decreasing"
|
||||
|
||||
constructor(id:ODValidId,renderer:ODProgressBarRenderer<{}>,time:number,mode:"increasing"|"decreasing",prefix:string|null,suffix:string|null){
|
||||
super(id,renderer,0,time,0,(mode == "increasing") ? "max" : "min",prefix,suffix)
|
||||
this.time = time
|
||||
this.mode = mode
|
||||
}
|
||||
|
||||
/**The timer which is used. */
|
||||
async #timer(ms:number): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
},ms)
|
||||
})
|
||||
}
|
||||
/**Run the timed progress bar. */
|
||||
async #execute(){
|
||||
let i = 0
|
||||
const fragment = this.time/100
|
||||
while (i < 100){
|
||||
await this.#timer(fragment)
|
||||
i++
|
||||
super.update((this.mode == "increasing") ? (i*fragment) : this.time-(i*fragment))
|
||||
}
|
||||
}
|
||||
start(){
|
||||
const res = super.start()
|
||||
if (!res) return false
|
||||
this.#execute()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODManualProgressBar `class`
|
||||
* This is an Open Ticket manual console progress bar.
|
||||
*
|
||||
* It is used to create a simple manual progress bar in the console.
|
||||
* You can update the progress manually using `update()`.
|
||||
*/
|
||||
export class ODManualProgressBar extends ODProgressBar {
|
||||
constructor(id:ODValidId,renderer:ODProgressBarRenderer<{}>,amount:number,autoStop:null|"min"|"max",prefix:string|null,suffix:string|null){
|
||||
super(id,renderer,0,amount,0,autoStop,prefix,suffix)
|
||||
}
|
||||
/**Set the value of the progress bar. */
|
||||
set(value:number,stop?:boolean){
|
||||
super.update(value,stop)
|
||||
}
|
||||
/**Get the current value of the progress bar. */
|
||||
get(){
|
||||
return this.value
|
||||
}
|
||||
/**Increase the value of the progress bar. */
|
||||
increase(amount:number,stop?:boolean){
|
||||
super.update(this.value+amount,stop)
|
||||
}
|
||||
/**Decrease the value of the progress bar. */
|
||||
decrease(amount:number,stop?:boolean){
|
||||
super.update(this.value-amount,stop)
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import { ODClientManager, ODSlashCommand, ODTextCommand, ODTextCommandInteractio
|
||||
import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder"
|
||||
|
||||
/**## ODResponderImplementation `class`
|
||||
* This is an open ticket responder implementation.
|
||||
* This is an Open Ticket responder implementation.
|
||||
*
|
||||
* It is a basic implementation of the `ODWorkerManager` used by all `ODResponder` classes.
|
||||
*
|
||||
@@ -33,12 +33,33 @@ export class ODResponderImplementation<Instance,Source extends string,Params> ex
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODResponderTimeoutErrorCallback `type`
|
||||
* This is the callback for the responder timeout function. It will be executed when something went wrong or the action takes too much time.
|
||||
*/
|
||||
export type ODResponderTimeoutErrorCallback<Instance, Source extends "slash"|"text"|"button"|"dropdown"|"modal"|"other"> = (instance:Instance, source:Source) => void|Promise<void>
|
||||
|
||||
/**## ODResponderManager `class`
|
||||
* This is an Open Ticket responder manager.
|
||||
*
|
||||
* It contains all Open Ticket responders. Responders can respond to an interaction, button, dropdown, modal or command.
|
||||
*
|
||||
* Using the Open Ticket responder system has a few advantages compared to vanilla discord.js:
|
||||
* - plugins can extend/edit replies
|
||||
* - automatically reply on error
|
||||
* - independent workers (with priority)
|
||||
* - fail-safe design using try-catch
|
||||
* - write code once => reply to both slash & text commands at the same time!
|
||||
* - know where the request came from & parse options/subcommands & without errors!
|
||||
* - And so much more!
|
||||
*/
|
||||
export class ODResponderManager {
|
||||
/**A manager for all (text & slash) command responders. */
|
||||
commands: ODCommandResponderManager
|
||||
/**A manager for all button responders. */
|
||||
buttons: ODButtonResponderManager
|
||||
/**A manager for all dropdown/select menu responders. */
|
||||
dropdowns: ODDropdownResponderManager
|
||||
/**A manager for all modal responders. */
|
||||
modals: ODModalResponderManager
|
||||
|
||||
constructor(debug:ODDebugger, client:ODClientManager){
|
||||
@@ -49,9 +70,26 @@ export class ODResponderManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODCommandResponderManager `class`
|
||||
* This is an Open Ticket command responder manager.
|
||||
*
|
||||
* It contains all Open Ticket command responders. These can respond to text & slash commands.
|
||||
*
|
||||
* Using the Open Ticket responder system has a few advantages compared to vanilla discord.js:
|
||||
* - plugins can extend/edit replies
|
||||
* - automatically reply on error
|
||||
* - independent workers (with priority)
|
||||
* - fail-safe design using try-catch
|
||||
* - write code once => reply to both slash & text commands at the same time!
|
||||
* - know where the request came from & parse options/subcommands & without errors!
|
||||
* - And so much more!
|
||||
*/
|
||||
export class ODCommandResponderManager extends ODManager<ODCommandResponder<"slash"|"text",any>> {
|
||||
/**An alias to the Open Ticket client manager. */
|
||||
#client: ODClientManager
|
||||
/**The callback executed when the default workers take too much time to reply. */
|
||||
#timeoutErrorCallback: ODResponderTimeoutErrorCallback<ODCommandResponderInstance,"slash"|"text">|null = null
|
||||
/**The amount of milliseconds before the timeout error callback is executed. */
|
||||
#timeoutMs: number|null = null
|
||||
|
||||
constructor(debug:ODDebugger, debugname:string, client:ODClientManager){
|
||||
@@ -86,9 +124,17 @@ export class ODCommandResponderManager extends ODManager<ODCommandResponder<"sla
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODCommandResponderInstanceOptions `class`
|
||||
* This is an Open Ticket command responder instance options manager.
|
||||
*
|
||||
* This class will manage all options & subcommands from slash & text commands.
|
||||
*/
|
||||
export class ODCommandResponderInstanceOptions {
|
||||
#interaction:discord.ChatInputCommandInteraction|discord.Message
|
||||
/**The interaction to get data from. */
|
||||
#interaction: discord.ChatInputCommandInteraction|discord.Message
|
||||
/**The command which is related to the interaction. */
|
||||
#cmd:ODSlashCommand|ODTextCommand
|
||||
/**A list of options which have been parsed by the text command parser. */
|
||||
#options: ODTextCommandInteractionOption[]
|
||||
|
||||
constructor(interaction:discord.ChatInputCommandInteraction|discord.Message, cmd:ODSlashCommand|ODTextCommand, options?:ODTextCommandInteractionOption[]){
|
||||
@@ -96,6 +142,8 @@ export class ODCommandResponderInstanceOptions {
|
||||
this.#cmd = cmd
|
||||
this.#options = options ?? []
|
||||
}
|
||||
|
||||
/**Get a string option. */
|
||||
getString(name:string,required:true): string
|
||||
getString(name:string,required:false): string|null
|
||||
getString(name:string,required:boolean){
|
||||
@@ -113,6 +161,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a boolean option. */
|
||||
getBoolean(name:string,required:true): boolean
|
||||
getBoolean(name:string,required:false): boolean|null
|
||||
getBoolean(name:string,required:boolean){
|
||||
@@ -130,6 +179,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a number option. */
|
||||
getNumber(name:string,required:true): number
|
||||
getNumber(name:string,required:false): number|null
|
||||
getNumber(name:string,required:boolean){
|
||||
@@ -147,6 +197,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a channel option. */
|
||||
getChannel(name:string,required:true): discord.TextChannel|discord.VoiceChannel|discord.StageChannel|discord.NewsChannel|discord.MediaChannel|discord.ForumChannel|discord.CategoryChannel
|
||||
getChannel(name:string,required:false): discord.TextChannel|discord.VoiceChannel|discord.StageChannel|discord.NewsChannel|discord.MediaChannel|discord.ForumChannel|discord.CategoryChannel|null
|
||||
getChannel(name:string,required:boolean){
|
||||
@@ -164,6 +215,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a role option. */
|
||||
getRole(name:string,required:true): discord.Role
|
||||
getRole(name:string,required:false): discord.Role|null
|
||||
getRole(name:string,required:boolean){
|
||||
@@ -181,6 +233,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a user option. */
|
||||
getUser(name:string,required:true): discord.User
|
||||
getUser(name:string,required:false): discord.User|null
|
||||
getUser(name:string,required:boolean){
|
||||
@@ -198,6 +251,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a guild member option. */
|
||||
getGuildMember(name:string,required:true): discord.GuildMember
|
||||
getGuildMember(name:string,required:false): discord.GuildMember|null
|
||||
getGuildMember(name:string,required:boolean){
|
||||
@@ -217,8 +271,9 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
getMentionable(name:string,required:true): discord.User|discord.Role
|
||||
getMentionable(name:string,required:false): discord.User|discord.Role|null
|
||||
/**Get a mentionable option. */
|
||||
getMentionable(name:string,required:true): discord.User|discord.GuildMember|discord.Role
|
||||
getMentionable(name:string,required:false): discord.User|discord.GuildMember|discord.Role|null
|
||||
getMentionable(name:string,required:boolean){
|
||||
if (this.#interaction instanceof discord.ChatInputCommandInteraction){
|
||||
try {
|
||||
@@ -229,11 +284,12 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else if (this.#interaction instanceof discord.Message){
|
||||
const opt = this.#options.find((opt) => opt.type == "mentionable" && opt.name == name)
|
||||
if (opt && (opt.value instanceof discord.User || opt.value instanceof discord.Role)) return opt.value
|
||||
if (opt && (opt.value instanceof discord.User || opt.value instanceof discord.GuildMember || opt.value instanceof discord.Role)) return opt.value
|
||||
else return null
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a subgroup. */
|
||||
getSubGroup(): string|null
|
||||
getSubGroup(){
|
||||
if (this.#interaction instanceof discord.ChatInputCommandInteraction){
|
||||
@@ -250,6 +306,7 @@ export class ODCommandResponderInstanceOptions {
|
||||
|
||||
}else return null
|
||||
}
|
||||
/**Get a subcommand. */
|
||||
getSubCommand(): string|null
|
||||
getSubCommand(){
|
||||
if (this.#interaction instanceof discord.ChatInputCommandInteraction){
|
||||
@@ -272,15 +329,30 @@ export class ODCommandResponderInstanceOptions {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**## ODCommandResponderInstance `class`
|
||||
* This is an Open Ticket command responder instance.
|
||||
*
|
||||
* An instance is an active slash interaction or used text command. You can reply to the command using `reply()` for both slash & text commands.
|
||||
*/
|
||||
export class ODCommandResponderInstance {
|
||||
interaction:discord.ChatInputCommandInteraction|discord.Message
|
||||
/**The interaction which is the source of this instance. */
|
||||
interaction: discord.ChatInputCommandInteraction|discord.Message
|
||||
/**The command wich is the source of this instance. */
|
||||
cmd:ODSlashCommand|ODTextCommand
|
||||
/**The type/source of instance. (from text or slash command) */
|
||||
type: "message"|"interaction"
|
||||
/**Did a worker already reply to this instance/interaction? */
|
||||
didReply: boolean = false
|
||||
/**The manager for all options of this command. */
|
||||
options: ODCommandResponderInstanceOptions
|
||||
/**The user who triggered this command. */
|
||||
user: discord.User
|
||||
/**The guild member who triggered this command. */
|
||||
member: discord.GuildMember|null
|
||||
/**The guild where this command was triggered. */
|
||||
guild: discord.Guild|null
|
||||
/**The channel where this command was triggered. */
|
||||
channel: discord.TextBasedChannel
|
||||
|
||||
constructor(interaction:discord.ChatInputCommandInteraction|discord.Message, cmd:ODSlashCommand|ODTextCommand, errorCallback:ODResponderTimeoutErrorCallback<ODCommandResponderInstance,"slash"|"text">|null, timeoutMs:number|null, options?:ODTextCommandInteractionOption[]){
|
||||
@@ -313,15 +385,17 @@ export class ODCommandResponderInstance {
|
||||
},timeoutMs ?? 2500)
|
||||
}
|
||||
|
||||
/**Reply to this command. */
|
||||
async reply(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try {
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.type == "interaction" && this.interaction instanceof discord.ChatInputCommandInteraction){
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:sent}
|
||||
}else{
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}
|
||||
@@ -334,13 +408,16 @@ export class ODCommandResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Defer this command. */
|
||||
async defer(ephemeral:boolean){
|
||||
if (this.type != "interaction" || !(this.interaction instanceof discord.ChatInputCommandInteraction)) return false
|
||||
if (this.interaction.deferred) return false
|
||||
await this.interaction.deferReply({ephemeral})
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
this.didReply = true
|
||||
return true
|
||||
}
|
||||
/**Show a modal as reply to this command. */
|
||||
async modal(modal:ODModalBuildResult){
|
||||
if (this.type != "interaction" || !(this.interaction instanceof discord.ChatInputCommandInteraction)) return false
|
||||
this.interaction.showModal(modal.modal)
|
||||
@@ -349,6 +426,11 @@ export class ODCommandResponderInstance {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODCommandResponder `class`
|
||||
* This is an Open Ticket command responder.
|
||||
*
|
||||
* This class manages all workers which are executed when the related command is triggered.
|
||||
*/
|
||||
export class ODCommandResponder<Source extends "slash"|"text",Params> extends ODResponderImplementation<ODCommandResponderInstance,Source,Params> {
|
||||
/**The prefix of the text command needs to match this */
|
||||
prefix: string
|
||||
@@ -365,10 +447,27 @@ export class ODCommandResponder<Source extends "slash"|"text",Params> extends OD
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODButtonResponderManager `class`
|
||||
* This is an Open Ticket button responder manager.
|
||||
*
|
||||
* It contains all Open Ticket button responders. These can respond to button interactions.
|
||||
*
|
||||
* Using the Open Ticket responder system has a few advantages compared to vanilla discord.js:
|
||||
* - plugins can extend/edit replies
|
||||
* - automatically reply on error
|
||||
* - independent workers (with priority)
|
||||
* - fail-safe design using try-catch
|
||||
* - know where the request came from!
|
||||
* - And so much more!
|
||||
*/
|
||||
export class ODButtonResponderManager extends ODManager<ODButtonResponder<"button",any>> {
|
||||
/**An alias to the Open Ticket client manager. */
|
||||
#client: ODClientManager
|
||||
/**The callback executed when the default workers take too much time to reply. */
|
||||
#timeoutErrorCallback: ODResponderTimeoutErrorCallback<ODButtonResponderInstance,"button">|null = null
|
||||
/**The amount of milliseconds before the timeout error callback is executed. */
|
||||
#timeoutMs: number|null = null
|
||||
/**A list of listeners which will listen to the raw interactionCreate event from discord.js */
|
||||
#listeners: ((interaction:discord.ButtonInteraction) => void)[] = []
|
||||
|
||||
constructor(debug:ODDebugger, debugname:string, client:ODClientManager){
|
||||
@@ -400,13 +499,25 @@ export class ODButtonResponderManager extends ODManager<ODButtonResponder<"butto
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODButtonResponderInstance `class`
|
||||
* This is an Open Ticket button responder instance.
|
||||
*
|
||||
* An instance is an active button interaction. You can reply to the button using `reply()`.
|
||||
*/
|
||||
export class ODButtonResponderInstance {
|
||||
interaction:discord.ButtonInteraction
|
||||
/**The interaction which is the source of this instance. */
|
||||
interaction: discord.ButtonInteraction
|
||||
/**Did a worker already reply to this instance/interaction? */
|
||||
didReply: boolean = false
|
||||
/**The user who triggered this button. */
|
||||
user: discord.User
|
||||
/**The guild member who triggered this button. */
|
||||
member: discord.GuildMember|null
|
||||
/**The guild where this button was triggered. */
|
||||
guild: discord.Guild|null
|
||||
/**The channel where this button was triggered. */
|
||||
channel: discord.TextBasedChannel
|
||||
/**The message this button originates from. */
|
||||
message: discord.Message
|
||||
|
||||
constructor(interaction:discord.ButtonInteraction, errorCallback:ODResponderTimeoutErrorCallback<ODButtonResponderInstance,"button">|null, timeoutMs:number|null){
|
||||
@@ -436,14 +547,16 @@ export class ODButtonResponderInstance {
|
||||
},timeoutMs ?? 2500)
|
||||
}
|
||||
|
||||
/**Reply to this button. */
|
||||
async reply(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try{
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:sent}
|
||||
}else{
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}
|
||||
@@ -451,14 +564,16 @@ export class ODButtonResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Update the message of this button. */
|
||||
async update(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try{
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}else{
|
||||
const sent = await this.interaction.update(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.update(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}
|
||||
@@ -466,22 +581,26 @@ export class ODButtonResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Defer this button. */
|
||||
async defer(type:"reply"|"update", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (type == "reply"){
|
||||
await this.interaction.deferReply({ephemeral})
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
}else{
|
||||
await this.interaction.deferUpdate()
|
||||
}
|
||||
this.didReply = true
|
||||
return true
|
||||
}
|
||||
/**Show a modal as reply to this button. */
|
||||
async modal(modal:ODModalBuildResult){
|
||||
this.interaction.showModal(modal.modal)
|
||||
this.didReply = true
|
||||
return true
|
||||
}
|
||||
|
||||
/**Get a component from the original message of this button. */
|
||||
getMessageComponent(type:"button",id:string|RegExp): discord.ButtonComponent|null
|
||||
getMessageComponent(type:"string-dropdown",id:string|RegExp): discord.StringSelectMenuComponent|null
|
||||
getMessageComponent(type:"user-dropdown",id:string|RegExp): discord.UserSelectMenuComponent|null
|
||||
@@ -505,11 +624,17 @@ export class ODButtonResponderInstance {
|
||||
return result
|
||||
}
|
||||
|
||||
/**Get the first embed of the original message if it exists. */
|
||||
getMessageEmbed(): discord.Embed|null {
|
||||
return this.message.embeds[0] ?? null
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODButtonResponder `class`
|
||||
* This is an Open Ticket button responder.
|
||||
*
|
||||
* This class manages all workers which are executed when the related button is triggered.
|
||||
*/
|
||||
export class ODButtonResponder<Source extends string,Params> extends ODResponderImplementation<ODButtonResponderInstance,Source,Params> {
|
||||
/**Respond to this button */
|
||||
async respond(instance:ODButtonResponderInstance, source:Source, params:Params){
|
||||
@@ -518,10 +643,27 @@ export class ODButtonResponder<Source extends string,Params> extends ODResponder
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODDropdownResponderManager `class`
|
||||
* This is an Open Ticket dropdown responder manager.
|
||||
*
|
||||
* It contains all Open Ticket dropdown responders. These can respond to dropdown interactions.
|
||||
*
|
||||
* Using the Open Ticket responder system has a few advantages compared to vanilla discord.js:
|
||||
* - plugins can extend/edit replies
|
||||
* - automatically reply on error
|
||||
* - independent workers (with priority)
|
||||
* - fail-safe design using try-catch
|
||||
* - know where the request came from!
|
||||
* - And so much more!
|
||||
*/
|
||||
export class ODDropdownResponderManager extends ODManager<ODDropdownResponder<"dropdown",any>> {
|
||||
/**An alias to the Open Ticket client manager. */
|
||||
#client: ODClientManager
|
||||
/**The callback executed when the default workers take too much time to reply. */
|
||||
#timeoutErrorCallback: ODResponderTimeoutErrorCallback<ODDropdownResponderInstance,"dropdown">|null = null
|
||||
/**The amount of milliseconds before the timeout error callback is executed. */
|
||||
#timeoutMs: number|null = null
|
||||
/**A list of listeners which will listen to the raw interactionCreate event from discord.js */
|
||||
#listeners: ((interaction:discord.AnySelectMenuInteraction) => void)[] = []
|
||||
|
||||
constructor(debug:ODDebugger, debugname:string, client:ODClientManager){
|
||||
@@ -553,8 +695,15 @@ export class ODDropdownResponderManager extends ODManager<ODDropdownResponder<"d
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODDropdownResponderInstanceValues `class`
|
||||
* This is an Open Ticket dropdown responder instance values manager.
|
||||
*
|
||||
* This class will manage all values from the dropdowns & select menus.
|
||||
*/
|
||||
export class ODDropdownResponderInstanceValues {
|
||||
#interaction:discord.AnySelectMenuInteraction
|
||||
/**The interaction to get data from. */
|
||||
#interaction: discord.AnySelectMenuInteraction
|
||||
/**The type of this dropdown. */
|
||||
#type: ODDropdownData["type"]
|
||||
|
||||
constructor(interaction:discord.AnySelectMenuInteraction, type:ODDropdownData["type"]){
|
||||
@@ -565,6 +714,8 @@ export class ODDropdownResponderInstanceValues {
|
||||
interaction.values
|
||||
}
|
||||
}
|
||||
|
||||
/**Get the selected values. */
|
||||
getStringValues(): string[] {
|
||||
try {
|
||||
return this.#interaction.values
|
||||
@@ -572,6 +723,7 @@ export class ODDropdownResponderInstanceValues {
|
||||
throw new ODSystemError("ODDropdownResponderInstanceValues:getStringValues() invalid values!")
|
||||
}
|
||||
}
|
||||
/**Get the selected roles. */
|
||||
async getRoleValues(): Promise<discord.Role[]> {
|
||||
if (this.#type != "role") throw new ODSystemError("ODDropdownResponderInstanceValues:getRoleValues() dropdown type isn't role!")
|
||||
try {
|
||||
@@ -586,6 +738,7 @@ export class ODDropdownResponderInstanceValues {
|
||||
throw new ODSystemError("ODDropdownResponderInstanceValues:getRoleValues() invalid values!")
|
||||
}
|
||||
}
|
||||
/**Get the selected users. */
|
||||
async getUserValues(): Promise<discord.User[]> {
|
||||
if (this.#type != "role") throw new ODSystemError("ODDropdownResponderInstanceValues:getUserValues() dropdown type isn't user!")
|
||||
try {
|
||||
@@ -599,6 +752,7 @@ export class ODDropdownResponderInstanceValues {
|
||||
throw new ODSystemError("ODDropdownResponderInstanceValues:getUserValues() invalid values!")
|
||||
}
|
||||
}
|
||||
/**Get the selected channels. */
|
||||
async getChannelValues(): Promise<discord.GuildBasedChannel[]> {
|
||||
if (this.#type != "role") throw new ODSystemError("ODDropdownResponderInstanceValues:getChannelValues() dropdown type isn't channel!")
|
||||
try {
|
||||
@@ -615,15 +769,29 @@ export class ODDropdownResponderInstanceValues {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODDropdownResponderInstance `class`
|
||||
* This is an Open Ticket dropdown responder instance.
|
||||
*
|
||||
* An instance is an active dropdown interaction. You can reply to the dropdown using `reply()`.
|
||||
*/
|
||||
export class ODDropdownResponderInstance {
|
||||
interaction:discord.AnySelectMenuInteraction
|
||||
/**The interaction which is the source of this instance. */
|
||||
interaction: discord.AnySelectMenuInteraction
|
||||
/**Did a worker already reply to this instance/interaction? */
|
||||
didReply: boolean = false
|
||||
/**The dropdown type. */
|
||||
type: ODDropdownData["type"]
|
||||
/**The manager for all values of this dropdown. */
|
||||
values: ODDropdownResponderInstanceValues
|
||||
/**The user who triggered this dropdown. */
|
||||
user: discord.User
|
||||
/**The guild member who triggered this dropdown. */
|
||||
member: discord.GuildMember|null
|
||||
/**The guild where this dropdown was triggered. */
|
||||
guild: discord.Guild|null
|
||||
/**The channel where this dropdown was triggered. */
|
||||
channel: discord.TextBasedChannel
|
||||
/**The message this dropdown originates from. */
|
||||
message: discord.Message
|
||||
|
||||
constructor(interaction:discord.AnySelectMenuInteraction, errorCallback:ODResponderTimeoutErrorCallback<ODDropdownResponderInstance,"dropdown">|null, timeoutMs:number|null){
|
||||
@@ -666,14 +834,16 @@ export class ODDropdownResponderInstance {
|
||||
},timeoutMs ?? 2500)
|
||||
}
|
||||
|
||||
/**Reply to this dropdown. */
|
||||
async reply(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try {
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:sent}
|
||||
}else{
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}
|
||||
@@ -681,14 +851,16 @@ export class ODDropdownResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Update the message of this dropdown. */
|
||||
async update(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try{
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}else{
|
||||
const sent = await this.interaction.update(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.update(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}
|
||||
@@ -696,22 +868,26 @@ export class ODDropdownResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Defer this dropdown. */
|
||||
async defer(type:"reply"|"update", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (type == "reply"){
|
||||
await this.interaction.deferReply({ephemeral})
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
}else{
|
||||
await this.interaction.deferUpdate()
|
||||
}
|
||||
this.didReply = true
|
||||
return true
|
||||
}
|
||||
/**Show a modal as reply to this dropdown. */
|
||||
async modal(modal:ODModalBuildResult){
|
||||
this.interaction.showModal(modal.modal)
|
||||
this.didReply = true
|
||||
return true
|
||||
}
|
||||
|
||||
/**Get a component from the original message of this dropdown. */
|
||||
getMessageComponent(type:"button",id:string|RegExp): discord.ButtonComponent|null
|
||||
getMessageComponent(type:"string-dropdown",id:string|RegExp): discord.StringSelectMenuComponent|null
|
||||
getMessageComponent(type:"user-dropdown",id:string|RegExp): discord.UserSelectMenuComponent|null
|
||||
@@ -735,11 +911,17 @@ export class ODDropdownResponderInstance {
|
||||
return result
|
||||
}
|
||||
|
||||
/**Get the first embed of the original message if it exists. */
|
||||
getMessageEmbed(): discord.Embed|null {
|
||||
return this.message.embeds[0] ?? null
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODDropdownResponder `class`
|
||||
* This is an Open Ticket dropdown responder.
|
||||
*
|
||||
* This class manages all workers which are executed when the related dropdown is triggered.
|
||||
*/
|
||||
export class ODDropdownResponder<Source extends string,Params> extends ODResponderImplementation<ODDropdownResponderInstance,Source,Params> {
|
||||
/**Respond to this dropdown */
|
||||
async respond(instance:ODDropdownResponderInstance, source:Source, params:Params){
|
||||
@@ -748,10 +930,27 @@ export class ODDropdownResponder<Source extends string,Params> extends ODRespond
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODModalResponderManager `class`
|
||||
* This is an Open Ticket modal responder manager.
|
||||
*
|
||||
* It contains all Open Ticket modal responders. These can respond to modal interactions.
|
||||
*
|
||||
* Using the Open Ticket responder system has a few advantages compared to vanilla discord.js:
|
||||
* - plugins can extend/edit replies
|
||||
* - automatically reply on error
|
||||
* - independent workers (with priority)
|
||||
* - fail-safe design using try-catch
|
||||
* - know where the request came from!
|
||||
* - And so much more!
|
||||
*/
|
||||
export class ODModalResponderManager extends ODManager<ODModalResponder<"modal",any>> {
|
||||
/**An alias to the Open Ticket client manager. */
|
||||
#client: ODClientManager
|
||||
/**The callback executed when the default workers take too much time to reply. */
|
||||
#timeoutErrorCallback: ODResponderTimeoutErrorCallback<ODModalResponderInstance,"modal">|null = null
|
||||
/**The amount of milliseconds before the timeout error callback is executed. */
|
||||
#timeoutMs: number|null = null
|
||||
/**A list of listeners which will listen to the raw interactionCreate event from discord.js */
|
||||
#listeners: ((interaction:discord.ModalSubmitInteraction) => void)[] = []
|
||||
|
||||
constructor(debug:ODDebugger, debugname:string, client:ODClientManager){
|
||||
@@ -783,12 +982,20 @@ export class ODModalResponderManager extends ODManager<ODModalResponder<"modal",
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODModalResponderInstanceValues `class`
|
||||
* This is an Open Ticket modal responder instance values manager.
|
||||
*
|
||||
* This class will manage all fields from the modals.
|
||||
*/
|
||||
export class ODModalResponderInstanceValues {
|
||||
#interaction:discord.ModalSubmitInteraction
|
||||
/**The interaction to get data from. */
|
||||
#interaction: discord.ModalSubmitInteraction
|
||||
|
||||
constructor(interaction:discord.ModalSubmitInteraction){
|
||||
this.#interaction = interaction
|
||||
}
|
||||
|
||||
/**Get the value of a text field. */
|
||||
getTextField(name:string,required:true): string
|
||||
getTextField(name:string,required:false): string|null
|
||||
getTextField(name:string,required:boolean){
|
||||
@@ -802,13 +1009,25 @@ export class ODModalResponderInstanceValues {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODModalResponderInstance `class`
|
||||
* This is an Open Ticket modal responder instance.
|
||||
*
|
||||
* An instance is an active modal interaction. You can reply to the modal using `reply()`.
|
||||
*/
|
||||
export class ODModalResponderInstance {
|
||||
interaction:discord.ModalSubmitInteraction
|
||||
/**The interaction which is the source of this instance. */
|
||||
interaction: discord.ModalSubmitInteraction
|
||||
/**Did a worker already reply to this instance/interaction? */
|
||||
didReply: boolean = false
|
||||
/**The manager for all fields of this modal. */
|
||||
values: ODModalResponderInstanceValues
|
||||
/**The user who triggered this modal. */
|
||||
user: discord.User
|
||||
/**The guild member who triggered this modal. */
|
||||
member: discord.GuildMember|null
|
||||
/**The guild where this modal was triggered. */
|
||||
guild: discord.Guild|null
|
||||
/**The channel where this modal was triggered. */
|
||||
channel: discord.TextBasedChannel|null
|
||||
|
||||
constructor(interaction:discord.ModalSubmitInteraction, errorCallback:ODResponderTimeoutErrorCallback<ODModalResponderInstance,"modal">|null, timeoutMs:number|null){
|
||||
@@ -837,14 +1056,16 @@ export class ODModalResponderInstance {
|
||||
},timeoutMs ?? 2500)
|
||||
}
|
||||
|
||||
/**Reply to this modal. */
|
||||
async reply(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try{
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:sent}
|
||||
}else{
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.reply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}
|
||||
@@ -852,10 +1073,12 @@ export class ODModalResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Update the message of this modal. */
|
||||
async update(msg:ODMessageBuildResult): Promise<ODMessageBuildSentResult<boolean>> {
|
||||
try{
|
||||
const msgFlags: number[] = msg.ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
if (this.interaction.replied || this.interaction.deferred){
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{ephemeral:msg.ephemeral}))
|
||||
const sent = await this.interaction.editReply(Object.assign(msg.message,{flags:msgFlags}))
|
||||
this.didReply = true
|
||||
return {success:true,message:await sent.fetch()}
|
||||
}else throw new ODSystemError()
|
||||
@@ -863,10 +1086,12 @@ export class ODModalResponderInstance {
|
||||
return {success:false,message:null}
|
||||
}
|
||||
}
|
||||
/**Defer this modal. */
|
||||
async defer(type:"reply"|"update", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (type == "reply"){
|
||||
await this.interaction.deferReply({ephemeral})
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
}else{
|
||||
await this.interaction.deferUpdate()
|
||||
}
|
||||
@@ -875,6 +1100,11 @@ export class ODModalResponderInstance {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODModalResponder `class`
|
||||
* This is an Open Ticket modal responder.
|
||||
*
|
||||
* This class manages all workers which are executed when the related modal is triggered.
|
||||
*/
|
||||
export class ODModalResponder<Source extends string,Params> extends ODResponderImplementation<ODModalResponderInstance,Source,Params> {
|
||||
/**Respond to this modal */
|
||||
async respond(instance:ODModalResponderInstance, source:Source, params:Params){
|
||||
|
||||
@@ -6,9 +6,9 @@ import { ODDebugger } from "./console"
|
||||
import * as crypto from "crypto"
|
||||
|
||||
/**## ODSessionManager `class`
|
||||
* This is an open ticket session manager.
|
||||
* This is an Open Ticket session manager.
|
||||
*
|
||||
* It contains all sessions in open ticket. Sessions are a sort of temporary storage which will be cleared when the bot stops.
|
||||
* It contains all sessions in Open Ticket. Sessions are a sort of temporary storage which will be cleared when the bot stops.
|
||||
* Data in sessions have a randomly generated key which will always be unique.
|
||||
*
|
||||
* Visit the `ODSession` class for more info
|
||||
@@ -39,7 +39,7 @@ export interface ODSessionInstance {
|
||||
export type ODSessionTimeoutCallback = (id:string, timeout:"default"|"custom", data:any, creation:Date) => void
|
||||
|
||||
/**## ODSession `class`
|
||||
* This is an open ticket session.
|
||||
* This is an Open Ticket session.
|
||||
*
|
||||
* It can be used to create 100% unique id's for usage in the bot. An id can also store additional data which isn't saved to the filesystem.
|
||||
* You can almost compare it to the PHP session system.
|
||||
|
||||
@@ -7,8 +7,17 @@ import { ODFlag } from "./flag"
|
||||
import { ODPlugin, ODUnknownCrashedPlugin } from "./plugin"
|
||||
import ansis from "ansis"
|
||||
|
||||
/**## ODStartScreenComponentRenderCallback `type`
|
||||
* This is the render function of a startscreen component. It also sends the location of where the component is rendered.
|
||||
*/
|
||||
export type ODStartScreenComponentRenderCallback = (location:number) => string|Promise<string>
|
||||
|
||||
/**## ODStartScreenManager `class`
|
||||
* This is an Open Ticket startscreen manager.
|
||||
*
|
||||
* This class is responsible for managing & rendering the startscreen of the bot.
|
||||
* The startscreen is the part you see when the bot has started up successfully. (e.g. the Open Ticket logo, logs, livestatus, flags, ...)
|
||||
*/
|
||||
export class ODStartScreenManager extends ODManager<ODStartScreenComponent> {
|
||||
/**Alias to the Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
@@ -47,10 +56,22 @@ export class ODStartScreenManager extends ODManager<ODStartScreenComponent> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenComponent `class`
|
||||
* This is an Open Ticket startscreen component.
|
||||
*
|
||||
* This component can be rendered to the start screen of the bot.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*
|
||||
* It's recommended to use pre-built components except if you really need a custom one.
|
||||
*/
|
||||
export class ODStartScreenComponent extends ODManagerData {
|
||||
/**The priority of this component. */
|
||||
priority: number
|
||||
/**An optional render function which will be inserted before the default renderer. */
|
||||
renderBefore: ODStartScreenComponentRenderCallback|null = null
|
||||
/**The render function which will render the contents of this component. */
|
||||
render: ODStartScreenComponentRenderCallback
|
||||
/**An optional render function which will be inserted behind the default renderer. */
|
||||
renderAfter: ODStartScreenComponentRenderCallback|null = null
|
||||
|
||||
constructor(id:ODValidId, priority:number, render:ODStartScreenComponentRenderCallback){
|
||||
@@ -59,6 +80,7 @@ export class ODStartScreenComponent extends ODManagerData {
|
||||
this.render = render
|
||||
}
|
||||
|
||||
/**Render this component and combine it with the `renderBefore` & `renderAfter` contents. */
|
||||
async renderAll(location:number){
|
||||
const textBefore = (this.renderBefore) ? await this.renderBefore(location) : ""
|
||||
const text = await this.render(location)
|
||||
@@ -67,15 +89,30 @@ export class ODStartScreenComponent extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenProperty `type`
|
||||
* This interface contains properties used in a few default templates of the startscreen component.
|
||||
*/
|
||||
export interface ODStartScreenProperty {
|
||||
/**The key or name of this property. */
|
||||
key:string,
|
||||
/**The value or contents of this property. */
|
||||
value:string
|
||||
}
|
||||
|
||||
/**## ODStartScreenLogoComponent `class`
|
||||
* This is an Open Ticket startscreen logo component.
|
||||
*
|
||||
* This component will render an ASCII art logo (from an array) to the startscreen. Every property in the array is another row.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenLogoComponent extends ODStartScreenComponent {
|
||||
/**The ASCII logo contents. */
|
||||
logo: string[]
|
||||
/**When enabled, the component will add a new line above the logo. */
|
||||
topPadding: boolean
|
||||
/**When enabled, the component will add a new line below the logo. */
|
||||
bottomPadding: boolean
|
||||
/**The color of the logo in hex format. */
|
||||
logoHexColor: string
|
||||
|
||||
constructor(id:ODValidId, priority:number, logo:string[], topPadding?:boolean, bottomPadding?:boolean, logoHexColor?:string){
|
||||
@@ -92,14 +129,28 @@ export class ODStartScreenLogoComponent extends ODStartScreenComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenHeaderAlignmentSettings `type`
|
||||
* This interface contains all settings used in the startscreen header component.
|
||||
*/
|
||||
export interface ODStartScreenHeaderAlignmentSettings {
|
||||
/**The alignment settings for this header. */
|
||||
align:"center"|"left"|"right",
|
||||
/**The width or component to use when calculating center & right alignment. */
|
||||
width:number|ODStartScreenComponent
|
||||
}
|
||||
|
||||
/**## ODStartScreenHeaderComponent `class`
|
||||
* This is an Open Ticket startscreen header component.
|
||||
*
|
||||
* This component will render a header to the startscreen. Properties can be aligned left, right or centered.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenHeaderComponent extends ODStartScreenComponent {
|
||||
/**All properties of this header component. */
|
||||
properties: ODStartScreenProperty[]
|
||||
/**The spacer used between properties. */
|
||||
spacer: string
|
||||
/**The alignment settings of this header component. */
|
||||
align: ODStartScreenHeaderAlignmentSettings|null
|
||||
|
||||
constructor(id:ODValidId, priority:number, properties:ODStartScreenProperty[], spacer?:string, align?:ODStartScreenHeaderAlignmentSettings){
|
||||
@@ -140,8 +191,16 @@ export class ODStartScreenHeaderComponent extends ODStartScreenComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenCategoryComponent `class`
|
||||
* This is an Open Ticket startscreen category component.
|
||||
*
|
||||
* This component will render a category to the startscreen. This will only render the category name. You'll need to provide your own renderer for the contents.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenCategoryComponent extends ODStartScreenComponent {
|
||||
/**The name of this category. */
|
||||
name: string
|
||||
/**When enabled, this category will still be rendered when the contents are empty. (enabled by default) */
|
||||
renderIfEmpty: boolean
|
||||
|
||||
constructor(id:ODValidId, priority:number, name:string, render:ODStartScreenComponentRenderCallback, renderIfEmpty?:boolean){
|
||||
@@ -156,8 +215,16 @@ export class ODStartScreenCategoryComponent extends ODStartScreenComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenPropertiesCategoryComponent `class`
|
||||
* This is an Open Ticket startscreen properties category component.
|
||||
*
|
||||
* This component will render a properties category to the startscreen. This will list the properties in the category.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenPropertiesCategoryComponent extends ODStartScreenCategoryComponent {
|
||||
/**The properties of this category component. */
|
||||
properties: ODStartScreenProperty[]
|
||||
/**The hex color for the key/name of all the properties. */
|
||||
propertyHexColor: string
|
||||
|
||||
constructor(id:ODValidId, priority:number, name:string, properties:ODStartScreenProperty[], propertyHexColor?:string, renderIfEmpty?:boolean){
|
||||
@@ -170,7 +237,14 @@ export class ODStartScreenPropertiesCategoryComponent extends ODStartScreenCateg
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenFlagsCategoryComponent `class`
|
||||
* This is an Open Ticket startscreen flags category component.
|
||||
*
|
||||
* This component will render a flags category to the startscreen. This will list the enabled flags in the category.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenFlagsCategoryComponent extends ODStartScreenCategoryComponent {
|
||||
/**A list of all flags to render. */
|
||||
flags: ODFlag[]
|
||||
|
||||
constructor(id:ODValidId, priority:number, flags:ODFlag[]){
|
||||
@@ -181,8 +255,16 @@ export class ODStartScreenFlagsCategoryComponent extends ODStartScreenCategoryCo
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenPluginsCategoryComponent `class`
|
||||
* This is an Open Ticket startscreen plugins category component.
|
||||
*
|
||||
* This component will render a plugins category to the startscreen. This will list the enabled, disabled & crashed plugins in the category.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenPluginsCategoryComponent extends ODStartScreenCategoryComponent {
|
||||
/**A list of all plugins to render. */
|
||||
plugins: ODPlugin[]
|
||||
/**A list of all crashed plugins to render. */
|
||||
unknownCrashedPlugins: ODUnknownCrashedPlugin[]
|
||||
|
||||
constructor(id:ODValidId, priority:number, plugins:ODPlugin[], unknownCrashedPlugins:ODUnknownCrashedPlugin[]){
|
||||
@@ -200,7 +282,14 @@ export class ODStartScreenPluginsCategoryComponent extends ODStartScreenCategory
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenLiveStatusCategoryComponent `class`
|
||||
* This is an Open Ticket startscreen livestatus category component.
|
||||
*
|
||||
* This component will render a livestatus category to the startscreen. This will list the livestatus messages in the category.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenLiveStatusCategoryComponent extends ODStartScreenCategoryComponent {
|
||||
/**A reference to the Open Ticket livestatus manager. */
|
||||
livestatus: ODLiveStatusManager
|
||||
|
||||
constructor(id:ODValidId, priority:number, livestatus:ODLiveStatusManager){
|
||||
@@ -212,6 +301,12 @@ export class ODStartScreenLiveStatusCategoryComponent extends ODStartScreenCateg
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStartScreenLogsCategoryComponent `class`
|
||||
* This is an Open Ticket startscreen logs category component.
|
||||
*
|
||||
* This component will render a logs category to the startscreen. This will only render the logs category name.
|
||||
* An optional priority can be specified to choose the location of the component.
|
||||
*/
|
||||
export class ODStartScreenLogCategoryComponent extends ODStartScreenCategoryComponent {
|
||||
constructor(id:ODValidId, priority:number){
|
||||
super(id,priority,"logs",() => "",true)
|
||||
|
||||
@@ -6,14 +6,35 @@ import { ODDebugger } from "./console"
|
||||
import { ODDatabase, ODJsonDatabaseStructure } from "./database"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/**## ODValidStatValue `type`
|
||||
* These are the only allowed types for a stat value to improve compatibility with different database systems.
|
||||
*/
|
||||
export type ODValidStatValue = string|number|boolean
|
||||
|
||||
/**## ODStatsManagerInitCallback `type`
|
||||
* This callback can be used to execute something when the stats have been initiated.
|
||||
*
|
||||
* By default this is used to clear stats from users that left the server or tickets which don't exist anymore.
|
||||
*/
|
||||
export type ODStatsManagerInitCallback = (database:ODJsonDatabaseStructure, deletables:ODJsonDatabaseStructure) => void|Promise<void>
|
||||
|
||||
/**## ODStatScopeSetMode `type`
|
||||
* This type contains all valid methods for changing the value of a stat.
|
||||
*/
|
||||
export type ODStatScopeSetMode = "set"|"increase"|"decrease"
|
||||
|
||||
/**## ODStatsManager `class`
|
||||
* This is an Open Ticket stats manager.
|
||||
*
|
||||
* This class is responsible for managing all stats of the bot.
|
||||
* Stats are categorized in "scopes" which can be accessed in this manager.
|
||||
*
|
||||
* Stats can be accessed in the individual scopes.
|
||||
*/
|
||||
export class ODStatsManager extends ODManager<ODStatScope> {
|
||||
/**Alias to open ticket debugger. */
|
||||
/**Alias to Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
/**Alias to open ticket stats database. */
|
||||
/**Alias to Open Ticket stats database. */
|
||||
database: ODDatabase|null = null
|
||||
/**All the listeners for the init event. */
|
||||
#initListeners: ODStatsManagerInitCallback[] = []
|
||||
@@ -23,6 +44,7 @@ export class ODStatsManager extends ODManager<ODStatScope> {
|
||||
this.#debug = debug
|
||||
}
|
||||
|
||||
/**Select the database to use to read/write all stats from/to. */
|
||||
useDatabase(database:ODDatabase){
|
||||
this.database = database
|
||||
}
|
||||
@@ -31,6 +53,7 @@ export class ODStatsManager extends ODManager<ODStatScope> {
|
||||
if (this.database) data.useDatabase(this.database)
|
||||
return super.add(data,overwrite)
|
||||
}
|
||||
/**Init all stats and run `onInit()` listeners. */
|
||||
async init(){
|
||||
if (!this.database) throw new ODSystemError("Unable to initialize stats scopes due to missing database!")
|
||||
|
||||
@@ -58,6 +81,7 @@ export class ODStatsManager extends ODManager<ODStatScope> {
|
||||
await this.database.delete(data.category,data.key)
|
||||
}
|
||||
}
|
||||
/**Reset all stats. (clears the entire database) */
|
||||
async reset(){
|
||||
if (!this.database) return
|
||||
const data = await this.database.getAll()
|
||||
@@ -66,17 +90,26 @@ export class ODStatsManager extends ODManager<ODStatScope> {
|
||||
await this.database.delete(d.category,d.key)
|
||||
}
|
||||
}
|
||||
/**Run a function when the stats are initialized. This can be used to clear stats from users that left the server or tickets which don't exist anymore. */
|
||||
onInit(callback:ODStatsManagerInitCallback){
|
||||
this.#initListeners.push(callback)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStatScope `class`
|
||||
* This is an Open Ticket stat scope.
|
||||
*
|
||||
* A scope can contain multiple stats. Every scope is seperated from other scopes.
|
||||
* Here, you can read & write the values of all stats.
|
||||
*
|
||||
* The built-in Open Ticket scopes are: `global`, `user`, `ticket`
|
||||
*/
|
||||
export class ODStatScope extends ODManager<ODStat> {
|
||||
/**The id of this statistics scope. */
|
||||
id: ODId
|
||||
/**Is this stat scope already initialized? */
|
||||
ready: boolean = false
|
||||
/**Alias to open ticket stats database. */
|
||||
/**Alias to Open Ticket stats database. */
|
||||
database: ODDatabase|null = null
|
||||
/**The name of this scope (used in embed title) */
|
||||
name:string
|
||||
@@ -87,9 +120,11 @@ export class ODStatScope extends ODManager<ODStat> {
|
||||
this.name = name
|
||||
}
|
||||
|
||||
/**Select the database to use to read/write all stats from/to. (Automatically assigned when used in `ODStatsManager`) */
|
||||
useDatabase(database:ODDatabase){
|
||||
this.database = database
|
||||
}
|
||||
/**Get the value of a statistic. The `scopeId` is the unique id of the user, channel, role, etc that the stats are related to. */
|
||||
async getStat(id:ODValidId, scopeId:string): Promise<ODValidStatValue|null> {
|
||||
if (!this.database) return null
|
||||
const newId = new ODId(id)
|
||||
@@ -105,6 +140,7 @@ export class ODStatScope extends ODManager<ODStat> {
|
||||
//return null on error
|
||||
return null
|
||||
}
|
||||
/**Set, increase or decrease the value of a statistic. The `scopeId` is the unique id of the user, channel, role, etc that the stats are related to. */
|
||||
async setStat(id:ODValidId, scopeId:string, value:ODValidStatValue, mode:ODStatScopeSetMode): Promise<boolean> {
|
||||
if (!this.database) return false
|
||||
const stat = this.get(id)
|
||||
@@ -112,16 +148,17 @@ export class ODStatScope extends ODManager<ODStat> {
|
||||
if (mode == "set" || typeof value != "number"){
|
||||
await this.database.set(this.id.value+"_"+stat.id.value,scopeId,value)
|
||||
}else if (mode == "increase"){
|
||||
const currentValue = this.getStat(id,scopeId)
|
||||
if (typeof currentValue != "number") await this.database.set(this.id.value+"_"+stat.id.value,scopeId,0)
|
||||
const currentValue = await this.getStat(id,scopeId)
|
||||
if (typeof currentValue != "number") await this.database.set(this.id.value+"_"+stat.id.value,scopeId,0+value)
|
||||
else await this.database.set(this.id.value+"_"+stat.id.value,scopeId,currentValue+value)
|
||||
}else if (mode == "decrease"){
|
||||
const currentValue = this.getStat(id,scopeId)
|
||||
if (typeof currentValue != "number") await this.database.set(this.id.value+"_"+stat.id.value,scopeId,0)
|
||||
const currentValue = await this.getStat(id,scopeId)
|
||||
if (typeof currentValue != "number") await this.database.set(this.id.value+"_"+stat.id.value,scopeId,0-value)
|
||||
else await this.database.set(this.id.value+"_"+stat.id.value,scopeId,currentValue-value)
|
||||
}
|
||||
return true
|
||||
}
|
||||
/**Reset the value of a statistic to the initial value. The `scopeId` is the unique id of the user, channel, role, etc that the stats are related to. */
|
||||
async resetStat(id:ODValidId, scopeId:string): Promise<ODValidStatValue|null> {
|
||||
if (!this.database) return null
|
||||
const stat = this.get(id)
|
||||
@@ -129,11 +166,13 @@ export class ODStatScope extends ODManager<ODStat> {
|
||||
if (stat.value != null) await this.database.set(this.id.value+"_"+stat.id.value,scopeId,stat.value)
|
||||
return stat.value
|
||||
}
|
||||
/**Initialize this stat scope & return a list of all statistic ids in the following format: `<scopeid>_<statid>` */
|
||||
init(): string[] {
|
||||
//get all valid stats categories
|
||||
this.ready = true
|
||||
return this.getAll().map((stat) => this.id.value+"_"+stat.id.value)
|
||||
}
|
||||
/**Render all stats in this scope for usage in a discord message/embed. */
|
||||
async render(scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User): Promise<string> {
|
||||
//sort from high priority to low
|
||||
const derefArray = [...this.getAll()]
|
||||
@@ -162,6 +201,14 @@ export class ODStatScope extends ODManager<ODStat> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStatGlobalScope `class`
|
||||
* This is an Open Ticket stat global scope.
|
||||
*
|
||||
* A scope can contain multiple stats. Every scope is seperated from other scopes.
|
||||
* Here, you can read & write the values of all stats.
|
||||
*
|
||||
* This scope is made specifically for the global stats of Open Ticket.
|
||||
*/
|
||||
export class ODStatGlobalScope extends ODStatScope {
|
||||
getStat(id:ODValidId): Promise<ODValidStatValue|null> {
|
||||
return super.getStat(id,"GLOBAL")
|
||||
@@ -177,11 +224,25 @@ export class ODStatGlobalScope extends ODStatScope {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODStatRenderer `type`
|
||||
* This callback will render a single statistic for a discord embed/message.
|
||||
*/
|
||||
export type ODStatRenderer = (value:ODValidStatValue, scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User) => string|Promise<string>
|
||||
|
||||
/**## ODStat `class`
|
||||
* This is an Open Ticket statistic.
|
||||
*
|
||||
* This single statistic doesn't do anything except defining the rules of this statistic.
|
||||
* Use it in a stats scope to register a new statistic. A statistic can also include a priority to choose the render priority.
|
||||
*
|
||||
* It's recommended to use the `ODBasicStat` & `ODDynamicStat` classes instead of this one!
|
||||
*/
|
||||
export class ODStat extends ODManagerData {
|
||||
/**The priority of this statistic. */
|
||||
priority: number
|
||||
/**The render function of this statistic. */
|
||||
render: ODStatRenderer
|
||||
/**The value of this statistic. */
|
||||
value: ODValidStatValue|null
|
||||
|
||||
constructor(id:ODValidId, priority:number, render:ODStatRenderer, value?:ODValidStatValue){
|
||||
@@ -192,7 +253,14 @@ export class ODStat extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODBasicStat `class`
|
||||
* This is an Open Ticket basic statistic.
|
||||
*
|
||||
* This single statistic will store a number, boolean or string in the database.
|
||||
* Use it to create a simple statistic for any stats scope.
|
||||
*/
|
||||
export class ODBasicStat extends ODStat {
|
||||
/**The name of this stat. Rendered in discord embeds/messages. */
|
||||
name: string
|
||||
|
||||
constructor(id:ODValidId, priority:number, name:string, value:ODValidStatValue){
|
||||
@@ -203,8 +271,19 @@ export class ODBasicStat extends ODStat {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODDynamicStatRenderer `type`
|
||||
* This callback will render a single dynamic statistic for a discord embed/message.
|
||||
*/
|
||||
export type ODDynamicStatRenderer = (scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User) => string|Promise<string>
|
||||
|
||||
/**## ODDynamicStat `class`
|
||||
* This is an Open Ticket dynamic statistic.
|
||||
*
|
||||
* A dynamic statistic does not store anything in the database! Instead, it will execute a function to return a custom result.
|
||||
* This can be used to show statistics which are not stored in the database.
|
||||
*
|
||||
* This is used in Open Ticket for the live ticket status, participants & system status.
|
||||
*/
|
||||
export class ODDynamicStat extends ODStat {
|
||||
constructor(id:ODValidId, priority:number, render:ODDynamicStatRenderer){
|
||||
super(id,priority,(value,scopeId,guild,channel,user) => {
|
||||
|
||||
@@ -8,12 +8,21 @@ import { ODButtonResponderInstance } from "./responder"
|
||||
import * as discord from "discord.js"
|
||||
import { ODWorkerManager } from "./worker"
|
||||
|
||||
export type ODVerifyBarCallback = (responder:ODButtonResponderInstance,customData?:string) => void|Promise<void>
|
||||
|
||||
/**## ODVerifyBar `class`
|
||||
* This is an Open Ticket verifybar.
|
||||
*
|
||||
* It is contains 2 sets of workers and a lot of utilities for the (✅ ❌) verifybars in the bot.
|
||||
*
|
||||
* It doesn't contain the code which activates or spawns the verifybars!
|
||||
*/
|
||||
export class ODVerifyBar extends ODManagerData {
|
||||
/**All workers that will run when the verifybar is accepted. */
|
||||
success: ODWorkerManager<ODButtonResponderInstance,"verifybar",{data:string|null,verifybarMessage:discord.Message<boolean>|null}>
|
||||
/**All workers that will run when the verifybar is stopped. */
|
||||
failure: ODWorkerManager<ODButtonResponderInstance,"verifybar",{data:string|null,verifybarMessage:discord.Message<boolean>|null}>
|
||||
/**The message that will be built wen activating this verifybar. */
|
||||
message: ODMessage<"verifybar",{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,verifybar:ODVerifyBar,originalMessage:discord.Message<boolean>}>
|
||||
/**When disabled, it will skip the verifybar and instantly fire the `success` workers. */
|
||||
enabled: boolean
|
||||
|
||||
constructor(id:ODValidId, message:ODMessage<"verifybar",{guild:discord.Guild|null,channel:discord.TextBasedChannel,user:discord.User,originalMessage:discord.Message<boolean>}>, enabled?:boolean){
|
||||
@@ -24,6 +33,7 @@ export class ODVerifyBar extends ODManagerData {
|
||||
this.enabled = enabled ?? true
|
||||
}
|
||||
|
||||
/**Build the message and reply to a button with this verifybar. */
|
||||
async activate(responder:ODButtonResponderInstance){
|
||||
if (this.enabled){
|
||||
//show verifybar
|
||||
@@ -36,6 +46,14 @@ export class ODVerifyBar extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODVerifyBarManager `class`
|
||||
* This is an Open Ticket verifybar manager.
|
||||
*
|
||||
* It contains all (✅ ❌) verifybars in the bot.
|
||||
* The `ODVerifyBar` classes contain `ODWorkerManager`'s that will be fired when the continue/stop buttons are pressed.
|
||||
*
|
||||
* It doesn't contain the code which activates the verifybars! This should be implemented by your own.
|
||||
*/
|
||||
export class ODVerifyBarManager extends ODManager<ODVerifyBar> {
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"verifybar")
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ODId, ODManager, ODManagerData, ODValidId } from "./base"
|
||||
export type ODWorkerCallback<Instance, Source extends string, Params> = (instance:Instance, params:Params, source:Source, cancel:() => void) => void|Promise<void>
|
||||
|
||||
/**## ODWorker `class`
|
||||
* This is an open ticket worker.
|
||||
* This is an Open Ticket worker.
|
||||
*
|
||||
* You can compare it with a normal javascript callback, but slightly more advanced!
|
||||
*
|
||||
@@ -32,11 +32,11 @@ export class ODWorker<Instance, Source extends string, Params> extends ODManager
|
||||
}
|
||||
|
||||
/**## ODWorker `class`
|
||||
* This is an open ticket worker manager.
|
||||
* This is an Open Ticket worker manager.
|
||||
*
|
||||
* It manages & executes `ODWorker`'s in the correct order.
|
||||
*
|
||||
* You will probably register a custom worker in this class to create a message or button.
|
||||
* You can register a custom worker in this class to create a message or button.
|
||||
*/
|
||||
export class ODWorkerManager<Instance, Source extends string, Params> extends ODManager<ODWorker<Instance,Source,Params>> {
|
||||
/**The order of execution for workers inside this manager. */
|
||||
|
||||
@@ -4,7 +4,15 @@
|
||||
import { ODManager, ODManagerData, ODValidId } from "../modules/base"
|
||||
import { ODDebugger } from "../modules/console"
|
||||
|
||||
/**## ODBlacklist `class`
|
||||
* This is an Open Ticket blacklisted user.
|
||||
*
|
||||
* This class contains the id of the user this class belongs to & an optional reason for being blacklisted.
|
||||
*
|
||||
* Create this class & add it to the `ODBlacklistManager` to blacklist someone!
|
||||
*/
|
||||
export class ODBlacklist extends ODManagerData {
|
||||
/**The reason why this user got blacklisted. (optional) */
|
||||
#reason: string|null
|
||||
|
||||
constructor(id:ODValidId,reason:string|null){
|
||||
@@ -12,6 +20,7 @@ export class ODBlacklist extends ODManagerData {
|
||||
this.#reason = reason
|
||||
}
|
||||
|
||||
/**The reason why this user got blacklisted. (optional) */
|
||||
set reason(reason:string|null) {
|
||||
this.#reason = reason
|
||||
this._change()
|
||||
@@ -21,6 +30,13 @@ export class ODBlacklist extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODBlacklistManager `class`
|
||||
* This is an Open Ticket blacklist manager.
|
||||
*
|
||||
* This class manages all blacklisted users & their reason. Check if someone is blacklisted using their ID in the `exists()` method.
|
||||
*
|
||||
* All `ODBlacklist`'s added, removed & edited in this list will be synced automatically with the database.
|
||||
*/
|
||||
export class ODBlacklistManager extends ODManager<ODBlacklist> {
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"blacklist")
|
||||
|
||||
@@ -7,10 +7,19 @@ import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODValidButtonCo
|
||||
import { ODDebugger } from "../modules/console"
|
||||
import * as discord from "discord.js"
|
||||
import * as crypto from "crypto"
|
||||
import { OTRoleUpdateMode } from "./role"
|
||||
import { ODRoleUpdateMode } from "./role"
|
||||
|
||||
/**## ODOptionManager `class`
|
||||
* This is an Open Ticket option manager.
|
||||
*
|
||||
* This class manages all registered options in the bot. This also includes temporary options generated from tickets where the original option got deleted.
|
||||
*
|
||||
* All option types including: tickets, websites & reaction roles are stored here.
|
||||
*/
|
||||
export class ODOptionManager extends ODManager<ODOption> {
|
||||
/**A reference to the Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
/**The option suffix manager used to generate channel suffixes for ticket names. */
|
||||
suffix: ODOptionSuffixManager
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -25,20 +34,41 @@ export class ODOptionManager extends ODManager<ODOption> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionDataJson `interface`
|
||||
* The JSON representatation from a single option property.
|
||||
*/
|
||||
export interface ODOptionDataJson {
|
||||
/**The id of this property. */
|
||||
id:string,
|
||||
/**The value of this property. */
|
||||
value:ODValidJsonType
|
||||
}
|
||||
|
||||
/**## ODOptionDataJson `interface`
|
||||
* The JSON representatation from a single option.
|
||||
*/
|
||||
export interface ODOptionJson {
|
||||
/**The id of this option. */
|
||||
id:string,
|
||||
/**The type of this option. (e.g. `openticket:ticket`, `openticket:website`, `openticket:role`) */
|
||||
type:string,
|
||||
/**The version of Open Ticket used to create this option & store it in the database. */
|
||||
version:string,
|
||||
/**The full list of properties/variables related to this option. */
|
||||
data:ODOptionDataJson[]
|
||||
}
|
||||
|
||||
/**## ODOption `class`
|
||||
* This is an Open Ticket option.
|
||||
*
|
||||
* This class contains all data related to this option (parsed from the config).
|
||||
*
|
||||
* It's recommended to use `ODTicketOption`, `ODWebsiteOption` or `ODRoleOption` instead!
|
||||
*/
|
||||
export class ODOption extends ODManager<ODOptionData<ODValidJsonType>> {
|
||||
/**The id of this option. (from the config) */
|
||||
id:ODId
|
||||
/**The type of this option. (e.g. `openticket:ticket`, `openticket:website`, `openticket:role`) */
|
||||
type: string
|
||||
|
||||
constructor(id:ODValidId, type:string, data:ODOptionData<ODValidJsonType>[]){
|
||||
@@ -50,6 +80,7 @@ export class ODOption extends ODManager<ODOptionData<ODValidJsonType>> {
|
||||
})
|
||||
}
|
||||
|
||||
/**Convert this option to a JSON object for storing this option in the database. */
|
||||
toJson(version:ODVersion): ODOptionJson {
|
||||
const data = this.getAll().map((data) => {
|
||||
return {
|
||||
@@ -66,12 +97,21 @@ export class ODOption extends ODManager<ODOptionData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**Create an option from a JSON object in the database. */
|
||||
static fromJson(json:ODOptionJson): ODOption {
|
||||
return new ODOption(json.id,json.type,json.data.map((data) => new ODOptionData(data.id,data.value)))
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionData `class`
|
||||
* This is Open Ticket option data.
|
||||
*
|
||||
* This class contains a single property for an option. (string, number, boolean, object, array, null)
|
||||
*
|
||||
* When this property is edited, the database will be updated automatically.
|
||||
*/
|
||||
export class ODOptionData<DataType extends ODValidJsonType> extends ODManagerData {
|
||||
/**The value of this property. */
|
||||
#value: DataType
|
||||
|
||||
constructor(id:ODValidId, value:DataType){
|
||||
@@ -79,6 +119,7 @@ export class ODOptionData<DataType extends ODValidJsonType> extends ODManagerDat
|
||||
this.#value = value
|
||||
}
|
||||
|
||||
/**The value of this property. */
|
||||
set value(value:DataType){
|
||||
this.#value = value
|
||||
this._change()
|
||||
@@ -93,7 +134,7 @@ export class ODOptionData<DataType extends ODValidJsonType> extends ODManagerDat
|
||||
}
|
||||
|
||||
/**## ODTicketOptionIds `type`
|
||||
* This type is an array of ids available in the `ODTicketOption` class.
|
||||
* This interface is a list of ids available in the `ODTicketOption` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODTicketOptionIds {
|
||||
@@ -144,6 +185,13 @@ export interface ODTicketOptionIds {
|
||||
"openticket:limits-maximum-user":ODOptionData<number>
|
||||
}
|
||||
|
||||
/**## ODTicketOption `class`
|
||||
* This is an Open Ticket ticket option.
|
||||
*
|
||||
* This class contains all data related to an Open Ticket ticket option (parsed from the config).
|
||||
*
|
||||
* Use this option to create a new ticket!
|
||||
*/
|
||||
export class ODTicketOption extends ODOption {
|
||||
type: "openticket:ticket" = "openticket:ticket"
|
||||
|
||||
@@ -178,7 +226,7 @@ export class ODTicketOption extends ODOption {
|
||||
}
|
||||
|
||||
/**## ODWebsiteOptionIds `type`
|
||||
* This type is an array of ids available in the `ODWebsiteOption` class.
|
||||
* This interface is a list of ids available in the `ODWebsiteOption` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODWebsiteOptionIds {
|
||||
@@ -191,6 +239,13 @@ export interface ODWebsiteOptionIds {
|
||||
"openticket:url":ODOptionData<string>,
|
||||
}
|
||||
|
||||
/**## ODWebsiteOption `class`
|
||||
* This is an Open Ticket website option.
|
||||
*
|
||||
* This class contains all data related to an Open Ticket website option (parsed from the config).
|
||||
*
|
||||
* Use this option to create a button which links to a website!
|
||||
*/
|
||||
export class ODWebsiteOption extends ODOption {
|
||||
type: "openticket:website" = "openticket:website"
|
||||
|
||||
@@ -225,7 +280,7 @@ export class ODWebsiteOption extends ODOption {
|
||||
}
|
||||
|
||||
/**## ODRoleOptionIds `type`
|
||||
* This type is an array of ids available in the `ODRoleOption` class.
|
||||
* This interface is a list of ids available in the `ODRoleOption` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODRoleOptionIds {
|
||||
@@ -237,11 +292,18 @@ export interface ODRoleOptionIds {
|
||||
"openticket:button-color":ODOptionData<ODValidButtonColor>,
|
||||
|
||||
"openticket:roles":ODOptionData<string[]>,
|
||||
"openticket:mode":ODOptionData<OTRoleUpdateMode>,
|
||||
"openticket:mode":ODOptionData<ODRoleUpdateMode>,
|
||||
"openticket:remove-roles-on-add":ODOptionData<string[]>,
|
||||
"openticket:add-on-join":ODOptionData<boolean>
|
||||
}
|
||||
|
||||
/**## ODRoleOption `class`
|
||||
* This is an Open Ticket role option.
|
||||
*
|
||||
* This class contains all data related to an Open Ticket role option (parsed from the config).
|
||||
*
|
||||
* Use this option to create a button for reaction roles!
|
||||
*/
|
||||
export class ODRoleOption extends ODOption {
|
||||
type: "openticket:role" = "openticket:role"
|
||||
|
||||
@@ -275,18 +337,19 @@ export class ODRoleOption extends ODOption {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionSuffixManager `class`
|
||||
* This is an Open Ticket option suffix manager.
|
||||
*
|
||||
* This class manages all suffixes from option in the bot. The id of an option suffix is the same as the option id.
|
||||
*
|
||||
* All ticket options should have a corresponding option suffix class.
|
||||
*/
|
||||
export class ODOptionSuffixManager extends ODManager<ODOptionSuffix> {
|
||||
/**Alias to open ticket global database. */
|
||||
database: ODDatabase|null = null
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
super(debug,"ticket suffix")
|
||||
}
|
||||
|
||||
useDatabase(database:ODDatabase){
|
||||
this.database = database
|
||||
}
|
||||
/**Instantly get the suffix from an option. */
|
||||
/**Instantly get the suffix from an `ODTicketOption`. */
|
||||
getSuffixFromOption(option:ODTicketOption,user:discord.User): string|null {
|
||||
const suffix = this.getAll().find((suffix) => suffix.option.id.value == option.id.value)
|
||||
if (!suffix) return null
|
||||
@@ -294,6 +357,13 @@ export class ODOptionSuffixManager extends ODManager<ODOptionSuffix> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionSuffix `class`
|
||||
* This is an Open Ticket option suffix.
|
||||
*
|
||||
* This class can generate a suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionSuffix extends ODManagerData {
|
||||
/**The option of this suffix. */
|
||||
option: ODTicketOption
|
||||
@@ -309,18 +379,39 @@ export class ODOptionSuffix extends ODManagerData {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionUserNameSuffix `class`
|
||||
* This is an Open Ticket user-name option suffix.
|
||||
*
|
||||
* This class can generate a user-name suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionUserNameSuffix extends ODOptionSuffix {
|
||||
getSuffix(user:discord.User): string {
|
||||
return user.username
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionUserIdSuffix `class`
|
||||
* This is an Open Ticket user-id option suffix.
|
||||
*
|
||||
* This class can generate a user-id suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionUserIdSuffix extends ODOptionSuffix {
|
||||
getSuffix(user:discord.User): string {
|
||||
return user.id
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionCounterDynamicSuffix `class`
|
||||
* This is an Open Ticket counter-dynamic option suffix.
|
||||
*
|
||||
* This class can generate a counter-dynamic suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionCounterDynamicSuffix extends ODOptionSuffix {
|
||||
/**The database where the value of this counter is stored. */
|
||||
database: ODDatabase
|
||||
@@ -331,6 +422,7 @@ export class ODOptionCounterDynamicSuffix extends ODOptionSuffix {
|
||||
this.#init()
|
||||
}
|
||||
|
||||
/**Initialize the database for this suffix. */
|
||||
async #init(){
|
||||
if (!await this.database.exists("openticket:option-suffix-counter",this.option.id.value)) await this.database.set("openticket:option-suffix-counter",this.option.id.value,0)
|
||||
}
|
||||
@@ -343,6 +435,13 @@ export class ODOptionCounterDynamicSuffix extends ODOptionSuffix {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionCounterFixedSuffix `class`
|
||||
* This is an Open Ticket counter-fixed option suffix.
|
||||
*
|
||||
* This class can generate a counter-fixed suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionCounterFixedSuffix extends ODOptionSuffix {
|
||||
/**The database where the value of this counter is stored. */
|
||||
database: ODDatabase
|
||||
@@ -353,6 +452,7 @@ export class ODOptionCounterFixedSuffix extends ODOptionSuffix {
|
||||
this.#init()
|
||||
}
|
||||
|
||||
/**Initialize the database for this suffix. */
|
||||
async #init(){
|
||||
if (!await this.database.exists("openticket:option-suffix-counter",this.option.id.value)) await this.database.set("openticket:option-suffix-counter",this.option.id.value,0)
|
||||
}
|
||||
@@ -369,6 +469,13 @@ export class ODOptionCounterFixedSuffix extends ODOptionSuffix {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionRandomNumberSuffix `class`
|
||||
* This is an Open Ticket random-number option suffix.
|
||||
*
|
||||
* This class can generate a random-number suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionRandomNumberSuffix extends ODOptionSuffix {
|
||||
/**The database where previous random numbers are stored. */
|
||||
database: ODDatabase
|
||||
@@ -379,9 +486,11 @@ export class ODOptionRandomNumberSuffix extends ODOptionSuffix {
|
||||
this.#init()
|
||||
}
|
||||
|
||||
/**Initialize the database for this suffix. */
|
||||
async #init(){
|
||||
if (!await this.database.exists("openticket:option-suffix-history",this.option.id.value)) await this.database.set("openticket:option-suffix-history",this.option.id.value,[])
|
||||
}
|
||||
/**Get a unique number for this suffix. */
|
||||
#generateUniqueValue(history:string[]): string {
|
||||
const rawNumber = Math.round(Math.random()*1000).toString()
|
||||
let number = rawNumber
|
||||
@@ -403,6 +512,13 @@ export class ODOptionRandomNumberSuffix extends ODOptionSuffix {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODOptionRandomHexSuffix `class`
|
||||
* This is an Open Ticket random-hex option suffix.
|
||||
*
|
||||
* This class can generate a random-hex suffix for a discord channel name from a specific option.
|
||||
*
|
||||
* Use `getSuffix()` to get the new suffix!
|
||||
*/
|
||||
export class ODOptionRandomHexSuffix extends ODOptionSuffix {
|
||||
/**The database where previous random hexes are stored. */
|
||||
database: ODDatabase
|
||||
@@ -413,10 +529,11 @@ export class ODOptionRandomHexSuffix extends ODOptionSuffix {
|
||||
this.#init()
|
||||
}
|
||||
|
||||
/**Initialize the database for this suffix. */
|
||||
async #init(){
|
||||
if (!await this.database.exists("openticket:option-suffix-history",this.option.id.value)) await this.database.set("openticket:option-suffix-history",this.option.id.value,[])
|
||||
|
||||
}
|
||||
/**Get a unique hex-string for this suffix. */
|
||||
#generateUniqueValue(history:string[]): string {
|
||||
const hex = crypto.randomBytes(2).toString("hex")
|
||||
if (history.includes(hex)) return this.#generateUniqueValue(history)
|
||||
|
||||
@@ -5,7 +5,15 @@ import { ODJsonConfig_DefaultPanelEmbedSettingsType } from "../defaults/config"
|
||||
import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODValidButtonColor, ODManagerData } from "../modules/base"
|
||||
import { ODDebugger } from "../modules/console"
|
||||
|
||||
/**## ODPanelManager `class`
|
||||
* This is an Open Ticket panel manager.
|
||||
*
|
||||
* This class manages all registered panels in the bot. Only panels which are available in this manager can be auto-updated.
|
||||
*
|
||||
* Panels are not stored in the database and will be parsed from the config every startup.
|
||||
*/
|
||||
export class ODPanelManager extends ODManager<ODPanel> {
|
||||
/**A reference to the Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -19,19 +27,30 @@ export class ODPanelManager extends ODManager<ODPanel> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODPanelDataJson `interface`
|
||||
* The JSON representatation from a single panel property.
|
||||
*/
|
||||
export interface ODPanelDataJson {
|
||||
/**The id of this property. */
|
||||
id:string,
|
||||
/**The value of this property. */
|
||||
value:ODValidJsonType
|
||||
}
|
||||
|
||||
/**## ODPanelDataJson `interface`
|
||||
* The JSON representatation from a single panel.
|
||||
*/
|
||||
export interface ODPanelJson {
|
||||
/**The id of this panel. */
|
||||
id:string,
|
||||
/**The version of Open Ticket used to create this panel. */
|
||||
version:string,
|
||||
/**The full list of properties/variables related to this panel. */
|
||||
data:ODPanelDataJson[]
|
||||
}
|
||||
|
||||
/**## ODPanelIds `type`
|
||||
* This type is an array of ids available in the `ODPanel` class.
|
||||
* This interface is a list of ids available in the `ODPanel` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODPanelIds {
|
||||
@@ -54,7 +73,13 @@ export interface ODPanelIds {
|
||||
"openticket:describe-options-in-embed-description":ODPanelData<boolean>
|
||||
}
|
||||
|
||||
/**## ODPanel `class`
|
||||
* This is an Open Ticket panel.
|
||||
*
|
||||
* This class contains all data related to this panel (parsed from the config).
|
||||
*/
|
||||
export class ODPanel extends ODManager<ODPanelData<ODValidJsonType>> {
|
||||
/**The id of this panel. (from the config) */
|
||||
id:ODId
|
||||
|
||||
constructor(id:ODValidId, data:ODPanelData<ODValidJsonType>[]){
|
||||
@@ -65,6 +90,7 @@ export class ODPanel extends ODManager<ODPanelData<ODValidJsonType>> {
|
||||
})
|
||||
}
|
||||
|
||||
/**Convert this panel to a JSON object for storing this panel in the database. */
|
||||
toJson(version:ODVersion): ODPanelJson {
|
||||
const data = this.getAll().map((data) => {
|
||||
return {
|
||||
@@ -80,6 +106,7 @@ export class ODPanel extends ODManager<ODPanelData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**Create a panel from a JSON object in the database. */
|
||||
static fromJson(json:ODPanelJson): ODPanel {
|
||||
return new ODPanel(json.id,json.data.map((data) => new ODPanelData(data.id,data.value)))
|
||||
}
|
||||
@@ -106,7 +133,15 @@ export class ODPanel extends ODManager<ODPanelData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODPanelData `class`
|
||||
* This is Open Ticket panel data.
|
||||
*
|
||||
* This class contains a single property for a panel. (string, number, boolean, object, array, null)
|
||||
*
|
||||
* When this property is edited, the database will be updated automatically.
|
||||
*/
|
||||
export class ODPanelData<DataType extends ODValidJsonType> extends ODManagerData {
|
||||
/**The value of this property. */
|
||||
#value: DataType
|
||||
|
||||
constructor(id:ODValidId, value:DataType){
|
||||
@@ -114,6 +149,7 @@ export class ODPanelData<DataType extends ODValidJsonType> extends ODManagerData
|
||||
this.#value = value
|
||||
}
|
||||
|
||||
/**The value of this property. */
|
||||
set value(value:DataType){
|
||||
this.#value = value
|
||||
this._change()
|
||||
|
||||
@@ -4,7 +4,15 @@
|
||||
import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODManagerData } from "../modules/base"
|
||||
import { ODDebugger } from "../modules/console"
|
||||
|
||||
/**## ODQuestionManager `class`
|
||||
* This is an Open Ticket question manager.
|
||||
*
|
||||
* This class manages all registered questions in the bot. Only questions which are available in this manager can be used in options.
|
||||
*
|
||||
* Questions are not stored in the database and will be parsed from the config every startup.
|
||||
*/
|
||||
export class ODQuestionManager extends ODManager<ODQuestion> {
|
||||
/**A reference to the Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -18,20 +26,41 @@ export class ODQuestionManager extends ODManager<ODQuestion> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODQuestionDataJson `interface`
|
||||
* The JSON representatation from a single question property.
|
||||
*/
|
||||
export interface ODQuestionDataJson {
|
||||
/**The id of this property. */
|
||||
id:string,
|
||||
/**The value of this property. */
|
||||
value:ODValidJsonType
|
||||
}
|
||||
|
||||
/**## ODQuestionDataJson `interface`
|
||||
* The JSON representatation from a single question.
|
||||
*/
|
||||
export interface ODQuestionJson {
|
||||
/**The id of this question. */
|
||||
id:string,
|
||||
/**The type of this question. */
|
||||
type:string,
|
||||
/**The version of Open Ticket used to create this question. */
|
||||
version:string,
|
||||
/**The full list of properties/variables related to this question. */
|
||||
data:ODQuestionDataJson[]
|
||||
}
|
||||
|
||||
/**## ODQuestion `class`
|
||||
* This is an Open Ticket question.
|
||||
*
|
||||
* This class contains all data related to this question (parsed from the config).
|
||||
*
|
||||
* Use `ODShortQuestion` or `ODParagraphQuestion` instead!
|
||||
*/
|
||||
export class ODQuestion extends ODManager<ODQuestionData<ODValidJsonType>> {
|
||||
/**The id of this question. (from the config) */
|
||||
id:ODId
|
||||
/**The type of this question (e.g. `openticket:short` or `openticket:paragraph`) */
|
||||
type: string
|
||||
|
||||
constructor(id:ODValidId, type:string, data:ODQuestionData<ODValidJsonType>[]){
|
||||
@@ -43,6 +72,7 @@ export class ODQuestion extends ODManager<ODQuestionData<ODValidJsonType>> {
|
||||
})
|
||||
}
|
||||
|
||||
/**Convert this question to a JSON object for storing this question in the database. */
|
||||
toJson(version:ODVersion): ODQuestionJson {
|
||||
const data = this.getAll().map((data) => {
|
||||
return {
|
||||
@@ -59,12 +89,21 @@ export class ODQuestion extends ODManager<ODQuestionData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**Create a question from a JSON object in the database. */
|
||||
static fromJson(json:ODQuestionJson): ODQuestion {
|
||||
return new ODQuestion(json.id,json.type,json.data.map((data) => new ODQuestionData(data.id,data.value)))
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODQuestionData `class`
|
||||
* This is Open Ticket question data.
|
||||
*
|
||||
* This class contains a single property for a question. (string, number, boolean, object, array, null)
|
||||
*
|
||||
* When this property is edited, the database will be updated automatically.
|
||||
*/
|
||||
export class ODQuestionData<DataType extends ODValidJsonType> extends ODManagerData {
|
||||
/**The value of this property. */
|
||||
#value: DataType
|
||||
|
||||
constructor(id:ODValidId, value:DataType){
|
||||
@@ -72,6 +111,7 @@ export class ODQuestionData<DataType extends ODValidJsonType> extends ODManagerD
|
||||
this.#value = value
|
||||
}
|
||||
|
||||
/**The value of this property. */
|
||||
set value(value:DataType){
|
||||
this.#value = value
|
||||
this._change()
|
||||
@@ -86,7 +126,7 @@ export class ODQuestionData<DataType extends ODValidJsonType> extends ODManagerD
|
||||
}
|
||||
|
||||
/**## ODShortQuestionIds `type`
|
||||
* This type is an array of ids available in the `ODShortQuestion` class.
|
||||
* This interface is a list of ids available in the `ODShortQuestion` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODShortQuestionIds {
|
||||
@@ -99,6 +139,13 @@ export interface ODShortQuestionIds {
|
||||
"openticket:length-max":ODQuestionData<number>
|
||||
}
|
||||
|
||||
/**## ODShortQuestion `class`
|
||||
* This is an Open Ticket short question.
|
||||
*
|
||||
* This class contains all data related to an Open Ticket short question (parsed from the config).
|
||||
*
|
||||
* Use this question in an option to add a short text field to the modal!
|
||||
*/
|
||||
export class ODShortQuestion extends ODQuestion {
|
||||
type: "openticket:short" = "openticket:short"
|
||||
|
||||
@@ -133,7 +180,7 @@ export class ODShortQuestion extends ODQuestion {
|
||||
}
|
||||
|
||||
/**## ODParagraphQuestionIds `type`
|
||||
* This type is an array of ids available in the `ODParagraphQuestion` class.
|
||||
* This interface is a list of ids available in the `ODParagraphQuestion` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODParagraphQuestionIds {
|
||||
@@ -146,6 +193,13 @@ export interface ODParagraphQuestionIds {
|
||||
"openticket:length-max":ODQuestionData<number>
|
||||
}
|
||||
|
||||
/**## ODParagraphQuestion `class`
|
||||
* This is an Open Ticket paragraph question.
|
||||
*
|
||||
* This class contains all data related to an Open Ticket paragraph question (parsed from the config).
|
||||
*
|
||||
* Use this question in an option to add a paragraph text field to the modal!
|
||||
*/
|
||||
export class ODParagraphQuestion extends ODQuestion {
|
||||
type: "openticket:paragraph" = "openticket:paragraph"
|
||||
|
||||
|
||||
@@ -5,7 +5,15 @@ import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODManagerData }
|
||||
import { ODDebugger } from "../modules/console"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/**## ODRoleManager `class`
|
||||
* This is an Open Ticket role manager.
|
||||
*
|
||||
* This class manages all registered reaction roles in the bot.
|
||||
*
|
||||
* Roles are not stored in the database and will be parsed from the config every startup.
|
||||
*/
|
||||
export class ODRoleManager extends ODManager<ODRole> {
|
||||
/**A reference to the Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
constructor(debug:ODDebugger){
|
||||
@@ -19,50 +27,48 @@ export class ODRoleManager extends ODManager<ODRole> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODRoleDataJson `interface`
|
||||
* The JSON representatation from a single role property.
|
||||
*/
|
||||
export interface ODRoleDataJson {
|
||||
/**The id of this property. */
|
||||
id:string,
|
||||
/**The value of this property. */
|
||||
value:ODValidJsonType
|
||||
}
|
||||
|
||||
/**## ODRoleDataJson `interface`
|
||||
* The JSON representatation from a single role.
|
||||
*/
|
||||
export interface ODRoleJson {
|
||||
/**The id of this role. */
|
||||
id:string,
|
||||
/**The version of Open Ticket used to create this role. */
|
||||
version:string,
|
||||
/**The full list of properties/variables related to this role. */
|
||||
data:ODRoleDataJson[]
|
||||
}
|
||||
|
||||
export class ODRoleData<DataType extends ODValidJsonType> extends ODManagerData {
|
||||
#value: DataType
|
||||
|
||||
constructor(id:ODValidId, value:DataType){
|
||||
super(id)
|
||||
this.#value = value
|
||||
}
|
||||
|
||||
set value(value:DataType){
|
||||
this.#value = value
|
||||
this._change()
|
||||
}
|
||||
get value(): DataType {
|
||||
return this.#value
|
||||
}
|
||||
/**Refresh the database. Is only required to be used when updating `ODRoleData` with an object/array as value. */
|
||||
refreshDatabase(){
|
||||
this._change()
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODRoleIds `type`
|
||||
* This type is an array of ids available in the `ODRole` class.
|
||||
* This interface is a list of ids available in the `ODRole` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODRoleIds {
|
||||
"openticket:roles":ODRoleData<string[]>,
|
||||
"openticket:mode":ODRoleData<OTRoleUpdateMode>,
|
||||
"openticket:mode":ODRoleData<ODRoleUpdateMode>,
|
||||
"openticket:remove-roles-on-add":ODRoleData<string[]>,
|
||||
"openticket:add-on-join":ODRoleData<boolean>
|
||||
}
|
||||
|
||||
/**## ODRole `class`
|
||||
* This is an Open Ticket role.
|
||||
*
|
||||
* This class contains all data related to this role (parsed from the config).
|
||||
*
|
||||
* These properties will be used to handle reaction role options.
|
||||
*/
|
||||
export class ODRole extends ODManager<ODRoleData<ODValidJsonType>> {
|
||||
/**The id of this role. (from the config) */
|
||||
id:ODId
|
||||
|
||||
constructor(id:ODValidId, data:ODRoleData<ODValidJsonType>[]){
|
||||
@@ -73,6 +79,7 @@ export class ODRole extends ODManager<ODRoleData<ODValidJsonType>> {
|
||||
})
|
||||
}
|
||||
|
||||
/**Convert this role to a JSON object for storing this role in the database. */
|
||||
toJson(version:ODVersion): ODRoleJson {
|
||||
const data = this.getAll().map((data) => {
|
||||
return {
|
||||
@@ -88,6 +95,7 @@ export class ODRole extends ODManager<ODRoleData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**Create a role from a JSON object in the database. */
|
||||
static fromJson(json:ODRoleJson): ODRole {
|
||||
return new ODRole(json.id,json.data.map((data) => new ODRoleData(data.id,data.value)))
|
||||
}
|
||||
@@ -114,9 +122,47 @@ export class ODRole extends ODManager<ODRoleData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
export interface OTRoleUpdateResult {
|
||||
/**## ODRoleData `class`
|
||||
* This is Open Ticket role data.
|
||||
*
|
||||
* This class contains a single property for a role. (string, number, boolean, object, array, null)
|
||||
*
|
||||
* When this property is edited, the database will be updated automatically.
|
||||
*/
|
||||
export class ODRoleData<DataType extends ODValidJsonType> extends ODManagerData {
|
||||
/**The value of this property. */
|
||||
#value: DataType
|
||||
|
||||
constructor(id:ODValidId, value:DataType){
|
||||
super(id)
|
||||
this.#value = value
|
||||
}
|
||||
|
||||
/**The value of this property. */
|
||||
set value(value:DataType){
|
||||
this.#value = value
|
||||
this._change()
|
||||
}
|
||||
get value(): DataType {
|
||||
return this.#value
|
||||
}
|
||||
/**Refresh the database. Is only required to be used when updating `ODRoleData` with an object/array as value. */
|
||||
refreshDatabase(){
|
||||
this._change()
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODRoleUpdateResult `interface`
|
||||
* This interface represents the result of a single role when the roles of users are updated.
|
||||
*/
|
||||
export interface ODRoleUpdateResult {
|
||||
/**The role which was affected. */
|
||||
role:discord.Role,
|
||||
/**The action which was done. `null` when nothing happend. */
|
||||
action:"added"|"removed"|null
|
||||
}
|
||||
|
||||
export type OTRoleUpdateMode = "add&remove"|"add"|"remove"
|
||||
/**## ODRoleUpdateMode `type`
|
||||
* This is the mode of the reaction role option in the config.
|
||||
*/
|
||||
export type ODRoleUpdateMode = "add&remove"|"add"|"remove"
|
||||
@@ -4,13 +4,22 @@
|
||||
import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODManagerData } from "../modules/base"
|
||||
import { ODDebugger } from "../modules/console"
|
||||
import { ODClientManager_Default } from "../defaults/client"
|
||||
import { ODOption, ODOptionJson, ODTicketOption } from "./option"
|
||||
import { ODTicketOption } from "./option"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/**## ODTicketManager `class`
|
||||
* This is an Open Ticket ticket manager.
|
||||
*
|
||||
* This class manages all currently created tickets in the bot.
|
||||
*
|
||||
* All tickets which are added, removed or modified in this manager will be updated automatically in the database.
|
||||
*/
|
||||
export class ODTicketManager extends ODManager<ODTicket> {
|
||||
/**A reference to the main server of the bot */
|
||||
#guild: discord.Guild|null = null
|
||||
/**A reference to the Open Ticket client manager. */
|
||||
#client: ODClientManager_Default
|
||||
/**A reference to the Open Ticket debugger. */
|
||||
#debug: ODDebugger
|
||||
|
||||
constructor(debug:ODDebugger, client:ODClientManager_Default){
|
||||
@@ -116,20 +125,32 @@ export class ODTicketManager extends ODManager<ODTicket> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTicketDataJson `interface`
|
||||
* The JSON representatation from a single ticket property.
|
||||
*/
|
||||
export interface ODTicketDataJson {
|
||||
/**The id of this property. */
|
||||
id:string,
|
||||
/**The value of this property. */
|
||||
value:ODValidJsonType
|
||||
}
|
||||
|
||||
/**## ODTicketDataJson `interface`
|
||||
* The JSON representatation from a single ticket.
|
||||
*/
|
||||
export interface ODTicketJson {
|
||||
/**The id of this ticket. */
|
||||
id:string,
|
||||
/**The option id related to this ticket. */
|
||||
option:string,
|
||||
/**The version of Open Ticket used to create this ticket. */
|
||||
version:string,
|
||||
/**The full list of properties/variables related to this ticket. */
|
||||
data:ODTicketDataJson[]
|
||||
}
|
||||
|
||||
/**## ODTicketIds `type`
|
||||
* This type is an array of ids available in the `ODTicket` class.
|
||||
* This interface is a list of ids available in the `ODTicket` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODTicketIds {
|
||||
@@ -164,8 +185,17 @@ export interface ODTicketIds {
|
||||
"openticket:answers":ODTicketData<{id:string,name:string,type:"short"|"paragraph",value:string|null}[]>,
|
||||
}
|
||||
|
||||
/**## ODTicket `class`
|
||||
* This is an Open Ticket ticket.
|
||||
*
|
||||
* This class contains all data related to this ticket (parsed from the database).
|
||||
*
|
||||
* These properties contain the current state of the ticket & are used by actions like claiming, pinning, closing, ...
|
||||
*/
|
||||
export class ODTicket extends ODManager<ODTicketData<ODValidJsonType>> {
|
||||
/**The id of this ticket. (discord channel id) */
|
||||
id:ODId
|
||||
/**The option related to this ticket. */
|
||||
#option: ODTicketOption
|
||||
|
||||
constructor(id:ODValidId, option:ODTicketOption, data:ODTicketData<ODValidJsonType>[]){
|
||||
@@ -177,6 +207,7 @@ export class ODTicket extends ODManager<ODTicketData<ODValidJsonType>> {
|
||||
})
|
||||
}
|
||||
|
||||
/**The option related to this ticket. */
|
||||
set option(option:ODTicketOption){
|
||||
this.#option = option
|
||||
this._change()
|
||||
@@ -185,6 +216,7 @@ export class ODTicket extends ODManager<ODTicketData<ODValidJsonType>> {
|
||||
return this.#option
|
||||
}
|
||||
|
||||
/**Convert this ticket to a JSON object for storing this ticket in the database. */
|
||||
toJson(version:ODVersion): ODTicketJson {
|
||||
const data = this.getAll().map((data) => {
|
||||
return {
|
||||
@@ -201,6 +233,7 @@ export class ODTicket extends ODManager<ODTicketData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**Create a ticket from a JSON object in the database. */
|
||||
static fromJson(json:ODTicketJson, option:ODTicketOption): ODTicket {
|
||||
return new ODTicket(json.id,option,json.data.map((data) => new ODTicketData(data.id,data.value)))
|
||||
}
|
||||
@@ -227,7 +260,15 @@ export class ODTicket extends ODManager<ODTicketData<ODValidJsonType>> {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTicketData `class`
|
||||
* This is Open Ticket ticket data.
|
||||
*
|
||||
* This class contains a single property for a ticket. (string, number, boolean, object, array, null)
|
||||
*
|
||||
* When this property is edited, the database will be updated automatically.
|
||||
*/
|
||||
export class ODTicketData<DataType extends ODValidJsonType> extends ODManagerData {
|
||||
/**The value of this property. */
|
||||
#value: DataType
|
||||
|
||||
constructor(id:ODValidId, value:DataType){
|
||||
@@ -235,6 +276,7 @@ export class ODTicketData<DataType extends ODValidJsonType> extends ODManagerDat
|
||||
this.#value = value
|
||||
}
|
||||
|
||||
/**The value of this property. */
|
||||
set value(value:DataType){
|
||||
this.#value = value
|
||||
this._change()
|
||||
@@ -248,4 +290,7 @@ export class ODTicketData<DataType extends ODValidJsonType> extends ODManagerDat
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTicketClearFilter `type`
|
||||
* This type contains all possible "clear filters" for the `/clear` command.
|
||||
*/
|
||||
export type ODTicketClearFilter = "all"|"open"|"closed"|"claimed"|"unclaimed"|"pinned"|"unpinned"|"autoclosed"
|
||||
@@ -5,45 +5,99 @@ import { ODId, ODManager, ODValidJsonType, ODValidId, ODManagerData, ODValidButt
|
||||
import { ODDebugger } from "../modules/console"
|
||||
import { ODTicket, ODTicketManager } from "./ticket"
|
||||
import { ODMessageBuildResult } from "../modules/builder"
|
||||
import { ODClientManager } from "../modules/client"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
/**## ODTranscriptManager `class`
|
||||
* This is an Open Ticket transcript manager.
|
||||
*
|
||||
* This class manages all transcript generators in the bot.
|
||||
*
|
||||
* The 2 default built-in transcript generators are: `openticket:html-compiler` & `openticket:text-compiler`.
|
||||
*/
|
||||
export class ODTranscriptManager extends ODManager<ODTranscriptCompiler<any>> {
|
||||
/**The manager responsible for collecting all messages in a channel. */
|
||||
collector: ODTranscriptCollector
|
||||
/**Alias for the client manager. */
|
||||
#client: ODClientManager
|
||||
|
||||
constructor(debug:ODDebugger, tickets:ODTicketManager){
|
||||
constructor(debug:ODDebugger, tickets:ODTicketManager, client:ODClientManager){
|
||||
super(debug,"transcript compiler")
|
||||
this.collector = new ODTranscriptCollector(tickets)
|
||||
this.#client = client
|
||||
this.collector = new ODTranscriptCollector(tickets,client)
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTranscriptCompilerInitFunction `type`
|
||||
* This function will initiate/prepare the transcript system for an incoming transcript.
|
||||
*/
|
||||
export type ODTranscriptCompilerInitFunction = (ticket:ODTicket, channel:discord.TextChannel, user:discord.User) => (ODTranscriptCompilerInitResult)|Promise<ODTranscriptCompilerInitResult>
|
||||
|
||||
/**## ODTranscriptCompilerCompileFunction `type`
|
||||
* This function will generate/compile the transcript itself.
|
||||
*/
|
||||
export type ODTranscriptCompilerCompileFunction<Data extends object> = (ticket:ODTicket, channel:discord.TextChannel, user:discord.User) => ODTranscriptCompilerCompileResult<Data>|Promise<ODTranscriptCompilerCompileResult<Data>>
|
||||
|
||||
/**## ODTicketClearFilter `type`
|
||||
* This function will finish, clear-up & shut-down the transcript system. This will also initiate the sending of the messages to all recipients.
|
||||
*/
|
||||
export type ODTranscriptCompilerReadyFunction<Data extends object> = (result:ODTranscriptCompilerCompileResult<Data>) => ODTranscriptCompilerReadyResult|Promise<ODTranscriptCompilerReadyResult>
|
||||
|
||||
/**## ODTranscriptCompilerInitResult `interface`
|
||||
* This is the result which is returned by the `init()` function.
|
||||
*/
|
||||
export interface ODTranscriptCompilerInitResult {
|
||||
/**Was the initialization successfull? */
|
||||
success:boolean,
|
||||
/**When not successfull, what was the reason? This will also be shown to the user. */
|
||||
errorReason:string|null,
|
||||
/**An optional message which will be sent while the transcript is being generated. */
|
||||
pendingMessage:ODMessageBuildResult|null
|
||||
}
|
||||
|
||||
/**## ODTranscriptCompilerCompileResult `interface`
|
||||
* This is the result which is returned by the `compile()` function.
|
||||
*/
|
||||
export interface ODTranscriptCompilerCompileResult<Data extends object> {
|
||||
/**The ticket this transcript is being created for. */
|
||||
ticket:ODTicket,
|
||||
/**The channel this transcript is being created for. */
|
||||
channel:discord.TextChannel,
|
||||
/**The user who created the transcript. */
|
||||
user:discord.User
|
||||
/**Was the compilation successfull? */
|
||||
success:boolean,
|
||||
/**When not successfull, what was the reason? This will also be shown to the user. */
|
||||
errorReason:string|null,
|
||||
/**A list of all messages sent in the ticket channel. */
|
||||
messages:ODTranscriptMessageData[]|null,
|
||||
/**The result returned by the `compiler()` function. Contains the transcript contents, url or something else. */
|
||||
data:Data|null
|
||||
}
|
||||
|
||||
/**## ODTranscriptCompilerReadyResult `interface`
|
||||
* This is the result which is returned by the `ready()` function.
|
||||
*/
|
||||
export interface ODTranscriptCompilerReadyResult {
|
||||
/**The message to be sent in the specified channel in the server. */
|
||||
channelMessage?:ODMessageBuildResult,
|
||||
/**The message to be sent to the DM of the ticket creator. */
|
||||
creatorDmMessage?:ODMessageBuildResult,
|
||||
/**The message to be sent to the DM of all participants. */
|
||||
participantDmMessage?:ODMessageBuildResult,
|
||||
/**The message to be sent to the DM of all admins who actively participated in the ticket. */
|
||||
activeAdminDmMessage?:ODMessageBuildResult,
|
||||
/**The message to be sent to the DM of all admins who were assigned to this ticket. */
|
||||
everyAdminDmMessage?:ODMessageBuildResult
|
||||
}
|
||||
|
||||
/**## ODTranscriptCompiler `class`
|
||||
* This is an Open Ticket transcript compiler.
|
||||
*
|
||||
* This class manages all functions to generate a transcript.
|
||||
*
|
||||
* These functions should be defined when creating this compiler. Existing compilers already exist for html & text transcripts.
|
||||
*/
|
||||
export class ODTranscriptCompiler<Data extends object> extends ODManagerData {
|
||||
/*Initialise the system every time a transcript is created. Returns optional "pending" message to display while the transcript is being compiled. */
|
||||
init: ODTranscriptCompilerInitFunction|null
|
||||
@@ -61,7 +115,7 @@ export class ODTranscriptCompiler<Data extends object> extends ODManagerData {
|
||||
}
|
||||
|
||||
/**## ODTranscriptCompilerIds `type`
|
||||
* This type is an array of ids available in the `ODTranscriptCompiler` class.
|
||||
* This interface is a list of ids available in the `ODTranscriptCompiler` class.
|
||||
* It's used to generate typescript declarations for this class.
|
||||
*/
|
||||
export interface ODTranscriptCompilerIds {
|
||||
@@ -98,12 +152,22 @@ export class ODTranscriptManager_Default extends ODTranscriptManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTranscriptCollector `class`
|
||||
* This is an Open Ticket transcript collector.
|
||||
*
|
||||
* The only goal of this class is to collect & parse all messages from a ticket channel.
|
||||
*
|
||||
* It also contains utility functions for counting all messages, calculating file sizes & more!
|
||||
*/
|
||||
export class ODTranscriptCollector {
|
||||
/**Alias for the ticket manager. */
|
||||
#tickets: ODTicketManager
|
||||
/**Alias for the client manager. */
|
||||
#client: ODClientManager
|
||||
|
||||
constructor(tickets:ODTicketManager){
|
||||
constructor(tickets:ODTicketManager,client:ODClientManager){
|
||||
this.#tickets = tickets
|
||||
this.#client = client
|
||||
}
|
||||
|
||||
/**Collect all messages from a given ticket channel. It may not include all messages depending on the ratelimit. */
|
||||
@@ -138,6 +202,7 @@ export class ODTranscriptCollector {
|
||||
if (!messages) return null
|
||||
return messages.length
|
||||
}
|
||||
/**Convert an array of discord messages to an array of `ODTranscriptMessageData`'s. This is used to simplify the process of the transcript compilers. */
|
||||
async convertMessagesToTranscriptData(messages:discord.Message<true>[]): Promise<ODTranscriptMessageData[]> {
|
||||
const final: ODTranscriptMessageData[] = []
|
||||
for (const msg of messages){
|
||||
@@ -246,13 +311,21 @@ export class ODTranscriptCollector {
|
||||
}
|
||||
}
|
||||
}catch{}
|
||||
}else if (msg.interaction && msg.interaction.type == discord.InteractionType.ApplicationCommand){
|
||||
//slash command reply
|
||||
const member = await msg.guild.members.fetch(msg.interaction.user.id)
|
||||
reply = {
|
||||
type:"interaction",
|
||||
name:msg.interaction.commandName,
|
||||
user:this.#handleUserData(msg.interaction.user,member)
|
||||
|
||||
}else if (msg.interactionMetadata){
|
||||
try{
|
||||
//get slash command name from undocumented property in discord REST API
|
||||
const restMsg = await this.#client.rest.get(discord.Routes.channelMessage(msg.channelId,msg.id)) as discord.APIMessage & {interaction_metadata:{name:string}}
|
||||
const commandName = restMsg.interaction_metadata.name ?? "unknown-command"
|
||||
//slash command reply
|
||||
const member = await msg.guild.members.fetch(msg.interactionMetadata.user.id)
|
||||
reply = {
|
||||
type:"interaction",
|
||||
name:commandName,
|
||||
user:this.#handleUserData(msg.interactionMetadata.user,member)
|
||||
}
|
||||
}catch(err){
|
||||
process.emit("uncaughtException",err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,6 +435,9 @@ export class ODTranscriptCollector {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTranscriptCollectorIncludeSettings `interface`
|
||||
* Additional settings for the `ODTranscriptCollector`
|
||||
*/
|
||||
export interface ODTranscriptCollectorIncludeSettings {
|
||||
/**Collect messages from normal discord users. */
|
||||
users: boolean,
|
||||
@@ -371,6 +447,9 @@ export interface ODTranscriptCollectorIncludeSettings {
|
||||
client: boolean
|
||||
}
|
||||
|
||||
/**## ODTranscriptMessageData `interface`
|
||||
* A universal representatation of a discord message for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptMessageData {
|
||||
/**The message author. */
|
||||
author: ODTranscriptUserData,
|
||||
@@ -400,8 +479,14 @@ export interface ODTranscriptMessageData {
|
||||
reactions: ODTranscriptReactionData[]
|
||||
}
|
||||
|
||||
/**## ODTranscriptMessageType `type`
|
||||
* A message type for the `ODTranscriptMessageData` interface.
|
||||
*/
|
||||
export type ODTranscriptMessageType = "default"|"important"|"ephemeral"|"pinned.message"|"welcome.message"|"boost.message"|"thread.message"
|
||||
|
||||
/**## ODTranscriptUserData `interface`
|
||||
* A universal representatation of a discord user for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptUserData {
|
||||
/**The id of this user. */
|
||||
id: string,
|
||||
@@ -417,6 +502,9 @@ export interface ODTranscriptUserData {
|
||||
color: discord.HexColorString
|
||||
}
|
||||
|
||||
/**## ODTranscriptEmbedData `interface`
|
||||
* A universal representatation of a discord embed for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptEmbedData {
|
||||
/**The title of this embed. */
|
||||
title: string|null,
|
||||
@@ -442,6 +530,9 @@ export interface ODTranscriptEmbedData {
|
||||
fields: ODTranscriptEmbedFieldData[]
|
||||
}
|
||||
|
||||
/**## ODTranscriptEmbedFieldData `interface`
|
||||
* A universal representatation of a discord embed field for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptEmbedFieldData {
|
||||
/**The name of this embed field. */
|
||||
name: string,
|
||||
@@ -451,6 +542,9 @@ export interface ODTranscriptEmbedFieldData {
|
||||
inline: boolean
|
||||
}
|
||||
|
||||
/**## ODTranscriptFileData `interface`
|
||||
* A universal representatation of a discord message attachment for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptFileData {
|
||||
/**The file type or extension. */
|
||||
type: string,
|
||||
@@ -468,11 +562,17 @@ export interface ODTranscriptFileData {
|
||||
alt: string|null
|
||||
}
|
||||
|
||||
/**## ODTranscriptComponentRowData `interface`
|
||||
* A universal representatation of a discord message action row for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptComponentRowData {
|
||||
/**All components (buttons & dropdowns) present in this action row. */
|
||||
components: (ODTranscriptButtonComponentData|ODTranscriptDropdownComponentData)[]
|
||||
}
|
||||
|
||||
/**## ODTranscriptComponentData `interface`
|
||||
* A universal representatation of a discord message action row component for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptComponentData {
|
||||
/**The custom id of this component. */
|
||||
id: string|null,
|
||||
@@ -482,6 +582,9 @@ export interface ODTranscriptComponentData {
|
||||
type: "button"|"dropdown"
|
||||
}
|
||||
|
||||
/**## ODTranscriptButtonComponentData `interface`
|
||||
* A universal representatation of a discord message button for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptButtonComponentData extends ODTranscriptComponentData {
|
||||
/**The type of this component. */
|
||||
type: "button"
|
||||
@@ -497,6 +600,9 @@ export interface ODTranscriptButtonComponentData extends ODTranscriptComponentDa
|
||||
url: string|null
|
||||
}
|
||||
|
||||
/**## ODTranscriptDropdownComponentData `interface`
|
||||
* A universal representatation of a discord message dropdown for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptDropdownComponentData extends ODTranscriptComponentData {
|
||||
/**The type of this component. */
|
||||
type: "dropdown"
|
||||
@@ -506,6 +612,9 @@ export interface ODTranscriptDropdownComponentData extends ODTranscriptComponent
|
||||
options: ODTranscriptDropdownComponentOptionData[]
|
||||
}
|
||||
|
||||
/**## ODTranscriptDropdownComponentOptionData `interface`
|
||||
* A universal representatation of a discord message dropdown option for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptDropdownComponentOptionData {
|
||||
/**The custom id of this dropdown option. */
|
||||
id: string,
|
||||
@@ -517,11 +626,17 @@ export interface ODTranscriptDropdownComponentOptionData {
|
||||
emoji: ODTranscriptEmojiData|null
|
||||
}
|
||||
|
||||
/**## ODTranscriptReplyData `interface`
|
||||
* A universal representatation of a discord reply/interaction for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptReplyData {
|
||||
/**The type of reply. */
|
||||
type: "interaction"|"message",
|
||||
}
|
||||
|
||||
/**## ODTranscriptReplyData `interface`
|
||||
* A universal representatation of a discord interaction reply for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptInteractionReplyData extends ODTranscriptReplyData {
|
||||
/**The type of reply. */
|
||||
type: "interaction",
|
||||
@@ -531,6 +646,9 @@ export interface ODTranscriptInteractionReplyData extends ODTranscriptReplyData
|
||||
name: string
|
||||
}
|
||||
|
||||
/**## ODTranscriptReplyData `interface`
|
||||
* A universal representatation of a discord message reply for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptMessageReplyData extends ODTranscriptReplyData {
|
||||
/**The type of reply. */
|
||||
type: "message",
|
||||
@@ -546,6 +664,9 @@ export interface ODTranscriptMessageReplyData extends ODTranscriptReplyData {
|
||||
content: string|null
|
||||
}
|
||||
|
||||
/**## ODTranscriptEmojiData `interface`
|
||||
* A universal representatation of a discord emoji for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptEmojiData {
|
||||
/**The id of this emoji. */
|
||||
id: string|null,
|
||||
@@ -559,6 +680,9 @@ export interface ODTranscriptEmojiData {
|
||||
emoji: string,
|
||||
}
|
||||
|
||||
/**## ODTranscriptReactionData `interface`
|
||||
* A universal representatation of a discord message reaction for transcripts.
|
||||
*/
|
||||
export interface ODTranscriptReactionData extends ODTranscriptEmojiData {
|
||||
/**The amount of emojis for this reaction. */
|
||||
amount: number,
|
||||
@@ -566,6 +690,9 @@ export interface ODTranscriptReactionData extends ODTranscriptEmojiData {
|
||||
super: boolean
|
||||
}
|
||||
|
||||
/**## ODTranscriptHtmlV2Data `interface`
|
||||
* The structure of the data sent to the Open Ticket HTML Transcripts v2 API.
|
||||
*/
|
||||
export interface ODTranscriptHtmlV2Data {
|
||||
version:"2",
|
||||
otversion:string,
|
||||
@@ -753,6 +880,7 @@ export interface ODTranscriptHtmlV2Data {
|
||||
}
|
||||
}
|
||||
}[],
|
||||
//sadly enough, no premium yet :)
|
||||
premium:{
|
||||
enabled:boolean,
|
||||
premiumToken:string,
|
||||
@@ -779,6 +907,9 @@ export interface ODTranscriptHtmlV2Data {
|
||||
}
|
||||
}
|
||||
|
||||
/**## ODTranscriptHtmlV2Response `interface`
|
||||
* The structure of the response received from the Open Ticket HTML Transcripts v2 API.
|
||||
*/
|
||||
export interface ODTranscriptHtmlV2Response {
|
||||
status:"success"|"error",
|
||||
id:string,
|
||||
|
||||
@@ -2,7 +2,26 @@ import {openticket, api, utilities} from "../../index"
|
||||
import * as discord from "discord.js"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
/** WHAT IS THIS??
|
||||
* This is the '!OPENTICKET:dump' command.
|
||||
* It's a utility command which can only be used by the creator of Open Ticket or the owner of the bot.
|
||||
* This command will send the `otdebug.txt` file in DM. It's not dangerous as the `otdebug.txt` file doesn't contain any sensitive data (only logs).
|
||||
*
|
||||
* WHY DOES IT EXIST??
|
||||
* This command can be used to quickly get the `otdebug.txt` file without having access to the hosting
|
||||
* in case you're helping someone with setting up (or debugging) Open Ticket.
|
||||
*
|
||||
* CAN I DISABLE IT??
|
||||
* If you want to turn it off, you can always do it below this message!
|
||||
*/
|
||||
|
||||
///////// DISABLE DUMP COMMAND /////////
|
||||
const disableDumpCommand = false
|
||||
////////////////////////////////////////
|
||||
|
||||
export const loadDumpCommand = () => {
|
||||
if (disableDumpCommand) return
|
||||
openticket.client.textCommands.add(new api.ODTextCommand("openticket:dump",{
|
||||
allowBots:false,
|
||||
guildPermission:true,
|
||||
|
||||
@@ -26,6 +26,7 @@ const moduleInstalled = (id:string, throwError:boolean) => {
|
||||
}
|
||||
}
|
||||
|
||||
moduleInstalled("@discordjs/rest",true)
|
||||
moduleInstalled("discord.js",true)
|
||||
moduleInstalled("ansis",true)
|
||||
moduleInstalled("formatted-json-stringify",true)
|
||||
|
||||
@@ -34,9 +34,11 @@ export const loadVersionMigrationSystem = async () => {
|
||||
const preloadMigrationContext = async () => {
|
||||
openticket.debug.debug("-- MIGRATION CONTEXT START --")
|
||||
await (await import("../../data/framework/flagLoader.js")).loadAllFlags()
|
||||
openticket.flags.init()
|
||||
await openticket.flags.init()
|
||||
await (await import("../../data/framework/configLoader.js")).loadAllConfigs()
|
||||
await openticket.configs.init()
|
||||
await (await import("../../data/framework/databaseLoader.js")).loadAllDatabases()
|
||||
await openticket.databases.init()
|
||||
openticket.debug.visible = true
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export const registerDefaultCheckerSystemTranslations = (tm:api.ODCheckerTransla
|
||||
tm.quickTranslate(lm,"checker.system.typeWarning","other","openticket:type-warning") // [WARNING] (ignore)
|
||||
tm.quickTranslate(lm,"checker.system.typeInfo","other","openticket:type-info") // [INFO] (ignore)
|
||||
tm.quickTranslate(lm,"checker.system.headerConfigChecker","other","openticket:header-configchecker") // CONFIG CHECKER
|
||||
tm.quickTranslate(lm,"checker.system.headerDescription","other","openticket:header-description") // check for errors in you config files!
|
||||
tm.quickTranslate(lm,"checker.system.headerDescription","other","openticket:header-description") // check for errors in your config files!
|
||||
tm.quickTranslate(lm,"checker.system.footerError","other","openticket:footer-error") // the bot won't start until all {0}'s are fixed!
|
||||
tm.quickTranslate(lm,"checker.system.footerWarning","other","openticket:footer-warning") // it's recommended to fix all {0}'s before starting!
|
||||
tm.quickTranslate(lm,"checker.system.footerSupport","other","openticket:footer-support") // SUPPORT: {0} - DOCS: {1}
|
||||
@@ -169,6 +169,12 @@ const createPanelEmbedStructure = (id:api.ODValidId) => {
|
||||
]})})
|
||||
}
|
||||
|
||||
function loadFromEnv(){
|
||||
const generalConfig = openticket.configs.get("openticket:general")
|
||||
if (generalConfig.data && generalConfig.data.tokenFromENV && typeof generalConfig.data.tokenFromENV == "boolean") return generalConfig.data.tokenFromENV
|
||||
else return false
|
||||
}
|
||||
|
||||
//STRUCTURES
|
||||
export const defaultGeneralStructure = new api.ODCheckerObjectStructure("openticket:general",{children:[
|
||||
//STATUS
|
||||
@@ -187,7 +193,7 @@ export const defaultGeneralStructure = new api.ODCheckerObjectStructure("opentic
|
||||
]})},
|
||||
|
||||
//BASIC
|
||||
{key:"token",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_DiscordToken("openticket:token")},
|
||||
{key:"token",optional:false,priority:0,checker:(loadFromEnv()) ? new api.ODCheckerStringStructure("openticket:token-disabled",{}) : new api.ODCheckerCustomStructure_DiscordToken("openticket:token")},
|
||||
{key:"tokenFromENV",optional:false,priority:0,checker:new api.ODCheckerBooleanStructure("openticket:token-env",{})},
|
||||
{key:"mainColor",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_HexColor("openticket:main-color",true,false)},
|
||||
{key:"language",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:language",{
|
||||
@@ -301,7 +307,7 @@ export const defaultOptionsStructure = new api.ODCheckerArrayStructure("opentick
|
||||
//TICKET BUTTON
|
||||
{key:"button",optional:false,priority:0,checker:new api.ODCheckerObjectStructure("openticket:ticket-button",{children:[
|
||||
{key:"emoji",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_EmojiString("openticket:ticket-button-emoji",0,1,true)},
|
||||
{key:"label",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-label",{maxLength:50})},
|
||||
{key:"label",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-label",{maxLength:80})},
|
||||
{key:"color",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-color",{choices:["gray","red","green","blue"]})},
|
||||
],custom:(checker,value,locationTrace,locationId,locationDocs) => {
|
||||
const lt = checker.locationTraceDeref(locationTrace)
|
||||
@@ -385,7 +391,7 @@ export const defaultOptionsStructure = new api.ODCheckerArrayStructure("opentick
|
||||
//WEBSITE BUTTON
|
||||
{key:"button",optional:false,priority:0,checker:new api.ODCheckerObjectStructure("openticket:ticket-button",{children:[
|
||||
{key:"emoji",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_EmojiString("openticket:ticket-button-emoji",0,1,true)},
|
||||
{key:"label",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-label",{maxLength:50})},
|
||||
{key:"label",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-label",{maxLength:80})},
|
||||
],custom:(checker,value,locationTrace,locationId,locationDocs) => {
|
||||
const lt = checker.locationTraceDeref(locationTrace)
|
||||
//check if emoji & label exists
|
||||
@@ -410,7 +416,7 @@ export const defaultOptionsStructure = new api.ODCheckerArrayStructure("opentick
|
||||
//ROLE BUTTON
|
||||
{key:"button",optional:false,priority:0,checker:new api.ODCheckerObjectStructure("openticket:ticket-button",{children:[
|
||||
{key:"emoji",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_EmojiString("openticket:ticket-button-emoji",0,1,true)},
|
||||
{key:"label",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-label",{maxLength:50})},
|
||||
{key:"label",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-label",{maxLength:80})},
|
||||
{key:"color",optional:false,priority:0,checker:new api.ODCheckerStringStructure("openticket:ticket-button-color",{choices:["gray","red","green","blue"]})},
|
||||
],custom:(checker,value,locationTrace,locationId,locationDocs) => {
|
||||
const lt = checker.locationTraceDeref(locationTrace)
|
||||
|
||||
@@ -133,13 +133,17 @@ export const loadDatabaseCleanersCode = async () => {
|
||||
}))
|
||||
|
||||
//OPTION DATABASE CLEANER
|
||||
openticket.code.add(new api.ODCode("openticket:option-database-cleaner",10,() => {
|
||||
openticket.code.add(new api.ODCode("openticket:option-database-cleaner",10,async () => {
|
||||
//delete all unused options (async)
|
||||
openticket.options.getAll().forEach(async (option) => {
|
||||
if (await optionDatabase.exists("openticket:used-option",option.id.value) && !openticket.tickets.getAll().some((ticket) => ticket.option.id.value == option.id.value)){
|
||||
await optionDatabase.delete("openticket:used-option",option.id.value)
|
||||
for (const option of (await optionDatabase.getCategory("openticket:used-option") ?? [])){
|
||||
if (!openticket.options.exists(option.key)){
|
||||
//remove because option isn't loaded into memory (0 tickets require it)
|
||||
await optionDatabase.delete("openticket:used-option",option.key)
|
||||
}else if (!openticket.tickets.getAll().some((ticket) => ticket.option.id.value == option.key)){
|
||||
//remove when loaded into memory (0 tickets require it)
|
||||
await optionDatabase.delete("openticket:used-option",option.key)
|
||||
}
|
||||
})
|
||||
}
|
||||
}))
|
||||
|
||||
//USER DATABASE CLEANER (full async/parallel because it takes a lot of time)
|
||||
@@ -479,4 +483,12 @@ const loadAutoCode = () => {
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
//TICKET ANTI BUSY
|
||||
openticket.code.add(new api.ODCode("openticket:ticket-anti-busy",-1,() => {
|
||||
for (const ticket of openticket.tickets.getAll()){
|
||||
//free tickets from corruption due to openticket:busy variable
|
||||
ticket.get("openticket:busy").value = false
|
||||
}
|
||||
}))
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user