Compare commits
191
Commits
v2.5.0
...
v4.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c2aca7039 | ||
|
|
9326d0fae8 | ||
|
|
fd3ae39150 | ||
|
|
1b0da061ba | ||
|
|
07eb8f34e9 | ||
|
|
64fef62bf5 | ||
|
|
b2be76f5b6 | ||
|
|
856ccc10b9 | ||
|
|
8c6681f025 | ||
|
|
cc21e28470 | ||
|
|
7815400472 | ||
|
|
fda8a397d6 | ||
|
|
ae306332bb | ||
|
|
bc46d4ab46 | ||
|
|
b0b4e21aff | ||
|
|
fb3764eefb | ||
|
|
d5efe06fe5 | ||
|
|
cdb2673217 | ||
|
|
6018a183fb | ||
|
|
73f9f4037f | ||
|
|
b5b537e85e | ||
|
|
6ebeb7a93c | ||
|
|
7584c25e93 | ||
|
|
94b3788cfb | ||
|
|
e7d9ad374e | ||
|
|
0e597232f0 | ||
|
|
acc89990c2 | ||
|
|
ee9f8eaca1 | ||
|
|
ae8a8d1b14 | ||
|
|
38afb9c2a6 | ||
|
|
5bdb7941b6 | ||
|
|
01c1f3150e | ||
|
|
e524cccd19 | ||
|
|
ede102bddf | ||
|
|
ab5d5c06be | ||
|
|
355f078ee5 | ||
|
|
c207560743 | ||
|
|
b29dfaeaae | ||
|
|
1710111fcb | ||
|
|
805c6b8e55 | ||
|
|
d0ab311da4 | ||
|
|
92a3671768 | ||
|
|
71074e1afe | ||
|
|
e80ce1a64a | ||
|
|
5dfbce1856 | ||
|
|
407e56a806 | ||
|
|
e0f42834e5 | ||
|
|
d03abd9eeb | ||
|
|
466a4aea81 | ||
|
|
9d96d11cd3 | ||
|
|
e3b99e656e | ||
|
|
07e2a68d06 | ||
|
|
795ca4f981 | ||
|
|
5231129278 | ||
|
|
f62bc7adf9 | ||
|
|
5de6b1e906 | ||
|
|
62413505d6 | ||
|
|
20b617f6eb | ||
|
|
94510bbfb0 | ||
|
|
d51511fdb5 | ||
|
|
3447a37603 | ||
|
|
4b17aa640f | ||
|
|
3b7674f1a5 | ||
|
|
7de9339da3 | ||
|
|
e2e1e19bc8 | ||
|
|
5f19adf561 | ||
|
|
1bb70745ea | ||
|
|
589bbe5cd5 | ||
|
|
447fddea56 | ||
|
|
bf7a003799 | ||
|
|
6115ab1cc8 | ||
|
|
c2307fd1ed | ||
|
|
2a3850c3cc | ||
|
|
688c40ce7b | ||
|
|
dee2a21be9 | ||
|
|
d7ae040d60 | ||
|
|
7b6202985a | ||
|
|
a2f2c601a5 | ||
|
|
b27016df2e | ||
|
|
6341f2f71b | ||
|
|
56a5b9c7d0 | ||
|
|
f608cb71ce | ||
|
|
7c7c325307 | ||
|
|
832021d72a | ||
|
|
030554a7f5 | ||
|
|
ada5ea0c5d | ||
|
|
fb6b891835 | ||
|
|
739ad81f3f | ||
|
|
a6f67a9452 | ||
|
|
56a6540663 | ||
|
|
5f8812d261 | ||
|
|
7a3dcf4c42 | ||
|
|
7cebd4dd6a | ||
|
|
27912a0c37 | ||
|
|
67871d885a | ||
|
|
1bd0d013ed | ||
|
|
a074a17519 | ||
|
|
67af96ef5c | ||
|
|
a041f28cf7 | ||
|
|
a8c9c2ea8d | ||
|
|
8748301b04 | ||
|
|
2d7a7b5728 | ||
|
|
0807ca884c | ||
|
|
0ead037fa8 | ||
|
|
4287c11bf1 | ||
|
|
69fdc7ccf0 | ||
|
|
6c213306b6 | ||
|
|
4096e8196d | ||
|
|
94ee890848 | ||
|
|
4dced819a3 | ||
|
|
1159af9fa9 | ||
|
|
67d429c52b | ||
|
|
f67af805c1 | ||
|
|
944032f690 | ||
|
|
ee248e86bc | ||
|
|
b171bce62b | ||
|
|
df0bce0189 | ||
|
|
2630aa899f | ||
|
|
dba370d66e | ||
|
|
d0bcf26b93 | ||
|
|
65f82171d3 | ||
|
|
6e730f058d | ||
|
|
4702c633ec | ||
|
|
dc14a39c4e | ||
|
|
05c97909d4 | ||
|
|
b3c4c2f6e8 | ||
|
|
e0e678bee0 | ||
|
|
1b01b1703f | ||
|
|
26539360c6 | ||
|
|
627c461f64 | ||
|
|
2e40dc0468 | ||
|
|
fa57b9a93f | ||
|
|
930452155b | ||
|
|
e70f22162d | ||
|
|
d5b0a0f3c6 | ||
|
|
c43081e05d | ||
|
|
8c4bf735f1 | ||
|
|
3a20c4707b | ||
|
|
9a7e563c57 | ||
|
|
72b4f43a25 | ||
|
|
5fec028cc9 | ||
|
|
81300303e5 | ||
|
|
8a1ea1c856 | ||
|
|
8a9d63bf8b | ||
|
|
208b365276 | ||
|
|
abb64a0575 | ||
|
|
c930140540 | ||
|
|
294c4d3f2b | ||
|
|
28e7d48e7e | ||
|
|
bad278e681 | ||
|
|
2e2542d064 | ||
|
|
2c48da45ae | ||
|
|
e1232a559e | ||
|
|
3d58475461 | ||
|
|
f702b199da | ||
|
|
ea1604a805 | ||
|
|
f8bc3d9e12 | ||
|
|
af35f83291 | ||
|
|
39fec94ead | ||
|
|
1b8468330e | ||
|
|
b698c89a89 | ||
|
|
7ed2d7bcc7 | ||
|
|
f2ddaa5fd4 | ||
|
|
fc50a8e83f | ||
|
|
5bece3357d | ||
|
|
97d1489558 | ||
|
|
a211cef1f6 | ||
|
|
ae002e168b | ||
|
|
86a5a1a2ca | ||
|
|
23ebc14b8b | ||
|
|
3a5768a1b1 | ||
|
|
33c3803ca8 | ||
|
|
f3613fb674 | ||
|
|
f1dc8cbcf5 | ||
|
|
a365c4b69f | ||
|
|
687372481a | ||
|
|
1bc8bde922 | ||
|
|
4b8074c520 | ||
|
|
1d5830975f | ||
|
|
95bc1f4fbf | ||
|
|
bfc02611c7 | ||
|
|
e4c1e2559e | ||
|
|
69b669956e | ||
|
|
893a7c5b1f | ||
|
|
ed9c98e2f0 | ||
|
|
62d950b1a6 | ||
|
|
69de612d1e | ||
|
|
5494e112c0 | ||
|
|
cd2c08303e | ||
|
|
a8619e448a | ||
|
|
c990257c02 |
@@ -0,0 +1,128 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
support@dj-dj.be.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# 🎥 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 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.
|
||||||
|
|
||||||
|
### 📄 Requirements
|
||||||
|
- 📌 At least 2k subscribers!
|
||||||
|
- 📌 A little bit of channel activity! *(minimum 2 uploads/month)*
|
||||||
|
- 📌 Video length of at least 3 minutes!
|
||||||
|
- 📌 Provide a clear link to the Open Ticket repository!
|
||||||
|
- 📌 Recommended language is English!
|
||||||
|
- 📌 Recommended platform is YouTube!
|
||||||
|
- 📌 Must be for the latest version of Open Ticket!
|
||||||
|
- 📌 **(OPTIONAL)** Speech in the video *(AI is allowed)*
|
||||||
|
|
||||||
|
|
||||||
|
### 🎁 Rewards
|
||||||
|
We won't give out any compensation in money, but we will give you some advantages!
|
||||||
|
- ✅ Advertisement of tutorial in the [README.md](../README.md)!
|
||||||
|
- ✅ Advertisement of channel in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- ✅ `Content Creator` role in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- ✅ Advertisement of tutorial & channel in documentation!
|
||||||
|
- ✅ Lot's of of views generated from GitHub traffic!
|
||||||
|
- ✅ A completely free 24/7 hosted Open Ticket bot!
|
||||||
|
- ✅ We will advertise the video to all our socials!
|
||||||
|
|
||||||
|
### 💤 Outdated Content
|
||||||
|
When a tutorial or setup guide is outdated or no longer applicable,
|
||||||
|
we will remove it from the `README.md` & documentation.
|
||||||
|
Your channel will still stay in the list of contributors, so don't worry about that!
|
||||||
|
|
||||||
|
You will be noticed at least a month before removal.
|
||||||
|
This way you can take time to create an updated tutorial if you want.
|
||||||
|
|
||||||
|
### 💬 Contact Us
|
||||||
|
If you've read all these guidelines, requirements & rewards,
|
||||||
|
you can create a ticket in our [discord server](https://discord.dj-dj.be) to start working on it!
|
||||||
|
|
||||||
|
We will try to help you as fast as possible!
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# Contributing Guidelines
|
||||||
|
<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)
|
||||||
|
|
||||||
|
These are the Contributing Guidelines of Open Ticket!<br>
|
||||||
|
Here you can find everything you need to know about contributing to Open Ticket.<br>
|
||||||
|
This includes new features, translations & bug fixes.
|
||||||
|
|
||||||
|
### 💬 Translations
|
||||||
|
#### Step 1: View & Check
|
||||||
|
1. Check the [`./languages/`](./languages/) folder for existing translations.
|
||||||
|
2. When it doesn't exist yet, visit **[step 2](#step-2-translation)**.
|
||||||
|
3. When it does exist, check if it is outdated, incorrect or incomplete.
|
||||||
|
4. If you match one of these requirements, you can also visit **[step 2](#step-2-translating)**.
|
||||||
|
|
||||||
|
#### Step 2: Translation
|
||||||
|
1. If your language doesn't exist yet, copy the [`english.json`](./../languages/english.json) file and rename it to your language.
|
||||||
|
2. You are allowed to use a little bit of `Google Translate` or `DeepL` when mentioned in the upload. (❌ Not Recommended)
|
||||||
|
3. Only translate existing values in the json file. Don't add or remove any values from the file.
|
||||||
|
4. If you are unable to translate something, leave it in `English`.
|
||||||
|
|
||||||
|
#### Step 3: Metadata
|
||||||
|
Metadata can be found in the `_TRANSLATION` variable.
|
||||||
|
|Value |Notes |
|
||||||
|
|-------------|-------------------------------------------------------------------------------------------------|
|
||||||
|
|`otversion` |The Open Ticket version of this translation. Don't edit this! |
|
||||||
|
|`translator` |The translator discord username. When improving existing translation, add your name to the list. |
|
||||||
|
|`lastedited` |The last edited date in the `DD/MM/YYYY` format. |
|
||||||
|
|`language` |The full name of the language with capital letter. |
|
||||||
|
|
||||||
|
> #### ✅ You are also allowed to add your username to the [`README.md`](./../README.md) translator list!
|
||||||
|
|
||||||
|
#### Step 4: Uploading
|
||||||
|
1. When adding a new language, please mention @DJj123dj. He will add the code required for the language to work.
|
||||||
|
2. There are currently 3 ways of uploading translations:
|
||||||
|
- Create a pull request to the [__`dev` branch!__](https://github.com/DJj123dj/open-ticket/tree/dev)
|
||||||
|
- Create a ticket in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- Send a DM to @DJj123dj on discord!
|
||||||
|
3. Now you'll need to wait until the next Open Ticket version for it to be added.
|
||||||
|
|
||||||
|
#### Step 5: Rewards
|
||||||
|
Translators get some rewards for translating Open Ticket!
|
||||||
|
- ✅ Credits in the [`README.md`](./../README.md) translator list!
|
||||||
|
- ✅ Credits in the changelog!
|
||||||
|
- ✅ Credits in the documentation!
|
||||||
|
- ✅ Credits in the translation JSON file!
|
||||||
|
- ✅ A special role in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
|
||||||
|
### 🧩 Plugins (temporary)
|
||||||
|
Currently plugins can only be added to the list via our [discord server](https://discord.dj-dj.be)!
|
||||||
|
|
||||||
|
### 📦 Features (temporary)
|
||||||
|
Currently features can only be suggested in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
|
||||||
|
### 🕷️ Bug Fixes (temporary)
|
||||||
|
Currently bug fixes can only be reported in the following ways:
|
||||||
|
- Create an issue in the repository!
|
||||||
|
- Create a ticket in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
|
||||||
|
#### Please try to always include the `otdebug.txt` file!
|
||||||
|
|
||||||
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
|
**Contributing Guidelines**<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>
|
||||||
|
|
||||||
|
© 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)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
github: DJj123dj
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: Bug Report
|
||||||
|
about: Report bugs to help us improve Open Ticket!
|
||||||
|
title: "[BUG] Your Bug"
|
||||||
|
labels: bug
|
||||||
|
assignees: DJj123dj
|
||||||
|
---
|
||||||
|
|
||||||
|
### Bug Description:
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
### Steps To Reproduce:
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
> Leave empty when you are unable to reproduce the bug!
|
||||||
|
|
||||||
|
### Expected Behaviour:
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
> This file doesn't contain any credentials or sensitive information!
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
This is the Security Policy of Open Ticket!<br>
|
||||||
|
Here you can find a list of all supported & deprecated versions of the bot.<br>
|
||||||
|
You will also find some guidelines about how to report vulnerabilities, bugs & errors.
|
||||||
|
|
||||||
|
### 📦 Supported Versions
|
||||||
|
Below, you can find a list with the status of every Open Ticket version.<br>
|
||||||
|
This list will be updated on every release.
|
||||||
|
|
||||||
|
- 🟦 Early Access **(ideas, bugs, support, html transcripts)**
|
||||||
|
- ✅ Supported **(features, bugs, support, docs, html transcripts)**
|
||||||
|
- 🚧 Maintenance **(support, docs, html transcripts)**
|
||||||
|
- 🟧 Deprecated **(docs)**
|
||||||
|
- ❌ Fully Deprecated
|
||||||
|
|
||||||
|
| Version | Supported | Notes |
|
||||||
|
|------------|-----------|--------------------------------|
|
||||||
|
| 4.0.0-beta | 🟦 | For v4.0.0 Full Release |
|
||||||
|
| 3.5.8 | ✅ | Supported until October 2024 |
|
||||||
|
| 3.5.7 | ✅ | Supported until September 2024 |
|
||||||
|
| 3.5.6 | 🟧 | Documentation Only |
|
||||||
|
| < 3.5.6 | 🟧 | Documentation Only |
|
||||||
|
| < 3.5.0 | ❌ | |
|
||||||
|
|
||||||
|
### 🕷️ Reporting Vulnerabilities
|
||||||
|
You can report vulnerabilities, errors & bugs using one of the following methods:
|
||||||
|
- Create an issue on GitHub!
|
||||||
|
- Create a ticket in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- Message @DJj123dj in DM on discord!
|
||||||
|
- Send an E-mail to [support@dj-dj.be](mailto:support@dj-dj.be)!
|
||||||
|
|
||||||
|
When you report a problem, please **give a small description** about what & how it happend.<br>
|
||||||
|
Try to explain the issue in as much detail as possible.
|
||||||
|
|
||||||
|
If possible, try to provide screenshots!
|
||||||
|
|
||||||
|
### Please upload the `otdebug.txt` file together with your bug report!
|
||||||
|
|
||||||
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
|
**Security Policy**<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>
|
||||||
|
|
||||||
|
© 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)
|
||||||
+9
-10
@@ -1,14 +1,13 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
devConfig.json
|
devconfig/
|
||||||
devConfig1.json
|
devdatabase/
|
||||||
devConfig2.json
|
otdebug.txt
|
||||||
devConfig3.json
|
|
||||||
devConfig4.json
|
|
||||||
devConfig5.json
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
openticketdebug.txt
|
*/.DS_Store
|
||||||
developerChangelog.md
|
*/*/.DS_Store
|
||||||
storage/dynamicDB/
|
*/*/*/.DS_Store
|
||||||
storage/.DS_Store
|
TEMP/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
plugins/*
|
||||||
|
!plugins/example-plugin/
|
||||||
@@ -1,87 +1,142 @@
|
|||||||
## We need translators!
|
> ### 🎥 Content Creators 🎥
|
||||||
If you know a language that isn't already in open ticket and you can write json,
|
> Hey there! We're searching for content creators that would want to create a tutorial or setup guide for Open Ticket!<br>
|
||||||
then is this the job for you!
|
> [📌 More Information](.github/CONTENT_CREATORS.md)
|
||||||
|
---
|
||||||
|
|
||||||
make a ticket in our server to start!
|
<p align="center">
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket" width="650px">
|
||||||
|
<br>Powered By<br>
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/opendiscord/logo.png" alt="Open Ticket" width="170px"><br>
|
||||||
|
<a href="https://discord.com/invite/26vT9wt3n3"><img alt="Discord Invite Link" src="https://img.shields.io/badge/discord-support%20server-5865F2.svg?style=flat-square&logo=discord"></img></a>
|
||||||
|
<a href="https://github.com/DJj123dj/open-ticket/releases/tag/v4.0.0"><img alt="Open Ticket Version" src="https://img.shields.io/badge/version-4.0.0-brightgreen.svg?style=flat-square"></img></a>
|
||||||
|
<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>
|
||||||
|
</p>
|
||||||
|
|
||||||
*if you translate, you will come in the credits*
|
<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>32 Languages</code>! If you need any help, feel free to join our <a href="https://discord.dj-dj.be">discord server</a>!
|
||||||
|
</p>
|
||||||
|
|
||||||
# open-ticket
|
<p align="center"><b>⭐️ Help us grow by giving a star! ⭐️</b></p>
|
||||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v2.5.0) [](#packages) [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE)
|
|
||||||
|
|
||||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
> [!WARNING]
|
||||||
|
> Open Ticket v4 is still in beta! Please report all bugs in our [discord server](https://discord.dj-dj.be)!<br>
|
||||||
|
> The translation count may not be accurate!
|
||||||
|
|
||||||
<img src="logo.png" alt="Open Ticket logo" style="height: 200px; width:200px;"/>
|
### 📌 Features
|
||||||
|
- **📄 html transcripts** - Make use of the most customisable, beautiful and easy-to-use HTML Transcripts!
|
||||||
|
- **✅ ticket actions** - Close, Reopen, Delete, Rename & Move all your tickets!
|
||||||
|
- **🇬🇧 translation** - Open Ticket has been translated in more than **32 languages** by our community!
|
||||||
|
- **🎨 customisation** - Open Ticket has been created around customisation, everything can be customised!
|
||||||
|
- **🖥️ interactions** - The bot has full support for Buttons, Dropdowns, Slash Commands and Modals!
|
||||||
|
- **∞ unlimited everywhere** - Create an infinite amount of tickets & panels!
|
||||||
|
- **📝 advanced plugins** - Create the most advanced plugins that you want or use premade ones by our community!
|
||||||
|
- **👥 user management** - Add & Remove users from all tickets!
|
||||||
|
- **📊 detailed stats** - Open Ticket has ticket, user & global staticstics available for everyone!
|
||||||
|
- **🚫 blacklist** - Blacklist users to prevent them from creating a ticket!
|
||||||
|
- **❓ questions** - Let users answer questions in a modal before the ticket is created!
|
||||||
|
- **📦 commands** - Open Ticket supports both slash & text commands!
|
||||||
|
- **📥 extra types** - The bot also supports Reaction Roles & Url Buttons, because why not ¯\\_(ツ)_/¯
|
||||||
|
- **🎛️ dependencies** - We try to use as little external dependencies as needed!
|
||||||
|
|
||||||
[](https://www.github.com/DJj123dj/open-ticket/wiki)
|
> ### 📦 Resources
|
||||||
|
> Resources might not be accurate yet! *(because v4 is still in beta)*<br>
|
||||||
|
> <a href="https://www.youtube.com/watch?v=2jK9kAf6ASU"><img src="https://apis.dj-dj.be/cdn/openticket/open-ticket-tutorial.png" alt="Open Ticket Tutorial" width="180px"></a>
|
||||||
|
> <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>
|
||||||
|
|
||||||
### Thanks to these people:
|
## 📸 Preview
|
||||||
- DJ-Lite: for doing the administration
|
*Previews are not available yet in the beta release!*
|
||||||
- Sanke: for translation & new ideas
|
|
||||||
- Everyone that reported a bug
|
|
||||||
#### And our translators!
|
|
||||||
- ExothDE: for translation
|
|
||||||
- 1x1: for translation
|
|
||||||
- R0JO: for translation
|
|
||||||
- t0miiis for translation
|
|
||||||
|
|
||||||
## features
|
## 🧩 Plugins
|
||||||
- discord interaction buttons
|
View all available Open Ticket plugins in our [Official Plugin Repository](https://github.com/DJj123dj/open-discord-plugins)!
|
||||||
- slash & text commands
|
|
||||||
- close, delete & re-open tickets
|
|
||||||
- translation in 8 different languages
|
|
||||||
- dynamic database system
|
|
||||||
- transcripts
|
|
||||||
- add/remove users from a ticket
|
|
||||||
- custom colors & name for embeds
|
|
||||||
- customise your ticket
|
|
||||||
- create url buttons for websites
|
|
||||||
- create reaction roles
|
|
||||||
- build with discord.js v14
|
|
||||||
- configure everything per ticket
|
|
||||||
- remove credits if you want :(
|
|
||||||
- unlimited tickets spread over multiple messages
|
|
||||||
|
|
||||||
*comming soon:*
|
### 📦 Official *(made by us)*
|
||||||
- dashboard
|
|Name |Description |
|
||||||
- view transcripts in dashboard
|
|----------------------|-------------------------|
|
||||||
- share transcripts
|
|`nothing yet :)` |Lorem Ipsum Beta 4.0 🙃 |
|
||||||
- close with reason
|
|
||||||
- more translation
|
|
||||||
|
|
||||||
## installation
|
### ✅ Verified *(made by community)*
|
||||||
**You need `node.js 16` to run this project!**
|
|Name |Description |
|
||||||
|
|----------------------|-------------------------|
|
||||||
|
|`nothing yet :)` |Lorem Ipsum Beta 4.0 🙃 |
|
||||||
|
|
||||||
### packages
|
## 🛠️ Contributors
|
||||||
- chalk => version `latest`
|
### 🖥️ Team
|
||||||
- discord.js => version `latest`
|
The team behind Open Ticket!
|
||||||
- express => version `latest`
|
<table>
|
||||||
- node-localstorage => version `latest`
|
<tr>
|
||||||
- axios => version `latest`
|
<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>
|
||||||
|
|
||||||
You can install all of them by running `npm install`
|
### ❤️ Sponsors
|
||||||
|
A big thanks to all our sponsors! Without them, it wouldn't be possible to create this project!
|
||||||
|
|
||||||
## running
|
|<img src="https://github.com/SpyEye2.png" alt="Profile Picture" width="80px"></img>|<img src="https://github.com/DOSEV5.png" alt="Profile Picture" width="80px"></img>|<img src="https://github.com/mods-hd.png" alt="Profile Picture" width="80px"></img>|
|
||||||
you can run `node index.js` but i would recommend you to use `npm start`
|
|----|-|-|
|
||||||
|
|**[SpyEye](https://github.com/SpyEye2)**|**[DOSEV5](https://github.com/DOSEV5)**|**[Mods HD](https://github.com/mods-hd)**|
|
||||||
|
|
||||||
if there are any errors, you can open an **issue on github** or **contact me in our discord server**.
|
### 💬 Translators
|
||||||
|
|Language |Maintainer (discord name) |Status |
|
||||||
|
|---------------------|--------------------------|---------------|
|
||||||
|
|🇬🇧 English |djj123dj |🟢 Up To Date |
|
||||||
|
|🇳🇱 Dutch |djj123dj |🟢 Up To Date |
|
||||||
|
|🇵🇹 Portuguese |quiradon |🟢 Up To Date |
|
||||||
|
|🇨🇿 Czech |spyeye_ |🟢 Up To Date |
|
||||||
|
|🇫🇷 French |sankedev & tostam |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇷🇴 Romanian |sankedev |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇪🇸 Spanish |redactado & josuens |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇩🇪 German |david.3 |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇮🇹 Italian |maurizio26 |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇦🇪 Arabic |deqressing |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇩🇰 Danish |.the_gamer |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇷🇺 Russian |apexo & ander |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇺🇦 Ukrainian |ander |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇹🇷 Turkish |0x15d3 |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇵🇱 Polish |mkevas |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇸🇮 Slovenian |n1kkec |🔴 Outdated |
|
||||||
|
|🇹🇭 Thai |modshd |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇳🇴 Norwegian |noonenook |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇬🇷 Greek |stefanos__. |🔴 Outdated |
|
||||||
|
|🇮🇩 Indonesian |erxg |🟠 Temporary Outdated (beta) |
|
||||||
|
|❓ Kurdish |raze.hama |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇭🇺 Hungarian |kornel0706 |🟠 Temporary Outdated (beta) |
|
||||||
|
|❓ Persian |sasanwm |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇱🇻 Latvian |ronalds1398 |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇪🇪 Estonian |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇯🇵 Japanese |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇰🇷 Korean |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇨🇳 Simplified Chinese |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇨🇳 Traditional Chinese|iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇫🇮 Finnish |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇸🇪 Swedish |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|🇻🇳 Vietnamese |iamnotmega |🟠 Temporary Outdated (beta) |
|
||||||
|
|
||||||
### config
|
|
||||||
Our config documentation is moved to another file:
|
|
||||||
[click here to view](https://www.github.com/DJj123dj/open-ticket/wiki/config-v2.5.0)
|
|
||||||
|
|
||||||
### intents & permissions
|
|
||||||
In the discord developer portal in the "bot" panel you will find 3 switches under the title "Gateaway Intents". The following switches should always be turned on
|
|
||||||
- `SERVER MEMBERS INTENT`
|
|
||||||
- `MESSAGE CONTENT INTENT`
|
|
||||||
|
|
||||||
To work the best, the bot needs `ADMINISTRATOR` permissions.
|
## ⭐️ Star History
|
||||||
You can also configure your own permissions
|
Please help us grow by giving a star! It would help us a lot!
|
||||||
|
|
||||||
## information
|
<a href="https://star-history.com/#DJj123dj/open-ticket&Date">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=DJj123dj/open-ticket&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=DJj123dj/open-ticket&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=DJj123dj/open-ticket&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
||||||
_v2.5.0 stable_
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
**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>
|
||||||
|
|
||||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.dj-dj.be) | [terms of service](https://www.dj-dj.be/terms)
|
© 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)
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"add")) return
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.addEmbed(user)]})
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
|
||||||
log("command","someone used the 'add' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","user added to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"added_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
|
||||||
|
|
||||||
APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "add") return
|
|
||||||
const user = interaction.options.getUser("user")
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.addEmbed(user)]})
|
|
||||||
|
|
||||||
var loguser = user
|
|
||||||
log("command","someone used the 'add' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","user added to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"added_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
|
||||||
APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"close")) return
|
|
||||||
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.closeEmbed(msg.author)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
|
|
||||||
var name = msg.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"close",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'close' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("close",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "close") return
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
|
|
||||||
var name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'close' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("close",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"delete")) return
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.deleteEmbed(msg.author)]})
|
|
||||||
|
|
||||||
var name = msg.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"delete",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'delete' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("delete",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "delete") return
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return interaction.reply({embeds:[bot.errorLog.noPermsDelete]})
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
|
|
||||||
var name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'delete' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("delete",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
const helpEmbed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("❔ "+l.helpMenu.title)
|
|
||||||
|
|
||||||
const prefix = config.prefix
|
|
||||||
const header = config.system.ticket_channel ? l.helpMenu.header1.replace("{0}","<#"+config.system.ticket_channel+">") : l.helpMenu.header2
|
|
||||||
helpEmbed.setDescription(header+"`"+prefix+"msg <id>` ➜ _"+l.helpMenu.msgCmd+"_\n\n`"+prefix+"rename <name>` ➜ _"+l.helpMenu.renameCmd+"_\n`"+prefix+"close` ➜ _"+l.helpMenu.closeCmd+"_\n`"+prefix+"delete` ➜ _"+l.helpMenu.deleteCmd+"_\n`"+prefix+"reopen` ➜ _"+l.helpMenu.reopenCmd+"_\n\n`"+prefix+"add <user>` ➜ _"+l.helpMenu.addCmd+"_\n`"+prefix+"remove <user>` ➜ _"+l.helpMenu.removeCmd+"_`")
|
|
||||||
|
|
||||||
if (config.credits) helpEmbed.setFooter({text:"Open-Ticket by DJdj Development | view on github for source code",iconURL:"https://raw.githubusercontent.com/DJj123dj/open-ticket/main/logo.png"})
|
|
||||||
|
|
||||||
var otherprefix = prefix.endsWith(" ") ? prefix.substring(0,prefix.length-1) : prefix
|
|
||||||
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix)) return
|
|
||||||
var args = msg.content.split(config.prefix)
|
|
||||||
|
|
||||||
if (msg.content == config.prefix || msg.content == config.prefix+" " || msg.content == otherprefix){
|
|
||||||
msg.channel.send({embeds:[helpEmbed]})
|
|
||||||
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[1]){
|
|
||||||
if (!args[1].startsWith("close") && !args[1].startsWith("delete") && !args[1].startsWith("remove") && !args[1].startsWith("add") && !args[1].startsWith("msg") && !args[1].startsWith("remove") && !args[1].startsWith("rename") && !args[1].startsWith("reopen")){
|
|
||||||
msg.channel.send({embeds:[helpEmbed]})
|
|
||||||
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "help") return
|
|
||||||
|
|
||||||
interaction.reply({embeds:[helpEmbed]})
|
|
||||||
log("command","someone used the 'help' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("help",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"remove")) return
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.delete(user.id)
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.removeEmbed(user)]})
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
|
||||||
|
|
||||||
log("command","someone used the 'remove' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","user removed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"removed_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
APIEvents.onTicketRemove(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
|
||||||
APIEvents.onCommand("remove",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "remove") return
|
|
||||||
const user = interaction.options.getUser("user")
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
await interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.delete(user.id)
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.removeEmbed(user)]})
|
|
||||||
|
|
||||||
var loguser = user
|
|
||||||
|
|
||||||
log("command","someone used the 'remove' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","user removed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"removed_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
APIEvents.onTicketRemove(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
|
||||||
APIEvents.onCommand("remove",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"rename")) return
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
var newname = msg.content.split(config.prefix+"rename")[1].substring(1)
|
|
||||||
|
|
||||||
if (!newname) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<name>`:\n`"+config.prefix+"rename <name>`")]})
|
|
||||||
|
|
||||||
var name = msg.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!prefix) prefix = "noprefix-"
|
|
||||||
|
|
||||||
msg.channel.setName(prefix+newname)
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.renameEmbed(msg.author,prefix+newname)]})
|
|
||||||
|
|
||||||
log("command","someone used the 'rename' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","ticket renamed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
|
||||||
APIEvents.onCommand("rename",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "rename") return
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
var newname = interaction.options.getString("name")
|
|
||||||
var name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!prefix) prefix = "noprefix-"
|
|
||||||
|
|
||||||
interaction.channel.setName(prefix+newname)
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.renameEmbed(interaction.user,prefix+newname)]})
|
|
||||||
|
|
||||||
log("command","someone used the 'rename' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","ticket renamed",[{key:"user",value:interaction.user.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
|
||||||
|
|
||||||
APIEvents.onCommand("rename",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"reopen")) return
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.reopenEmbed(msg.author)],components:[bot.buttons.close.openRowNormal]})
|
|
||||||
|
|
||||||
require("../core/ticketReopener").reopenTicket(msg.guild,msg.channel,msg.author)
|
|
||||||
|
|
||||||
log("command","someone used the 'reopen' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("reopen",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "reopen") return
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(async msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
await interaction.reply({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
|
||||||
|
|
||||||
require("../core/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
|
||||||
|
|
||||||
log("command","someone used the 'reopen' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("reopen",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
/**@type {String[]} */
|
|
||||||
var msgIds = []
|
|
||||||
config.messages.forEach((msg) => {
|
|
||||||
msgIds.push(msg.id)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
client.on("messageCreate", msg => {
|
|
||||||
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const id = msg.content.split(config.prefix+"msg")[1].substring(1) ? msg.content.split(config.prefix+"msg")[1].substring(1) : false
|
|
||||||
|
|
||||||
if (!id) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<id>`:\n`"+config.prefix+"msg <id>`")]})
|
|
||||||
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
|
||||||
|
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[embed],components:componentRows})
|
|
||||||
|
|
||||||
log("command","someone used the 'message' command",[{key:"user",value:msg.author.tag},{key:"id",value:id}])
|
|
||||||
APIEvents.onCommand("message",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate", (interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "message") return
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const id = interaction.options.getString("id")
|
|
||||||
|
|
||||||
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
|
||||||
|
|
||||||
interaction.reply({content:l.commands.ticketWarning})
|
|
||||||
interaction.channel.send({embeds:[embed],components:componentRows})
|
|
||||||
|
|
||||||
log("command","someone used the 'message' command",[{key:"user",value:interaction.user.tag},{key:"id",value:id}])
|
|
||||||
|
|
||||||
APIEvents.onCommand("message",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
-95
@@ -1,95 +0,0 @@
|
|||||||
{
|
|
||||||
"main_color":"#ffffff",
|
|
||||||
"server_id":"server id (for slash cmds)",
|
|
||||||
"auth_token":"auth token",
|
|
||||||
"main_adminroles":["discord role id"],
|
|
||||||
"prefix":"!ticket ",
|
|
||||||
"languagefile":"english",
|
|
||||||
|
|
||||||
"credits":true,
|
|
||||||
"status":{
|
|
||||||
"enabled":true,
|
|
||||||
"type":"PLAYING",
|
|
||||||
"text":"!ticket help"
|
|
||||||
},
|
|
||||||
|
|
||||||
"system":{
|
|
||||||
"ticket_channel":"channel id",
|
|
||||||
"max_allowed_tickets":3,
|
|
||||||
"enable_DM_Messages":true,
|
|
||||||
|
|
||||||
"has@everyoneaccess":false,
|
|
||||||
"member_role":"member role (doesn't have access to tickets)",
|
|
||||||
"closeMode":"adminonly|normal",
|
|
||||||
|
|
||||||
"enable_transcript":false,
|
|
||||||
"enable_DM_transcript":false,
|
|
||||||
"transcript_channel":"channel id"
|
|
||||||
},
|
|
||||||
|
|
||||||
"options":[
|
|
||||||
{
|
|
||||||
"id":"general",
|
|
||||||
"name":"Question",
|
|
||||||
"description":"Create this ticket if you have a question.",
|
|
||||||
"icon":"🎫",
|
|
||||||
"label":"question",
|
|
||||||
"type":"ticket",
|
|
||||||
|
|
||||||
"color":"gray",
|
|
||||||
"adminroles":["role id"],
|
|
||||||
"channelprefix":"question-",
|
|
||||||
"category":"category id",
|
|
||||||
"message":"You created a ticket!",
|
|
||||||
"enableDMMessage":true,
|
|
||||||
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*"
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":"website",
|
|
||||||
"name":"Website",
|
|
||||||
"description":"Go to our website.",
|
|
||||||
"icon":"✅",
|
|
||||||
"label":"click here",
|
|
||||||
"type":"website",
|
|
||||||
|
|
||||||
"url":"https://www.dj-dj.be"
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":"role",
|
|
||||||
"name":"Verify",
|
|
||||||
"description":"Click here to get the verify role.",
|
|
||||||
"icon":"👮🏼",
|
|
||||||
"label":"get a role",
|
|
||||||
"type":"role",
|
|
||||||
|
|
||||||
"color":"red",
|
|
||||||
"roles":["discord role id"],
|
|
||||||
"mode":"add&remove|remove|add",
|
|
||||||
"enableDMMessage":true
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"messages":[
|
|
||||||
{
|
|
||||||
"id":"1",
|
|
||||||
"name":"Choose Your Ticket",
|
|
||||||
"description":"You can click one of the buttons below!",
|
|
||||||
|
|
||||||
"enableFooter":false,
|
|
||||||
"footer":"Open Ticket v2.5.0 - I'm a footer!",
|
|
||||||
|
|
||||||
"enableThumbnail":false,
|
|
||||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
|
||||||
|
|
||||||
"enableCustomColor":false,
|
|
||||||
"color":"#ffffff",
|
|
||||||
|
|
||||||
"options":["general","apply"],
|
|
||||||
"enableTicketExplaination":true,
|
|
||||||
"enableMaxTicketsWarning":true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"_INFO":{
|
||||||
|
"support":"https://otdocs.dj-dj.be",
|
||||||
|
"discord":"https://discord.dj-dj.be",
|
||||||
|
"version":"open-ticket-v4.0.0"
|
||||||
|
},
|
||||||
|
|
||||||
|
"token":"your bot token here! Or leave empty when you use tokenFromENV",
|
||||||
|
"tokenFromENV":false,
|
||||||
|
|
||||||
|
"mainColor":"#f8ba00",
|
||||||
|
"language":"english",
|
||||||
|
"prefix":"!ticket ",
|
||||||
|
"serverId":"discord server id",
|
||||||
|
"globalAdmins":["discord role id"],
|
||||||
|
|
||||||
|
"slashCommands":true,
|
||||||
|
"textCommands":true,
|
||||||
|
|
||||||
|
"status":{
|
||||||
|
"enabled":true,
|
||||||
|
"type":"listening OR watching OR playing OR custom",
|
||||||
|
"text":"/help",
|
||||||
|
"status":"online OR invisible OR idle OR dnd"
|
||||||
|
},
|
||||||
|
|
||||||
|
"system":{
|
||||||
|
"removeParticipantsOnClose":false,
|
||||||
|
"replyOnTicketCreation":true,
|
||||||
|
"replyOnReactionRole":true,
|
||||||
|
"useTranslatedConfigChecker":true,
|
||||||
|
"preferSlashOverText":true,
|
||||||
|
"sendErrorOnUnknownCommand":true,
|
||||||
|
"questionFieldsInCodeBlock":true,
|
||||||
|
"disableVerifyBars":false,
|
||||||
|
"useRedErrorEmbeds":true,
|
||||||
|
"emojiStyle":"before (OR after OR double OR disabled)",
|
||||||
|
|
||||||
|
"enableTicketClaimButtons":true,
|
||||||
|
"enableTicketCloseButtons":true,
|
||||||
|
"enableTicketPinButtons":true,
|
||||||
|
"enableTicketDeleteButtons":true,
|
||||||
|
"enableTicketActionWithReason":true,
|
||||||
|
"enableDeleteWithoutTranscript":true,
|
||||||
|
|
||||||
|
"logs":{
|
||||||
|
"enabled":false,
|
||||||
|
"channel":"discord channel id"
|
||||||
|
},
|
||||||
|
|
||||||
|
"limits":{
|
||||||
|
"enabled":true,
|
||||||
|
"globalMaximum":50,
|
||||||
|
"userMaximum":3
|
||||||
|
},
|
||||||
|
|
||||||
|
"permissions":{
|
||||||
|
"help":"everyone (OR admin OR none OR role id)",
|
||||||
|
"panel":"admin (OR everyone OR none OR role id)",
|
||||||
|
"ticket":"none (OR admin OR everyone OR role id)",
|
||||||
|
"close":"everyone (OR admin OR none OR role id)",
|
||||||
|
"delete":"admin (OR everyone OR none OR role id)",
|
||||||
|
"reopen":"everyone (OR admin OR none OR role id)",
|
||||||
|
"claim":"admin (OR everyone OR none OR role id)",
|
||||||
|
"unclaim":"admin (OR everyone OR none OR role id)",
|
||||||
|
"pin":"admin (OR everyone OR none OR role id)",
|
||||||
|
"unpin":"admin (OR everyone OR none OR role id)",
|
||||||
|
"move":"admin (OR everyone OR none OR role id)",
|
||||||
|
"rename":"admin (OR everyone OR none OR role id)",
|
||||||
|
"add":"admin (OR everyone OR none OR role id)",
|
||||||
|
"remove":"admin (OR everyone OR none OR role id)",
|
||||||
|
"blacklist":"admin (OR everyone OR none OR role id)",
|
||||||
|
"stats":"everyone (OR admin OR none OR role id)",
|
||||||
|
"clear":"admin (OR everyone OR none OR role id)",
|
||||||
|
"autoclose":"admin (OR everyone OR none OR role id)",
|
||||||
|
"autodelete":"admin (OR everyone OR none OR role id)"
|
||||||
|
},
|
||||||
|
|
||||||
|
"messages":{
|
||||||
|
"creation":{"dm":false, "logs":true},
|
||||||
|
"closing":{"dm":false, "logs":true},
|
||||||
|
"deleting":{"dm":false, "logs":true},
|
||||||
|
"reopening":{"dm":false, "logs":true},
|
||||||
|
"claiming":{"dm":false, "logs":true},
|
||||||
|
"pinning":{"dm":false, "logs":true},
|
||||||
|
"adding":{"dm":false, "logs":true},
|
||||||
|
"removing":{"dm":false, "logs":true},
|
||||||
|
"renaming":{"dm":false, "logs":true},
|
||||||
|
"moving":{"dm":false, "logs":true},
|
||||||
|
"blacklisting":{"dm":false, "logs":true},
|
||||||
|
"roleAdding":{"dm":false, "logs":true},
|
||||||
|
"roleRemoving":{"dm":false, "logs":true}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id":"example-ticket",
|
||||||
|
"name":"Question",
|
||||||
|
"description":"Create this ticket if you have a question! (or leave empty)",
|
||||||
|
"type":"ticket",
|
||||||
|
|
||||||
|
"button":{
|
||||||
|
"emoji":"🎫 (or leave empty)",
|
||||||
|
"label":"question (or leave empty)",
|
||||||
|
"color":"gray OR red OR green OR blue"
|
||||||
|
},
|
||||||
|
|
||||||
|
"ticketAdmins":["discord role id"],
|
||||||
|
"readonlyAdmins":["discord role id"],
|
||||||
|
"allowCreationByBlacklistedUsers":false,
|
||||||
|
"questions":["example-question-1","example-question-2"],
|
||||||
|
|
||||||
|
"channel":{
|
||||||
|
"prefix":"question-",
|
||||||
|
"suffix":"user-name OR user-id OR random-number OR random-hex OR counter-dynamic OR counter-fixed",
|
||||||
|
"category":"category id (or leave empty)",
|
||||||
|
"closedCategory":"category id (or leave empty)",
|
||||||
|
"backupCategory":"category id (or leave empty)",
|
||||||
|
"claimedCategory":[
|
||||||
|
{"user":"user id","category":"category id"}
|
||||||
|
],
|
||||||
|
"description":"This is a question ticket (or leave empty)"
|
||||||
|
},
|
||||||
|
|
||||||
|
"dmMessage":{
|
||||||
|
"enabled":false,
|
||||||
|
"text":"Thanks for creating a ticket in our server! (or leave empty)",
|
||||||
|
"embed":{
|
||||||
|
"enabled":false,
|
||||||
|
"title":"Embed Title! (or leave empty)",
|
||||||
|
"description":"Description (or leave empty)",
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
|
||||||
|
"image":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"thumbnail":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"fields":[
|
||||||
|
{"name":"field name","value":"field value","inline":false}
|
||||||
|
],
|
||||||
|
"timestamp":false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ticketMessage":{
|
||||||
|
"enabled":true,
|
||||||
|
"text":"",
|
||||||
|
"embed":{
|
||||||
|
"enabled":true,
|
||||||
|
"title":"Question Ticket",
|
||||||
|
"description":"Thanks for creating a 'Question' ticket in our server!\nOur support team will help you soon!",
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
|
||||||
|
"image":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"thumbnail":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"fields":[
|
||||||
|
{"name":"field name","value":"field value","inline":false}
|
||||||
|
],
|
||||||
|
"timestamp":false
|
||||||
|
},
|
||||||
|
"ping":{
|
||||||
|
"@here":true,
|
||||||
|
"@everyone":false,
|
||||||
|
"custom":["discord role id"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoclose":{
|
||||||
|
"enableInactiveHours":false,
|
||||||
|
"inactiveHours":24,
|
||||||
|
"enableUserLeave":true,
|
||||||
|
"disableOnClaim":false
|
||||||
|
},
|
||||||
|
"autodelete":{
|
||||||
|
"enableInactiveDays":false,
|
||||||
|
"inactiveDays":7,
|
||||||
|
"enableUserLeave":true,
|
||||||
|
"disableOnClaim":false
|
||||||
|
},
|
||||||
|
"cooldown":{
|
||||||
|
"enabled":false,
|
||||||
|
"cooldownMinutes":10
|
||||||
|
},
|
||||||
|
"limits":{
|
||||||
|
"enabled":false,
|
||||||
|
"globalMaximum":20,
|
||||||
|
"userMaximum":3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"example-website",
|
||||||
|
"name":"Website",
|
||||||
|
"description":"Go to our website.",
|
||||||
|
"type":"website",
|
||||||
|
|
||||||
|
"button":{
|
||||||
|
"emoji":"😃",
|
||||||
|
"label":"Visit our website"
|
||||||
|
},
|
||||||
|
|
||||||
|
"url":"https://www.dj-dj.be"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"example-role",
|
||||||
|
"name":"Update Ping",
|
||||||
|
"description":"Click here to get notified on updates!",
|
||||||
|
"type":"role",
|
||||||
|
|
||||||
|
"button":{
|
||||||
|
"emoji":"📢",
|
||||||
|
"label":"Update Ping",
|
||||||
|
"color":"gray OR red OR green OR blue"
|
||||||
|
},
|
||||||
|
|
||||||
|
"roles":["discord role id"],
|
||||||
|
"mode":"add&remove OR remove OR add",
|
||||||
|
"removeRolesOnAdd":["discord role id"],
|
||||||
|
"addOnMemberJoin":false
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id":"example-embed",
|
||||||
|
"name":"Example Embed",
|
||||||
|
"dropdown":false,
|
||||||
|
"options":["example-ticket","example-website","example-role"],
|
||||||
|
|
||||||
|
"text":"",
|
||||||
|
"embed":{
|
||||||
|
"enabled":true,
|
||||||
|
"title":"Tickets:",
|
||||||
|
"description":"Create a ticket by clicking one of the buttons below!",
|
||||||
|
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
"url":"https://openticket.dj-dj.be (or leave empty)",
|
||||||
|
|
||||||
|
"image":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"thumbnail":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
|
||||||
|
"footer":"Open Ticket v4.0.0 (or leave empty)",
|
||||||
|
"fields":[
|
||||||
|
{"name":"field name","value":"field value","inline":false}
|
||||||
|
],
|
||||||
|
"timestamp":false
|
||||||
|
},
|
||||||
|
"settings":{
|
||||||
|
"dropdownPlaceholder":"Create a ticket!",
|
||||||
|
|
||||||
|
"enableMaxTicketsWarningInText":false,
|
||||||
|
"enableMaxTicketsWarningInEmbed":true,
|
||||||
|
|
||||||
|
"describeOptionsLayout":"simple OR normal OR detailed",
|
||||||
|
"describeOptionsCustomTitle":"",
|
||||||
|
"describeOptionsInText":false,
|
||||||
|
"describeOptionsInEmbedFields":true,
|
||||||
|
"describeOptionsInEmbedDescription":false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id":"example-question-1",
|
||||||
|
"name":"Example Question 1",
|
||||||
|
"type":"short",
|
||||||
|
|
||||||
|
"required":true,
|
||||||
|
"placeholder":"Insert your short answer here!",
|
||||||
|
"length":{
|
||||||
|
"enabled":false,
|
||||||
|
"min":0,
|
||||||
|
"max":1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"example-question-2",
|
||||||
|
"name":"Example Question 2",
|
||||||
|
"type":"paragraph",
|
||||||
|
|
||||||
|
"required":false,
|
||||||
|
"placeholder":"Insert your long answer here!",
|
||||||
|
"length":{
|
||||||
|
"enabled":false,
|
||||||
|
"min":0,
|
||||||
|
"max":1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"general":{
|
||||||
|
"enabled":false,
|
||||||
|
|
||||||
|
"enableChannel":false,
|
||||||
|
"enableCreatorDM":false,
|
||||||
|
"enableParticipantDM":false,
|
||||||
|
"enableActiveAdminDM":false,
|
||||||
|
"enableEveryAdminDM":false,
|
||||||
|
|
||||||
|
"channel":"transcript channel id (or leave empty)",
|
||||||
|
"mode":"html OR text"
|
||||||
|
},
|
||||||
|
"embedSettings":{
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
"listAllParticipants":false,
|
||||||
|
"includeTicketStats":false
|
||||||
|
},
|
||||||
|
"textTranscriptStyle":{
|
||||||
|
"layout":"simple OR normal OR detailed",
|
||||||
|
"includeStats":true,
|
||||||
|
"includeIds":false,
|
||||||
|
"includeEmbeds":true,
|
||||||
|
"includeFiles":true,
|
||||||
|
"includeBotMessages":true,
|
||||||
|
|
||||||
|
"fileMode":"custom OR channel-name OR channel-id OR user-name OR user-id",
|
||||||
|
"customFileName":"this-is-a-transcript (or leave empty)"
|
||||||
|
},
|
||||||
|
"htmlTranscriptStyle":{
|
||||||
|
"background":{
|
||||||
|
"enableCustomBackground":false,
|
||||||
|
"backgroundColor":"#f8ba00 (or leave empty)",
|
||||||
|
"backgroundImage":"https://www.example.com/image.png (or leave empty)"
|
||||||
|
|
||||||
|
},
|
||||||
|
"header":{
|
||||||
|
"enableCustomHeader":false,
|
||||||
|
"backgroundColor":"#202225",
|
||||||
|
"decoColor":"#f8ba00",
|
||||||
|
"textColor":"#ffffff"
|
||||||
|
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"enableCustomStats":false,
|
||||||
|
"backgroundColor":"#202225",
|
||||||
|
"keyTextColor":"#737373",
|
||||||
|
"valueTextColor":"#ffffff",
|
||||||
|
"hideBackgroundColor":"#40444a",
|
||||||
|
"hideTextColor":"#ffffff"
|
||||||
|
},
|
||||||
|
"favicon":{
|
||||||
|
"enableCustomFavicon":false,
|
||||||
|
"imageUrl":"https://transcripts.dj-dj.be/favicon.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
//base
|
|
||||||
const bot = require("../../index")
|
|
||||||
|
|
||||||
exports.client = bot.client
|
|
||||||
exports.config = bot.config
|
|
||||||
exports.utils = {
|
|
||||||
log:bot.errorLog.log(),
|
|
||||||
storage:bot.storage
|
|
||||||
}
|
|
||||||
|
|
||||||
//events
|
|
||||||
const events = require("./modules/events").events
|
|
||||||
exports.events = events
|
|
||||||
|
|
||||||
//actions
|
|
||||||
const actions = require("./modules/actions").actions
|
|
||||||
//comming soon
|
|
||||||
//exports.actions = actions
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"version":"1.0.0",
|
|
||||||
|
|
||||||
|
|
||||||
"disclaimer":"DISABLE doesn't work yet! Below this message!",
|
|
||||||
"disable":{
|
|
||||||
"messages":{
|
|
||||||
"ticketCreated":false,
|
|
||||||
"ticketClosed":false,
|
|
||||||
"ticketDeleted":false,
|
|
||||||
"ticketReopened":false
|
|
||||||
},
|
|
||||||
"transcripts":{
|
|
||||||
"server":false,
|
|
||||||
"dm":false
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"text":{
|
|
||||||
"help":false,
|
|
||||||
"msg":false,
|
|
||||||
"close":false,
|
|
||||||
"delete":false,
|
|
||||||
"reopen":false,
|
|
||||||
"new":false,
|
|
||||||
"add":false,
|
|
||||||
"remove":false,
|
|
||||||
"rename":false
|
|
||||||
},
|
|
||||||
"slash":{
|
|
||||||
"help":false,
|
|
||||||
"msg":false,
|
|
||||||
"close":false,
|
|
||||||
"delete":false,
|
|
||||||
"reopen":false,
|
|
||||||
"new":false,
|
|
||||||
"add":false,
|
|
||||||
"remove":false,
|
|
||||||
"rename":false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"checkerjs":{
|
|
||||||
"token":false,
|
|
||||||
"all":false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
//ACTIONS:
|
|
||||||
|
|
||||||
|
|
||||||
//EXPORT ACTIONS:
|
|
||||||
exports.actions = {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require("../../../index")
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
/** FOR DEVELOPERS ONLY!!
|
|
||||||
* Don't change anything in this file, read the api documentation first!
|
|
||||||
* look into "api docs.md" for the docs!
|
|
||||||
*/
|
|
||||||
|
|
||||||
//used when creating plugins!
|
|
||||||
exports.enableApiLogs = false
|
|
||||||
|
|
||||||
|
|
||||||
//DOESN'T WORK YET
|
|
||||||
//this is used when embedding open ticket into another bot
|
|
||||||
exports.embeddedMode = false
|
|
||||||
exports.clientLocation = require("../../../index").client
|
|
||||||
|
|
||||||
/** !! WARNING !!
|
|
||||||
* Only edit or extend the code when you know what you are doing!
|
|
||||||
* If open ticket crashes while you change the code, then we can't help you!
|
|
||||||
*
|
|
||||||
* DO IT ON YOUR OWN RISK!
|
|
||||||
*/
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
|
|
||||||
//EVENT API:
|
|
||||||
const ticketOpenListeners = []
|
|
||||||
const ticketCloseListeners = []
|
|
||||||
const ticketDeleteListeners = []
|
|
||||||
const ticketReopenListeners = []
|
|
||||||
|
|
||||||
const ticketAddListeners = []
|
|
||||||
const ticketRemoveListeners = []
|
|
||||||
|
|
||||||
|
|
||||||
const transcriptCreationListeners = []
|
|
||||||
const commandListeners = []
|
|
||||||
const reactionRoleListeners = []
|
|
||||||
const errorListeners = []
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketOpen = (user,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","new ticket created",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketOpenListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
* @param {String} reason
|
|
||||||
*/
|
|
||||||
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","ticket closed",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)},{key:"reason",value:reason}])
|
|
||||||
|
|
||||||
ticketCloseListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata,reason)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","ticket deleted",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketDeleteListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","ticket reopened",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketReopenListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.User} editeduser
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","user added to ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketAddListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,editeduser,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.User} editeduser
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","user removed from ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketRemoveListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,editeduser,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.Message[]} messages
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onTranscriptCreation = (messages,channel,guild,date) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","transcript created",[{key:"messages",value:JSON.stringify(messages)},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
|
||||||
|
|
||||||
transcriptCreationListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(messages,channel,guild,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@typedef {"help"|"message"|"close"|"delete"|"reopen"|"rename"|"add"|"remove"} OTCommandType */
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {OTCommandType} type
|
|
||||||
* @param {Boolean} hasPerms
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
|
||||||
|
|
||||||
const newguild = guild ? guild : false
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","someone used a command",[{key:"type",value:type},{key:"hasPerms",value:hasPerms},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:newguild.id}])
|
|
||||||
|
|
||||||
commandListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(type,hasPerms,user,channel,newguild,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@typedef {"add"|"remove"|"add&remove"} OTReactionRoleType */
|
|
||||||
/**@typedef {"add"|"remove"} OTReactionRoleMode */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {OTReactionRoleMode} mode
|
|
||||||
* @param {OTReactionRoleType} type
|
|
||||||
* @param {discord.Role} role
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onReactionRole = (mode,type,role,user,channel,guild,date) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","someone used a reaction role",[{key:"mode",value:mode},{key:"type",value:type},{key:"roleid",value:role.id},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
|
||||||
|
|
||||||
reactionRoleListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(mode,type,role,user,channel,guild,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {String} err
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onError = (err,date) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","there is an error",[{key:"error",value:err}])
|
|
||||||
|
|
||||||
errorListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(err,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//EVENT CALLBACKS:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TicketActionEvent
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TicketCloseEvent
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
* @param {String} reason
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TranscriptCreationEvent
|
|
||||||
* @param {discord.Message[]} messages
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TicketUserChangeEvent
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.User} editeduser
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback CommandEvent
|
|
||||||
* @param {OTCommandType} type
|
|
||||||
* @param {Boolean} hasPerms
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild|false} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback ReactionRoleEvent
|
|
||||||
* @param {OTReactionRoleMode} mode
|
|
||||||
* @param {OTReactionRoleType} type
|
|
||||||
* @param {discord.Role} role
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback ErrorEvent
|
|
||||||
* @param {String} error
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
//EVENT EXPORT:
|
|
||||||
|
|
||||||
/**@param {TicketActionEvent} callback */
|
|
||||||
const onTicketOpen = (callback) => {
|
|
||||||
ticketOpenListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketCloseEvent} callback */
|
|
||||||
const onTicketClose = (callback) => {
|
|
||||||
ticketCloseListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketActionEvent} callback */
|
|
||||||
const onTicketDelete = (callback) => {
|
|
||||||
ticketDeleteListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketActionEvent} callback */
|
|
||||||
const onTicketReopen = (callback) => {
|
|
||||||
ticketReopenListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketUserChangeEvent} callback */
|
|
||||||
const onTicketAdd = (callback) => {
|
|
||||||
ticketAddListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketUserChangeEvent} callback */
|
|
||||||
const onTicketRemove = (callback) => {
|
|
||||||
ticketRemoveListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TranscriptCreationEvent} callback */
|
|
||||||
const onTranscriptCreation = (callback) => {
|
|
||||||
transcriptCreationListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {CommandEvent} callback */
|
|
||||||
const onCommand = (callback) => {
|
|
||||||
commandListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {ReactionRoleEvent} callback */
|
|
||||||
const onReactionRole = (callback) => {
|
|
||||||
commandListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {ErrorEvent} callback */
|
|
||||||
const onError = (callback) => {
|
|
||||||
errorListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.events = {
|
|
||||||
onTicketOpen,
|
|
||||||
onTicketClose,
|
|
||||||
onTicketDelete,
|
|
||||||
onTicketReopen,
|
|
||||||
onTicketAdd,
|
|
||||||
onTicketRemove,
|
|
||||||
onTranscriptCreation,
|
|
||||||
onCommand,
|
|
||||||
onReactionRole,
|
|
||||||
onError
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
const fs = require("fs")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
const files = fs.readdirSync("./plugins")
|
|
||||||
|
|
||||||
var totalcount = 0
|
|
||||||
var successcount = 0
|
|
||||||
var failcount = 0
|
|
||||||
files.forEach((file) => {
|
|
||||||
if (file.endsWith(".plugin.js")){
|
|
||||||
try {
|
|
||||||
require("../../plugins/"+file)()
|
|
||||||
|
|
||||||
successcount++
|
|
||||||
totalcount++
|
|
||||||
}catch{
|
|
||||||
failcount++
|
|
||||||
totalcount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
log("info","loaded plugins",[{key:"success",value:successcount},{key:"error",value:failcount},{key:"total",value:totalcount}])
|
|
||||||
}
|
|
||||||
-366
@@ -1,366 +0,0 @@
|
|||||||
exports.checker = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
const config = require("../config.json")
|
|
||||||
var errorList = []
|
|
||||||
var isError = false
|
|
||||||
var warnList = []
|
|
||||||
var isWarn = false
|
|
||||||
const createError = (message) => {
|
|
||||||
isError = true
|
|
||||||
errorList.push("open-ticket CONFIG ERROR: "+message)
|
|
||||||
}
|
|
||||||
const createWarn = (message) => {
|
|
||||||
isWarn = true
|
|
||||||
warnList.push("open-ticket CONFIG WARNING: "+message)
|
|
||||||
}
|
|
||||||
|
|
||||||
//validators
|
|
||||||
/**@param {"userid"|"roleid"|"channelid"|"serverid"|"categoryid"} mode @param {String} value @param {String} path */
|
|
||||||
const checkDiscord = (mode,value,path) => {
|
|
||||||
if (mode == "userid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this user id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "channelid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this channel id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "roleid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this role id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "serverid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this server id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "categoryid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this category id is invalid")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**@param {String} value */
|
|
||||||
const checkToken = (value) => {
|
|
||||||
if (value.includes(" ") || value.length < 40){
|
|
||||||
createError("'auth_token' | your token is invalid")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} value @param {String} path */
|
|
||||||
const checkHexColor = (value,path) => {
|
|
||||||
if (!/^#[a-fA-F0-9]{3,6}$/.test(value)){
|
|
||||||
if (value.length < 4) return createError("'"+path+"' | hex color too short! (example: #123abc)")
|
|
||||||
if (value.length > 7) return createError("'"+path+"' | hex color too long! (example: #123abc)")
|
|
||||||
createError("'"+path+"' | invalid color! (example: #123abc)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} value @param {String} path */
|
|
||||||
const checkEmbedColor = (value,path) => {
|
|
||||||
if (!['DEFAULT','WHITE','AQUA','GREEN','BLUE','YELLOW','PURPLE','LUMINOUS_VIVID_PINK','FUCHSIA','GOLD','ORANGE','RED','GREY','DARKER_GREY','NAVY','DARK_AQUA','DARK_GREEN','DARK_BLUE','DARK_PURPLE','DARK_VIVID_PINK','DARK_GOLD','DARK_ORANGE','DARK_RED','DARK_GREY','LIGHT_GREY','DARK_NAVY','BLURPLE','GREYPLE','DARK_BUT_NOT_BLACK','NOT_QUITE_BLACK','RANDOM'].includes(value)){
|
|
||||||
return createError("'"+path+"' | invalid color, must be a hex code or default color (more info in the wiki)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} value @param {String} path @param {Number} minLength @param {Number} maxLength @param {String} name */
|
|
||||||
const checkString = (value,minLength,maxLength,path,name) => {
|
|
||||||
if (value.length < minLength){
|
|
||||||
createError("'"+path+"' | "+name+" is too short!")
|
|
||||||
}else if (value.length > maxLength){
|
|
||||||
createError("'"+path+"' | "+name+" is too long!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
|
|
||||||
const checkDiscordArray = (mode,arrayValue,path) => {
|
|
||||||
if (mode == "userid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this user id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (mode == "channelid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this channel id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (mode == "roleid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this role id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (mode == "serverid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this server id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**@param {String} value @param {"string"|"boolean"|"number"} type */
|
|
||||||
const checkType = (value,type,path) => {
|
|
||||||
if (type == "boolean"){
|
|
||||||
if (typeof value != "boolean"){
|
|
||||||
createError("'"+path+"' | invalid type, this must be a boolean!")
|
|
||||||
}
|
|
||||||
}else if (type == "number"){
|
|
||||||
if (typeof value != "number"){
|
|
||||||
createError("'"+path+"' | invalid type, this must be a number!")
|
|
||||||
}
|
|
||||||
}else if (type == "string"){
|
|
||||||
if (typeof value != "string"){
|
|
||||||
createError("'"+path+"' | invalid type, this must be a string!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const checkButtonColor = (value,path) => {
|
|
||||||
if (value != "none" && value != "grey" && value != "gray" && value != "black" && value != "red" && value != "green" && value != "blue" && value != "blurple"){
|
|
||||||
createError("'"+path+"' | invalid color, it must be one of these: none, gray, red, green, blue!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getButtonClass = require("./utils/getButton").rawButtonData
|
|
||||||
/**@param {getButtonClass} option */
|
|
||||||
const checkOption = (option,path) => {
|
|
||||||
|
|
||||||
//id
|
|
||||||
checkType(option.id,"string",path+"/id")
|
|
||||||
if (option.id.includes(" ")){
|
|
||||||
createError("'"+path+"/id' | option id can't contain space characters!")
|
|
||||||
}
|
|
||||||
if (option.id.length > 20){
|
|
||||||
createError("'"+path+"/id' | option id max lenght is 20!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//name
|
|
||||||
checkType(option.name,"string",path+"/name")
|
|
||||||
if (option.name.length > 100){
|
|
||||||
createWarn("'"+path+"/name' | if your name is too long it maybe doesn't look so good!")
|
|
||||||
}else if (option.name.length < 1){
|
|
||||||
createError("'"+path+"/name' | there is no name!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//description
|
|
||||||
checkType(option.description,"string",path+"/description")
|
|
||||||
|
|
||||||
//icon
|
|
||||||
const emojiRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi;
|
|
||||||
if (option.icon.length > 0){
|
|
||||||
|
|
||||||
const isEmoji = emojiRegex.test(option.icon)
|
|
||||||
|
|
||||||
if (isEmoji == false){
|
|
||||||
createError("'"+path+"/icon' | invalid emoji or custom discord emoji")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
checkType(option.icon,"string",path+"/icon")
|
|
||||||
|
|
||||||
//label
|
|
||||||
checkType(option.label,"string",path+"/label")
|
|
||||||
if (option.label.length < 1 && option.icon.length < 1){
|
|
||||||
createError("'"+path+"' | you need at least one of these: label, icon!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//type
|
|
||||||
checkType(option.type,"string",path+"/type")
|
|
||||||
if (option.type != "ticket" && option.type != "website" && option.type != "role"){
|
|
||||||
createError("'"+path+"/type' | the type must be one of these: ticket, website, role!")
|
|
||||||
}
|
|
||||||
/**@type {"ticket"|"website"|"role"} */
|
|
||||||
const type = option.type
|
|
||||||
|
|
||||||
if (type == "ticket"){
|
|
||||||
//color
|
|
||||||
checkType(option.color,"string",path+"/color")
|
|
||||||
checkButtonColor(option.color,path+"/color")
|
|
||||||
|
|
||||||
//adminroles
|
|
||||||
checkDiscordArray("roleid",option.adminroles,path+"/adminroles")
|
|
||||||
|
|
||||||
//channelprefix
|
|
||||||
checkType(option.channelprefix,"string",path+"/channelprefix")
|
|
||||||
if (option.channelprefix.includes(" ")){
|
|
||||||
createWarn("'"+path+"/channelprefix' | this prefix can't contain spaces!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//category
|
|
||||||
checkType(option.category,"string",path+"/category")
|
|
||||||
if (option.category.length > 0){
|
|
||||||
checkDiscord("categoryid",option.category,path+"/category")
|
|
||||||
}
|
|
||||||
|
|
||||||
//message
|
|
||||||
checkType(option.message,"string",path+"/message")
|
|
||||||
|
|
||||||
//enableDMmessage
|
|
||||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
|
||||||
|
|
||||||
//ticketmessage
|
|
||||||
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
|
||||||
|
|
||||||
}else if (type == "website"){
|
|
||||||
//url
|
|
||||||
checkType(option.url,"string",path+"/url")
|
|
||||||
if (option.url.includes(" ")){
|
|
||||||
createWarn("'"+path+"/url' | a url can't contain spaces")
|
|
||||||
}
|
|
||||||
if (option.url.length < 1){
|
|
||||||
createError("'"+path+"/url' | you have no url in this button")
|
|
||||||
}
|
|
||||||
if (!option.url.startsWith("https://") && !option.url.startsWith("http://") && !option.url.startsWith("discord://")){
|
|
||||||
createWarn("'"+path+"/url' | your url doesn't start with https or http!")
|
|
||||||
}
|
|
||||||
if (option.url.startsWith("http://")){
|
|
||||||
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord maybe blocks this url!")
|
|
||||||
}
|
|
||||||
}else if (type == "role"){
|
|
||||||
//color
|
|
||||||
checkType(option.color,"string",path+"/color")
|
|
||||||
checkButtonColor(option.color,path+"/color")
|
|
||||||
|
|
||||||
//roles
|
|
||||||
checkDiscordArray("roleid",option.roles,path+"/roles")
|
|
||||||
|
|
||||||
//mode
|
|
||||||
checkType(option.mode,"string",path+"/mode")
|
|
||||||
if (option.mode != "add&remove" && option.mode != "add" && option.mode != "remove"){
|
|
||||||
createError("'"+path+"/mode' | mode must be one of these: add, remove, add&remove")
|
|
||||||
}
|
|
||||||
|
|
||||||
//enableDMmessage
|
|
||||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const checkMessage = (input,path) => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------|
|
|
||||||
//--------------------------|
|
|
||||||
//checker => START HERE |
|
|
||||||
//--------------------------|
|
|
||||||
//--------------------------|
|
|
||||||
|
|
||||||
var configArray = ["main_color","server_id","auth_token","main_adminroles","prefix","languagefile","credits","status","system","options","messages"]
|
|
||||||
configArray.forEach((item) => {
|
|
||||||
if (config[item] == undefined){
|
|
||||||
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
checkHexColor(config.main_color,"main_color")
|
|
||||||
checkDiscord("serverid",config.server_id,"server_id")
|
|
||||||
checkToken(config.auth_token)
|
|
||||||
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
|
||||||
checkString(config.prefix,1,15,"prefix","prefix")
|
|
||||||
//languagefile
|
|
||||||
checkType(config.languagefile,"string","languagefile")
|
|
||||||
const lf = config.languagefile
|
|
||||||
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish")){
|
|
||||||
createError("'languagefile' | invalid language, more info in the wiki")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
checkType(config.credits,"boolean","credits")
|
|
||||||
//status:
|
|
||||||
checkType(config.status.enabled,"boolean","status/enabled")
|
|
||||||
if (config.status.enabled){
|
|
||||||
if (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING"){
|
|
||||||
createError("'status/type' | not a valid status type!")
|
|
||||||
}
|
|
||||||
if (config.status.text.length < 1 || config.status.text.length > 40){
|
|
||||||
createError("'status/text' | text too long or short!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//system:
|
|
||||||
if (config.system.ticket_channel){
|
|
||||||
if (config.system.ticket_channel.length < 16 || config.system.ticket_channel.length > 20 || !/^\d+$/.test(config.system.ticket_channel)){
|
|
||||||
createError("'system/ticket_channel' | this channel id is invalid")
|
|
||||||
}
|
|
||||||
}else createWarn("'"+path+"' | you have no ticket channel selected!")
|
|
||||||
checkType(config.system.max_allowed_tickets,"number","system/max_allowed_tickets")
|
|
||||||
checkType(config.system.enable_DM_Messages,"boolean","system/enable_DM_Messages")
|
|
||||||
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
|
||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
|
||||||
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
|
||||||
}else{
|
|
||||||
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
|
||||||
}
|
|
||||||
checkType(config.system.closeMode,"string","system/closeMode")
|
|
||||||
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
|
||||||
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
|
||||||
}
|
|
||||||
|
|
||||||
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
|
||||||
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
|
||||||
if (config.system.enable_transcript){
|
|
||||||
checkDiscord("channelid",config.system.transcript_channel,"system/transcript_channel")
|
|
||||||
}
|
|
||||||
|
|
||||||
//options
|
|
||||||
|
|
||||||
config.options.forEach((option,index) => {
|
|
||||||
checkOption(option,"options/"+index)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
//discord check
|
|
||||||
/**
|
|
||||||
const discord = require("discord.js")
|
|
||||||
const {GatewayIntentBits,Partials} = discord
|
|
||||||
const client = new discord.Client({
|
|
||||||
intents:[
|
|
||||||
GatewayIntentBits.DirectMessages,
|
|
||||||
GatewayIntentBits.GuildInvites,
|
|
||||||
GatewayIntentBits.GuildMembers,
|
|
||||||
GatewayIntentBits.GuildMessages,
|
|
||||||
GatewayIntentBits.Guilds,
|
|
||||||
GatewayIntentBits.MessageContent
|
|
||||||
],
|
|
||||||
partials:[Partials.Channel,Partials.Message]
|
|
||||||
})
|
|
||||||
await client.guilds.fetch()
|
|
||||||
if (!client.guilds.cache.find(g => g.id == config.server_id)){
|
|
||||||
createError("'server_id' | i'm not in a server with this id!")
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//the end
|
|
||||||
if (errorList.length > 0 || warnList.length > 0){
|
|
||||||
console.log("REPORT:\n===========================")
|
|
||||||
}
|
|
||||||
warnList.forEach((w) => {
|
|
||||||
const splitw = w.split("'")
|
|
||||||
if (splitw.length > 1){
|
|
||||||
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
|
|
||||||
}else {var splitstring = chalk.yellow(splitw[0])}
|
|
||||||
console.log(splitstring)
|
|
||||||
})
|
|
||||||
errorList.forEach((e) => {
|
|
||||||
const splite = e.split("'")
|
|
||||||
if (splite.length > 1){
|
|
||||||
var splitstring = chalk.red(splite[0])+chalk.blue("'"+splite[1]+"'")+chalk.red(splite[2])
|
|
||||||
}else {var splitstring = chalk.red(splite[0])}
|
|
||||||
console.log(splitstring)
|
|
||||||
})
|
|
||||||
if (isError){
|
|
||||||
console.log("===========================")
|
|
||||||
console.log("=> "+chalk.bgRed("your bot doesn't work if you don't fix the above errors!"))
|
|
||||||
if (isWarn){
|
|
||||||
console.log("\n=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
|
||||||
}
|
|
||||||
process.exit(0)
|
|
||||||
}else if (isWarn == true && isError == false){
|
|
||||||
console.log("===========================")
|
|
||||||
console.log("=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,331 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//closebar
|
|
||||||
var closeBar = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("closeTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("closeTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
var deleteBar = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
var deleteBar1 = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicketTrue1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicketFalse1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
//closebutton
|
|
||||||
var closeRowNormal = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("closeTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
var closeRowClosed = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("sendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Success)
|
|
||||||
.setLabel(l.buttons.reopen)
|
|
||||||
.setEmoji("✔")
|
|
||||||
)
|
|
||||||
|
|
||||||
var closeRowDisabled = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("closeTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
//NORMAL CLOSE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "closeTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[closeBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "closeTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[closeRowNormal]})
|
|
||||||
})
|
|
||||||
|
|
||||||
var closeTicketButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "closeTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (closeTicketButtonChecker == true) return
|
|
||||||
closeTicketButtonChecker = true
|
|
||||||
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
|
||||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
|
||||||
try {
|
|
||||||
return msg.member.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}catch{
|
|
||||||
return msg.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.message.edit({components:[closeRowDisabled]})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await require("./ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close")
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
|
|
||||||
var closeTicket1ButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "closeTicketTrue1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (closeTicket1ButtonChecker == true) return
|
|
||||||
closeTicket1ButtonChecker = true
|
|
||||||
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
|
||||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
|
||||||
try {
|
|
||||||
return interaction.member.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}catch{
|
|
||||||
return interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const closedButtonDisabled = new discord.ActionRowBuilder()
|
|
||||||
.addComponents([
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("closeTicketTrue1")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
])
|
|
||||||
interaction.message.edit({components:[closedButtonDisabled]})
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then((messages) => {
|
|
||||||
messages.first().edit({components:[closeRowDisabled]})
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await require("./ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close")
|
|
||||||
closeTicket1ButtonChecker = false
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
//NORMAL DELETE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "deleteTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[deleteBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "deleteTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[closeRowNormal]})
|
|
||||||
})
|
|
||||||
var deleteTicketButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "deleteTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (deleteTicketButtonChecker == true) return
|
|
||||||
deleteTicketButtonChecker = true
|
|
||||||
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
|
||||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
|
||||||
try {
|
|
||||||
return interaction.member.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}catch{
|
|
||||||
return interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await require("./ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete")
|
|
||||||
deleteTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//CLOSED DELETE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "deleteTicket1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[deleteBar1]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "deleteTicketFalse1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[closeRowClosed]})
|
|
||||||
})
|
|
||||||
|
|
||||||
var deleteTicket1ButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "deleteTicketTrue1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (deleteTicket1ButtonChecker == true) return
|
|
||||||
deleteTicket1ButtonChecker = true
|
|
||||||
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == interaction.guild.id).members.cache.find(m => m.id == interaction.member.id)
|
|
||||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
|
||||||
try {
|
|
||||||
return interaction.member.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}catch{
|
|
||||||
return interaction.channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await require("./ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"deletenotranscript")
|
|
||||||
deleteTicket1ButtonChecker = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
const fs = require('fs')
|
|
||||||
const readline = require("readline")
|
|
||||||
const rl = readline.createInterface({
|
|
||||||
input:process.stdin,
|
|
||||||
output:process.stdout,
|
|
||||||
terminal:true
|
|
||||||
})
|
|
||||||
|
|
||||||
const ask = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
rl.question(chalk.yellow("WARNING: are you sure that there are",chalk.red("no tickets open"),"at the moment? ")+chalk.green("(yes/no)")+"\n",(answer) => {
|
|
||||||
if (answer != "1" && !answer.toLowerCase().startsWith("yes")){
|
|
||||||
console.log(chalk.red("invalid answer"))
|
|
||||||
ask()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.log(chalk.green("clearing data..."))
|
|
||||||
runClear()
|
|
||||||
rl.close()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
ask()
|
|
||||||
|
|
||||||
const runClear = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
//console.log(chalk.blue("You can get a node.js warning below, just ignore that, it's not important!"))
|
|
||||||
const dataPaths = ["./storage/dynamicDB"]
|
|
||||||
|
|
||||||
var index = 0
|
|
||||||
|
|
||||||
dataPaths.forEach((path) => {
|
|
||||||
try {
|
|
||||||
fs.rmSync(path,{recursive:true,force:true})
|
|
||||||
}catch{
|
|
||||||
//console.log(path,"doesn't exist")
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
try{
|
|
||||||
fs.mkdirSync(path)
|
|
||||||
}catch{
|
|
||||||
//console.log(path,"already exists")
|
|
||||||
}
|
|
||||||
index++
|
|
||||||
},500)
|
|
||||||
})
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
if (index >= 1){
|
|
||||||
console.log(chalk.bgGreen("All local data is cleared!"))
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
},500)
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
const localstorage = require("node-localstorage")
|
|
||||||
|
|
||||||
const ls = new localstorage.LocalStorage("./storage/dynamicDB")
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} category
|
|
||||||
* @param {String} id
|
|
||||||
* @param {String} value
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.set = (category,id,value) => {
|
|
||||||
ls.setItem(category+"--"+id,value.toString())
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} category
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {String|false}
|
|
||||||
*/
|
|
||||||
exports.get = (category,id) => {
|
|
||||||
const result = ls.getItem(category+"--"+id)
|
|
||||||
if (!result) return false
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} category
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.delete = (category,id) => {
|
|
||||||
ls.removeItem(category+"--"+id)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
//Do not change this without knowing what you are doing!!
|
|
||||||
const databaseFile = "local"
|
|
||||||
//Do not change this without knowing what you are doing!!
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
var db = require("./dynamicfiles/local")
|
|
||||||
}catch{
|
|
||||||
console.log("I couldn't find the database file! (location: ./core/dynamicdatabase/storage.js:2)")
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = db
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
const loadChalk = async () => {
|
|
||||||
return await (await import("chalk")).default
|
|
||||||
}
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const c = discord.Colors
|
|
||||||
|
|
||||||
exports.noPermsMessage = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
|
||||||
.setDescription(l.errors.noPermsDescription)
|
|
||||||
|
|
||||||
exports.noPermsDelete = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
|
||||||
.setDescription(l.errors.noPermsDelete)
|
|
||||||
|
|
||||||
/**@param {String} message */
|
|
||||||
exports.invalidArgsMessage = (message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.missingArgsTitle)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message */
|
|
||||||
exports.serverError = (message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Orange)
|
|
||||||
.setTitle(":warning: "+l.errors.boterror)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String[]} list */
|
|
||||||
exports.invalidIdChooseFromList = (list) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.chooseFromListTitle)
|
|
||||||
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.notInATicket = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.notInTicketTitle)
|
|
||||||
.setDescription(l.errors.notInTicketDescription)
|
|
||||||
|
|
||||||
|
|
||||||
/**@param {String} message @param {String} title */
|
|
||||||
exports.success = (title,message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(":white_check_mark: "+title)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message @param {String} title */
|
|
||||||
exports.warning = (title,message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Orange)
|
|
||||||
.setTitle(":warning: "+title)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message the message @param {String} title the title @param {String} emoji an discord emoji @param {discord.ColorResolvable} color the embed color*/
|
|
||||||
exports.custom = (title,message,emoji,color) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(color)
|
|
||||||
.setTitle(emoji+" "+title)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
const normalLog = (debugString) => {
|
|
||||||
const fs = require("fs")
|
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {"system"|"command"|"info"|"api"} type
|
|
||||||
* @param {String} message
|
|
||||||
* @param {[{key:String,value:String}]} params
|
|
||||||
*/
|
|
||||||
exports.log = async (type,message,params) => {
|
|
||||||
var ptype = type
|
|
||||||
const chalk = await loadChalk()
|
|
||||||
var paramstring = ""
|
|
||||||
if (params){
|
|
||||||
if (params.length > 0){
|
|
||||||
params.forEach((p) => {
|
|
||||||
paramstring = paramstring+p.key+": "+p.value+" "
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const parameters = params ? "("+paramstring+")" : " "
|
|
||||||
|
|
||||||
if (ptype == "command"){
|
|
||||||
console.log(chalk.green("[command] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}else if (ptype == "info"){
|
|
||||||
console.log(chalk.blue("[info] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}else if (ptype == "system"){
|
|
||||||
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}else if (ptype == "api"){
|
|
||||||
if (require("./api/modules/base").enableApiLogs == true){
|
|
||||||
console.log(chalk.red("[api v"+require("./api/api.json").version+"] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}
|
|
||||||
ptype = "api v"+require("./api/api.json").version
|
|
||||||
}
|
|
||||||
|
|
||||||
const cd = new Date()
|
|
||||||
const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
|
||||||
normalLog("["+cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getSeconds()+":"+cd.getMinutes()+":"+cd.getHours()+"] ["+ptype+"] "+message+" "+parameters)
|
|
||||||
}
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
const bot = require("../index")
|
|
||||||
const config = bot.config
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Number} index
|
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"|"ticketmessage"} value
|
|
||||||
*/
|
|
||||||
exports.getTicketValue = (index,value) => {
|
|
||||||
if (value == "id"){
|
|
||||||
return "OTnewT"+config.options[index][value]
|
|
||||||
}
|
|
||||||
return config.options[index][value]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Number} index
|
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} value
|
|
||||||
*/
|
|
||||||
exports.getWebsiteValue = (index,value) => {
|
|
||||||
return config.options[index][value]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Number} index
|
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDMMessage"} value
|
|
||||||
*/
|
|
||||||
exports.getRoleValue = (index,value) => {
|
|
||||||
return config.options[index][value]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDMMessage"|"ticketmessage"} value
|
|
||||||
*/
|
|
||||||
exports.getTicketValues = (value) => {
|
|
||||||
var result = []
|
|
||||||
config.options.forEach((o) => {
|
|
||||||
if (value == "id"){
|
|
||||||
result.push("OTnewT"+o[value])
|
|
||||||
}else{
|
|
||||||
result.push(o[value])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} value
|
|
||||||
*/
|
|
||||||
exports.getWebsiteValues = (value) => {
|
|
||||||
var result = []
|
|
||||||
config.options.forEach((o) => {
|
|
||||||
result.push(o[value])
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDMMessage""} value
|
|
||||||
*/
|
|
||||||
exports.getRoleValues = (value) => {
|
|
||||||
var result = []
|
|
||||||
config.options.forEach((o) => {
|
|
||||||
result.push(o[value])
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
class TicketOptions {
|
|
||||||
constructor() {
|
|
||||||
this.id = ""
|
|
||||||
this.name = ""
|
|
||||||
this.description = ""
|
|
||||||
this.icon = ""
|
|
||||||
this.label = ""
|
|
||||||
this.type = ""
|
|
||||||
this.color = ""
|
|
||||||
this.adminroles = ["",""]
|
|
||||||
this.channelprefix = ""
|
|
||||||
this.category = ""
|
|
||||||
this.message = ""
|
|
||||||
this.enableDMMessage = true
|
|
||||||
this.ticketmessage = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {TicketOptions|false}
|
|
||||||
*/
|
|
||||||
exports.getOptionsById = (id) => {
|
|
||||||
var result = false
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if ("OTnewT"+option.id == id){
|
|
||||||
result = option
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.exportedOptionClass = class {
|
|
||||||
constructor() {
|
|
||||||
this.id = ""
|
|
||||||
this.name = ""
|
|
||||||
this.description = ""
|
|
||||||
this.icon = ""
|
|
||||||
this.label = ""
|
|
||||||
this.type = ""
|
|
||||||
this.color = ""
|
|
||||||
this.adminroles = ["",""]
|
|
||||||
this.channelprefix = ""
|
|
||||||
this.category = ""
|
|
||||||
this.message = ""
|
|
||||||
this.enableDMMessage = true
|
|
||||||
this.ticketmessage = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
exports.closeCommandRow = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTsendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTreopenTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Success)
|
|
||||||
.setLabel(l.buttons.reopen)
|
|
||||||
.setEmoji("✔")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.openRowNormal = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.openRowDisabled = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
exports.firstmsgRowNormal = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.firstmsgRowDisabled = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
exports.closeVerifyBar = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.deleteVerifyBar = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.delete1VerifyBar = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketTrue1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketFalse1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} addedUser
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.addEmbed = (addedUser) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("⬆️ "+l.commands.userAddedTitle.replace("{0}",addedUser.username))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:addedUser.tag,iconURL:addedUser.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} removedUser
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.removeEmbed = (removedUser) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("⬇️ "+l.commands.userRemovedTitle.replace("{0}",removedUser.username))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:removedUser.tag,iconURL:removedUser.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} closer
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.closeEmbed = (closer) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("🔒 "+l.commands.closeTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:closer.tag,iconURL:closer.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} deleter
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.deleteEmbed = (deleter) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("❌ "+l.commands.deleteTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:deleter.tag,iconURL:deleter.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} renamer
|
|
||||||
* @param {String} newname
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.renameEmbed = (renamer,newname) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("🔄 "+l.commands.renameTitle.replace("{0}",newname))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:renamer.tag,iconURL:renamer.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} reopener
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.reopenEmbed = (reopener) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("🔓 "+l.commands.reopenTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:reopener.tag,iconURL:reopener.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {Boolean} done
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.User} author
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.sendTranscriptEmbed = (done,channel,author) => {
|
|
||||||
if (done){
|
|
||||||
return new embed()
|
|
||||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
|
||||||
.setColor(mc)
|
|
||||||
.setDescription("Ticket: "+channel.name)
|
|
||||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
|
||||||
}else{
|
|
||||||
return new embed()
|
|
||||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
|
||||||
.setColor(mc)
|
|
||||||
.setDescription("Loading...")
|
|
||||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../../getoptions")
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//CLOSE
|
|
||||||
var closeTicketButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (closeTicketButtonChecker == true) return
|
|
||||||
closeTicketButtonChecker = true
|
|
||||||
|
|
||||||
const firstcomponents = interaction.message.components
|
|
||||||
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoPerms(interaction.channel)
|
|
||||||
}
|
|
||||||
interaction.message.edit({components:[firstcomponents]})
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
await require("../../../ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../../getoptions")
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//DELETE
|
|
||||||
var deleteTicketButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (deleteTicketButtonChecker == true) return
|
|
||||||
deleteTicketButtonChecker = true
|
|
||||||
|
|
||||||
const firstcomponents = bot.buttons.close.openRowNormal
|
|
||||||
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoDelete(interaction.channel)
|
|
||||||
}
|
|
||||||
await interaction.message.edit({components:[firstcomponents]})
|
|
||||||
deleteTicketButtonChecker = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
await interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
|
||||||
await require("../../../ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
|
||||||
deleteTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
|
|
||||||
//DELETE NO TRANSCRIPT
|
|
||||||
var deleteTicketButtonChecker1 = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketTrue1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (deleteTicketButtonChecker1 == true) return
|
|
||||||
deleteTicketButtonChecker1 = true
|
|
||||||
|
|
||||||
const firstcomponents = bot.buttons.close.closeCommandRow
|
|
||||||
|
|
||||||
console.log("closed with NO TRANSCRIPT")
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoDelete(interaction.channel)
|
|
||||||
}
|
|
||||||
await interaction.message.edit({components:[firstcomponents]})
|
|
||||||
deleteTicketButtonChecker1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
await require("../../../ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"deletenotranscript",false,true)
|
|
||||||
deleteTicketButtonChecker1 = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../../getoptions")
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//REOPEN
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTreopenTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
|
||||||
require("../../../ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
module.exports = () => {
|
|
||||||
require("./firstmsg")()
|
|
||||||
require("./sendTranscript")()
|
|
||||||
require("./verifyBars")()
|
|
||||||
|
|
||||||
//accepted
|
|
||||||
require("./accepted/closing")()
|
|
||||||
require("./accepted/reopening")()
|
|
||||||
require("./accepted/deleting")()
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTsendTranscript") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
const tsmsg = await interaction.channel.send({embeds:[bot.embeds.commands.sendTranscriptEmbed(false,interaction.channel,interaction.user)]})
|
|
||||||
|
|
||||||
const channelmessages = await interaction.channel.messages.fetch()
|
|
||||||
|
|
||||||
channelmessages.sweep((msgSweep) => {
|
|
||||||
return msgSweep.author.id == client.user.id
|
|
||||||
})
|
|
||||||
|
|
||||||
var fileattachment = await require("../../transcript").createTranscript(channelmessages,interaction.channel)
|
|
||||||
|
|
||||||
if (fileattachment == false){
|
|
||||||
log("system","internal error: transcript is not created!")
|
|
||||||
tsmsg.edit({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrongTranscript)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
tsmsg.edit({embeds:[bot.embeds.commands.sendTranscriptEmbed(true,interaction.channel,interaction.user)],files:[fileattachment]})
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//CLOSE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
|
||||||
})
|
|
||||||
|
|
||||||
//DELETE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
|
||||||
})
|
|
||||||
|
|
||||||
//DELETE NO TRANSCRIPT
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicket1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketFalse1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
const index = require("../index")
|
|
||||||
|
|
||||||
if (index.developerMode){
|
|
||||||
var config = require("../devConfig.json")
|
|
||||||
}else{var config = require("../config.json")}
|
|
||||||
|
|
||||||
|
|
||||||
var localLanguage = require("../language/english.json")
|
|
||||||
if (config.languagefile.startsWith("custom")) localLanguage = require("../language/custom.json")
|
|
||||||
else if (config.languagefile.startsWith("dutch")) localLanguage = require("../language/dutch.json")
|
|
||||||
else if (config.languagefile.startsWith("english")) localLanguage = require("../language/english.json")
|
|
||||||
else if (config.languagefile.startsWith("german")) localLanguage = require("../language/german.json")
|
|
||||||
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
|
||||||
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
|
||||||
else if (config.languagefile.startsWith("arabic")) localLanguage = require("../language/arabic.json")
|
|
||||||
else if (config.languagefile.startsWith("spanish")) localLanguage = require("../language/spanish.json")
|
|
||||||
|
|
||||||
const errorLog = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
console.log(chalk.red("Something went wrong when loading the language!")+"\nCheck the config file or create a ticket in our server!")
|
|
||||||
}
|
|
||||||
|
|
||||||
const successLog = async (language) => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
console.log(chalk.green("loaded language "+language+"..."))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!localLanguage){
|
|
||||||
const runError = async () => {
|
|
||||||
await errorLog()
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
runError()
|
|
||||||
}else{
|
|
||||||
exports.language = localLanguage
|
|
||||||
successLog(config.languagefile)
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
const APIEvents = require("./api/modules/events")
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (!interaction.customId.startsWith("newR")) return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (interaction.customId.startsWith("newR")){
|
|
||||||
const optionid = interaction.customId.split("newR")[1]
|
|
||||||
if (!optionid){
|
|
||||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.roleDoesntExist)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
const option = require("./utils/getButton").getOption(optionid)
|
|
||||||
/**@type {"add"|"remove"|"add&remove"} */
|
|
||||||
const mode = option.mode
|
|
||||||
const user = interaction.member
|
|
||||||
|
|
||||||
if (mode == "add"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
|
||||||
|
|
||||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("add","add",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
}else if (mode == "remove"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
|
||||||
|
|
||||||
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("remove","remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
}else if (mode == "add&remove"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
if (interaction.guild.members.cache.find(u => u.id == user.id).roles.cache.has(role)){
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
|
||||||
|
|
||||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("add","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
}else {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
|
||||||
|
|
||||||
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("remove","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}catch{
|
|
||||||
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrong)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const client = require("../../index").client
|
|
||||||
const config = bot.config
|
|
||||||
const getoptions = require("../getoptions")
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = (await import("chalk")).default
|
|
||||||
|
|
||||||
console.log(chalk.red("\nINSTRUCTIONS:\n\n1: Run the command you want to delete in discord.\n2: You get the message 'This command is now deleted!'\n3: There is also a message in the console that says the command is deleted.\n4: reload your discord."))
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return console.log("this isn't a command!")
|
|
||||||
|
|
||||||
interaction.reply({content:"This command is now deleted!"})
|
|
||||||
|
|
||||||
try {
|
|
||||||
client.application.commands.delete(interaction.commandId,interaction.guild.id).then(() => {
|
|
||||||
console.log("deleted the command",chalk.blue(interaction.commandName),"(id:",interaction.commandId+")")
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
console.log(chalk.red("something went wrong by the deleting of this command!"))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const client = require("../../index").client
|
|
||||||
const config = bot.config
|
|
||||||
const getoptions = require("../getoptions")
|
|
||||||
|
|
||||||
const act = discord.ApplicationCommandType
|
|
||||||
const acot = discord.ApplicationCommandOptionType
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = (await import("chalk")).default
|
|
||||||
const sid = config.server_id
|
|
||||||
|
|
||||||
const ids = getoptions.getTicketValues("id")
|
|
||||||
/**@type {[{name:String,value:String}]} */
|
|
||||||
var choices = []
|
|
||||||
ids.forEach((id) => {
|
|
||||||
const option = getoptions.getOptionsById(id)
|
|
||||||
if (option.type == "ticket"){
|
|
||||||
choices.push({name:option.name,value:option.id})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
/**@type {[{name:String,value:String}]} */
|
|
||||||
var msgchoices = []
|
|
||||||
config.messages.forEach((msg) => {
|
|
||||||
msgchoices.push({name:msg.id,value:msg.id})
|
|
||||||
})
|
|
||||||
|
|
||||||
var readystats = 0
|
|
||||||
|
|
||||||
//process.stdout.write("[status] there are "+chalk.blue("0 out of 10")+" commands ready! (this can take up to 40 seconds)")
|
|
||||||
setInterval(() => {
|
|
||||||
process.stdout.cursorTo(0)
|
|
||||||
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 10")+" commands ready! (this can take up to 40 seconds)")
|
|
||||||
if (readystats >= 10){
|
|
||||||
console.log(chalk.green("\nready!"))
|
|
||||||
console.log(chalk.bgBlue("you can now start the bot with 'npm start'!"))
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
},100)
|
|
||||||
|
|
||||||
//create a ticket (/new or /ticket)
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"ticket",
|
|
||||||
description:"Create a ticket!",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"type",
|
|
||||||
description:"The type of ticket.",
|
|
||||||
required:true,
|
|
||||||
choices:choices
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"new",
|
|
||||||
description:"Create a ticket!",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"type",
|
|
||||||
description:"The type of ticket.",
|
|
||||||
required:true,
|
|
||||||
choices:choices
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//help
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"help",
|
|
||||||
description:"The help menu",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
//close
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"close",
|
|
||||||
description:"Close the current ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//delete
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"delete",
|
|
||||||
description:"Delete the current ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//msg
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"message",
|
|
||||||
description:"Create a ticket message.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"id",
|
|
||||||
description:"The message id.",
|
|
||||||
required:true,
|
|
||||||
choices:msgchoices,
|
|
||||||
max_length:30
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//add
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"add",
|
|
||||||
description:"Add people to this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.User,
|
|
||||||
name:"user",
|
|
||||||
description:"The user to add.",
|
|
||||||
required:true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//remove
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"remove",
|
|
||||||
description:"Remove people from this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.User,
|
|
||||||
name:"user",
|
|
||||||
description:"The user to remove.",
|
|
||||||
required:true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//rename
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"rename",
|
|
||||||
description:"Rename this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"name",
|
|
||||||
description:"The new name (without prefix).",
|
|
||||||
required:true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//reopen
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"reopen",
|
|
||||||
description:"Reopen this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,346 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
const permsChecker = require("./utils/permisssionChecker")
|
|
||||||
|
|
||||||
exports.runThis = () => {
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "sendTranscript") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
const channelmessages = await interaction.channel.messages.fetch()
|
|
||||||
|
|
||||||
channelmessages.sweep((msgSweep) => {
|
|
||||||
return msgSweep.author.id == client.user.id
|
|
||||||
})
|
|
||||||
|
|
||||||
var fileattachment = await require("./transcript").createTranscript(channelmessages,interaction.channel)
|
|
||||||
|
|
||||||
if (fileattachment == false){
|
|
||||||
log("system","internal error: transcript is not created!")
|
|
||||||
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrongTranscript)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.send({content:"**"+l.messages.hereIsTheTranscript+"**",files:[fileattachment]})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.GuildMember} member
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {String} prefix
|
|
||||||
* @param {"delete"|"close"|"deletenotranscript"} mode
|
|
||||||
* @param {Boolean} nomessage
|
|
||||||
* @param {String} reason only when closing, not when deleting!
|
|
||||||
*/
|
|
||||||
exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) => {
|
|
||||||
const guild = channel.guild
|
|
||||||
const user = member.user
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
const channelmessages = await channel.messages.fetch()
|
|
||||||
|
|
||||||
const newReason = reason ? reason : "none"
|
|
||||||
|
|
||||||
//start code
|
|
||||||
|
|
||||||
//remove ot bot from transcript
|
|
||||||
channelmessages.sweep((msgSweep) => {return msgSweep.author.id == client.user.id})
|
|
||||||
|
|
||||||
/**@type {String}*/
|
|
||||||
const channelname = channel.name
|
|
||||||
const ticketOpenerChannelName = channelname.split(prefix)[1]
|
|
||||||
|
|
||||||
//get user that opened the ticket
|
|
||||||
var getuserID = storage.get("userTicketStorage",channel.id)
|
|
||||||
try {
|
|
||||||
var ticketOpener = client.users.cache.find(u => u.id === getuserID)
|
|
||||||
var isDatabaseError = false
|
|
||||||
}catch{var isDatabaseError = true}
|
|
||||||
|
|
||||||
if (!ticketOpener){
|
|
||||||
console.log(chalk.red("[database error]"),"something went wrong when getting the data in the database.\nNo panic, this error fixes itself!")
|
|
||||||
var isDatabaseError = true
|
|
||||||
}
|
|
||||||
|
|
||||||
var enableTranscript = true
|
|
||||||
var deleteRequired = false
|
|
||||||
|
|
||||||
if (mode == "delete"){
|
|
||||||
//delete
|
|
||||||
//check perms
|
|
||||||
if (!guild) return
|
|
||||||
if (!permsChecker.command(user.id,guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//start delete proccess
|
|
||||||
deleteRequired = true
|
|
||||||
if (!nomessage){
|
|
||||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
|
||||||
}
|
|
||||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
|
||||||
|
|
||||||
//getID & send DM & send api event
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value.value
|
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
|
|
||||||
require("./api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
if (!id) return false
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
|
|
||||||
}else if (mode == "close"){
|
|
||||||
//close
|
|
||||||
//check perms
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
if (!guild) return
|
|
||||||
if (!permsChecker.command(user.id,guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//set new permissions
|
|
||||||
var permissionArray = []
|
|
||||||
const pfb = discord.PermissionFlagsBits
|
|
||||||
|
|
||||||
if (!isDatabaseError) permissionArray.push({
|
|
||||||
id:ticketOpener,
|
|
||||||
type:"member",
|
|
||||||
allow:[pfb.ViewChannel],
|
|
||||||
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
|
||||||
})
|
|
||||||
|
|
||||||
permissionArray.push({
|
|
||||||
id:guild.roles.everyone,
|
|
||||||
type:"role",
|
|
||||||
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
|
|
||||||
//add main adminroles
|
|
||||||
config.main_adminroles.forEach((role,index) => {
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//add ticket adminroles
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
|
|
||||||
if (!ticketData) return
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String[]}
|
|
||||||
*/
|
|
||||||
const ticketadmin = ticketData.adminroles
|
|
||||||
ticketadmin.forEach((role,index) => {
|
|
||||||
if (!config.main_adminroles.includes(role)){
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.ViewChannel],
|
|
||||||
deny:[pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.permissionOverwrites.set(permissionArray)
|
|
||||||
|
|
||||||
if (!nomessage){
|
|
||||||
//message
|
|
||||||
var closeButtonRow = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTdeleteTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTsendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTreopenTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Success)
|
|
||||||
.setLabel(l.buttons.reopen)
|
|
||||||
.setEmoji("✔")
|
|
||||||
)
|
|
||||||
|
|
||||||
const embed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
|
||||||
.setDescription(l.messages.closedDescription)
|
|
||||||
channel.send({embeds:[embed],components:[closeButtonRow]})
|
|
||||||
}
|
|
||||||
|
|
||||||
log("system","closed a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
|
||||||
|
|
||||||
|
|
||||||
//getID & send DM & send api event
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
|
|
||||||
require("./api/modules/events").onTicketClose(user,channel,guild,new Date(),{name:channel.name,status:"closed",ticketOptions:ticketData},newReason)
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
if (!id) return false
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
member.send({embeds:[bot.errorLog.custom(l.messages.closedTicketDmTitle,l.messages.closedTicketDmDescription+"\n\n**reason:** "+newReason,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}else if (mode == "deletenotranscript"){
|
|
||||||
//delete with no transcript
|
|
||||||
//check perms
|
|
||||||
if (!guild) return
|
|
||||||
if (!permsChecker.command(user.id,guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//start delete proccess
|
|
||||||
enableTranscript = false
|
|
||||||
deleteRequired = true
|
|
||||||
if (!nomessage){
|
|
||||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
|
||||||
}
|
|
||||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
|
||||||
|
|
||||||
//getID & send DM & send api event
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
|
||||||
|
|
||||||
require("./api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
if (!id) return false
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (enableTranscript == true && mode != "deletenotranscript"){
|
|
||||||
|
|
||||||
const transcriptReason = (mode == "close") ? "**reason:** "+newReason : "**reason:** none"
|
|
||||||
|
|
||||||
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
|
||||||
var fileattachment = await require("./transcript").createTranscript(channelmessages,channel)
|
|
||||||
|
|
||||||
if (fileattachment == false){log("system","internal error: transcript is not created!");return}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.system.enable_transcript){
|
|
||||||
const transcriptEmbed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
|
||||||
.setDescription(transcriptReason)
|
|
||||||
.setFooter({text:"closed by: "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
|
||||||
|
|
||||||
guild.channels.cache.find(c => c.id == config.system.transcript_channel).send({
|
|
||||||
embeds:[transcriptEmbed],
|
|
||||||
files:[fileattachment]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.system.enable_DM_transcript){
|
|
||||||
const transcriptEmbed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
|
||||||
.setDescription(transcriptReason)
|
|
||||||
.setFooter({text:"closed by: "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
|
||||||
|
|
||||||
if (!isDatabaseError) ticketOpener.send({
|
|
||||||
embeds:[transcriptEmbed],
|
|
||||||
files:[fileattachment]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deleteRequired){
|
|
||||||
//const timer = () => {return new Promise((resolve,reject) => {
|
|
||||||
// setTimeout(() => {resolve(true)},7000)
|
|
||||||
//})}
|
|
||||||
//await timer()
|
|
||||||
|
|
||||||
setTimeout(async () => {
|
|
||||||
await channel.delete()
|
|
||||||
},6000)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const getButton = require("./utils/getButton")
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id the id from an open-ticket embed
|
|
||||||
* @returns {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}} discord embed
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exports.createEmbed = (id) => {
|
|
||||||
//-----------------------------------
|
|
||||||
//general importing
|
|
||||||
const data = require("./utils/getTicketMessages").getTicketMessage(id)
|
|
||||||
/**@type {discord.ButtonBuilder[]}*/
|
|
||||||
var buttons = []
|
|
||||||
/**@type {getButton.rawButtonData[]} */
|
|
||||||
var buttonData = []
|
|
||||||
|
|
||||||
data.options.forEach((option) => {
|
|
||||||
var button = getButton.getButton(option)
|
|
||||||
var localButtonData = getButton.getOption(option)
|
|
||||||
if (button) buttons.push(button)
|
|
||||||
if (localButtonData) buttonData.push(localButtonData)
|
|
||||||
})
|
|
||||||
//-----------------------------------
|
|
||||||
|
|
||||||
//-----------------------------------
|
|
||||||
//create the embed
|
|
||||||
const embed = new discord.EmbedBuilder()
|
|
||||||
.setTitle(data.name)
|
|
||||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
|
||||||
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
|
||||||
|
|
||||||
if (data.enableCustomColor){
|
|
||||||
embed.setColor(data.color)
|
|
||||||
}else{
|
|
||||||
embed.setColor(config.main_color)
|
|
||||||
}
|
|
||||||
|
|
||||||
var description = data.description
|
|
||||||
if (data.enableTicketExplaination){
|
|
||||||
description = description+"\n\n__"+l.messages.chooseCategory+"__\n"
|
|
||||||
|
|
||||||
var ticketExplainations = []
|
|
||||||
buttonData.forEach((button) => {
|
|
||||||
var explaination = button.icon+" **"+button.name+":**\n"+button.description
|
|
||||||
ticketExplainations.push(explaination)
|
|
||||||
})
|
|
||||||
|
|
||||||
description = description+ticketExplainations.join("\n\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.enableMaxTicketsWarning){
|
|
||||||
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
|
||||||
}
|
|
||||||
|
|
||||||
embed.setDescription(description)
|
|
||||||
//-----------------------------------
|
|
||||||
|
|
||||||
//-----------------------------------
|
|
||||||
//create the components
|
|
||||||
var AmountOfRows = Math.ceil(buttons.length / 4)
|
|
||||||
var currentRow = 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {discord.MessageActionRow[]}
|
|
||||||
*/
|
|
||||||
var componentRows = []
|
|
||||||
|
|
||||||
for (let i = AmountOfRows; i > 0; i--){
|
|
||||||
|
|
||||||
componentRows.push(new discord.ActionRowBuilder())
|
|
||||||
}
|
|
||||||
|
|
||||||
buttons.forEach((button,index) => {
|
|
||||||
componentRows[currentRow].addComponents([button])
|
|
||||||
|
|
||||||
if (index == 3 || index == 7 || index == 11 || index == 15 || index == 19 || index == 23 || index == 27 || index == 31 || index == 35 || index == 39){
|
|
||||||
currentRow = currentRow + 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
//-----------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//return everything
|
|
||||||
/**
|
|
||||||
* @type {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}}
|
|
||||||
*/
|
|
||||||
const returnedData = {embed:embed,componentRows:componentRows}
|
|
||||||
return returnedData
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const getconfigoptions = require("./getoptions")
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
var closeButton = bot.buttons.firstmsg.firstmsgRowNormal
|
|
||||||
|
|
||||||
//ticket button click / create ticket
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
|
||||||
var customId = "OTnewT"+interaction.options.getString("type")
|
|
||||||
}else if (interaction.isButton()){
|
|
||||||
var customId = interaction.customId
|
|
||||||
}else return
|
|
||||||
|
|
||||||
if (interaction.isButton()){
|
|
||||||
if (interaction.customId.startsWith("OTnewT")){
|
|
||||||
const optionid = interaction.customId.split("OTnewT")[1]
|
|
||||||
if (!optionid){
|
|
||||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
|
||||||
|
|
||||||
//ticketoptions from config
|
|
||||||
const currentTicketOptions = getconfigoptions.getOptionsById(customId)
|
|
||||||
|
|
||||||
if (currentTicketOptions == false || currentTicketOptions.type != "ticket") return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
|
||||||
|
|
||||||
if (interaction.isButton()){
|
|
||||||
interaction.deferUpdate()
|
|
||||||
}else if (interaction.isChatInputCommand()){
|
|
||||||
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (storage.get("ticketStorage",interaction.member.id) == null || storage.get("ticketStorage",interaction.member.id) == "false"|| Number(storage.get("ticketStorage",interaction.member.id)) < config.system.max_allowed_tickets){
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
|
|
||||||
|
|
||||||
//update storage
|
|
||||||
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
|
||||||
var ticketNumber = interaction.member.user.username
|
|
||||||
|
|
||||||
//set ticketName
|
|
||||||
var ticketName = currentTicketOptions.channelprefix+ticketNumber
|
|
||||||
var logsname = currentTicketOptions.name
|
|
||||||
|
|
||||||
//category
|
|
||||||
if (currentTicketOptions.category.length < 16 || currentTicketOptions.category.length > 20){
|
|
||||||
var newTicketCategory = null
|
|
||||||
}else{
|
|
||||||
var newTicketCategory = currentTicketOptions.category
|
|
||||||
}
|
|
||||||
|
|
||||||
var permissionsArray = []
|
|
||||||
const pfb = discord.PermissionFlagsBits
|
|
||||||
const guild = client.guilds.cache.find(g => g.id == interaction.guild.id)
|
|
||||||
|
|
||||||
//set everyone allowed
|
|
||||||
if (config.system['has@everyoneaccess']){
|
|
||||||
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
var everyoneDenyPerms = []
|
|
||||||
}else{
|
|
||||||
var everyoneAllowPerms = []
|
|
||||||
var everyoneDenyPerms = [pfb.ViewChannel]
|
|
||||||
}
|
|
||||||
permissionsArray.push({
|
|
||||||
id:interaction.guild.roles.everyone,
|
|
||||||
type:"role",
|
|
||||||
allow:everyoneAllowPerms,
|
|
||||||
deny:everyoneDenyPerms
|
|
||||||
})
|
|
||||||
|
|
||||||
//add the user that created the ticket
|
|
||||||
permissionsArray.push({
|
|
||||||
id:interaction.member.user,
|
|
||||||
type:"member",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
|
|
||||||
//add main adminroles
|
|
||||||
config.main_adminroles.forEach((role,index) => {
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionsArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//add ticket adminroles
|
|
||||||
/**
|
|
||||||
* @type {String[]}
|
|
||||||
*/
|
|
||||||
const ticketadmin = currentTicketOptions.adminroles
|
|
||||||
ticketadmin.forEach((role,index) => {
|
|
||||||
if (!config.main_adminroles.includes(role)){
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionsArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//add member role
|
|
||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
|
||||||
try {
|
|
||||||
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
|
||||||
if (!userrole) return
|
|
||||||
permissionsArray.push({
|
|
||||||
id:userrole,
|
|
||||||
type:"role",
|
|
||||||
deny:[pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => system/member_role")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//create the channel
|
|
||||||
interaction.guild.channels.create({
|
|
||||||
name:ticketName,
|
|
||||||
type:discord.ChannelType.GuildText,
|
|
||||||
parent:newTicketCategory,
|
|
||||||
reason:"A new ticket is created",
|
|
||||||
permissionOverwrites:permissionsArray
|
|
||||||
|
|
||||||
}).then((ticketChannel) => {
|
|
||||||
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData.writeHiddenData("ticketdata",[{key:"type",value:currentTicketOptions.id},{key:"openerid",value:interaction.user.id},{key:"createdms",value:new Date().getTime()}])
|
|
||||||
|
|
||||||
var ticketEmbed = new discord.EmbedBuilder()
|
|
||||||
//.setAuthor({name:interaction.user.id})
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(currentTicketOptions.name)
|
|
||||||
//.setFooter({text:"Ticket Type: "+currentTicketOptions.id})
|
|
||||||
if (currentTicketOptions.ticketmessage.length > 0){
|
|
||||||
ticketEmbed.setDescription(currentTicketOptions.ticketmessage+hiddendata)
|
|
||||||
}else{
|
|
||||||
ticketEmbed.setDescription(hiddendata)
|
|
||||||
}
|
|
||||||
|
|
||||||
ticketChannel.send({
|
|
||||||
content:"<@"+interaction.member.id+"> @here",
|
|
||||||
embeds:[ticketEmbed],
|
|
||||||
components:[closeButton]
|
|
||||||
|
|
||||||
}).then(firstmsg => {
|
|
||||||
firstmsg.pin()
|
|
||||||
})
|
|
||||||
|
|
||||||
log("system","created new ticket",[{key:"ticket",value:ticketName},{key:"user",value:interaction.user.tag}])
|
|
||||||
require("./api/modules/events").onTicketOpen(interaction.user,ticketChannel,interaction.guild,new Date(),{name:ticketName,status:"open",ticketOptions:currentTicketOptions})
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
try {
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send({embeds:[bot.errorLog.warning(l.errors.maxAmountTitle,l.errors.maxAmountDescription)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,214 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
const pfb = discord.PermissionFlagsBits
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {discord.TextBasedChannel} channel
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const reopenTicket = (guild,channel,user) => {
|
|
||||||
log("system","re-opened a ticket",[{key:"ticket",value:channel.name},{key:"user",value:user.tag}])
|
|
||||||
|
|
||||||
var permissionsArray = []
|
|
||||||
|
|
||||||
//set everyone allowed
|
|
||||||
if (config.system['has@everyoneaccess']){
|
|
||||||
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
var everyoneDenyPerms = []
|
|
||||||
}else{
|
|
||||||
var everyoneAllowPerms = []
|
|
||||||
var everyoneDenyPerms = [pfb.ViewChannel]
|
|
||||||
}
|
|
||||||
permissionsArray.push({
|
|
||||||
id:guild.roles.everyone,
|
|
||||||
type:"role",
|
|
||||||
allow:everyoneAllowPerms,
|
|
||||||
deny:everyoneDenyPerms
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.permissionOverwrites.cache.forEach((p) => {
|
|
||||||
if (p.type == 1){
|
|
||||||
permissionsArray.push({
|
|
||||||
id:p.id,
|
|
||||||
type:"member",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel],
|
|
||||||
deny:[]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.permissionOverwrites.set(permissionsArray)
|
|
||||||
|
|
||||||
require("./api/modules/events").onTicketReopen(user,channel,guild,new Date(),{name:channel.name,status:"reopened",ticketOptions:false})
|
|
||||||
}
|
|
||||||
exports.reopenTicket = reopenTicket
|
|
||||||
|
|
||||||
exports.runThis = () => {
|
|
||||||
var closeRowNormal = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("closeTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
|
|
||||||
var closeRowClosed = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("deleteTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("sendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Success)
|
|
||||||
.setLabel(l.buttons.reopen)
|
|
||||||
.setEmoji("✔")
|
|
||||||
)
|
|
||||||
|
|
||||||
var reopenBar = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
var reopenBar1 = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicketTrue1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicketFalse1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
var reopenCommandBar = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("reopenTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setEmoji("🔓")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//NORMAL WAY
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "reopenTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[reopenBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "reopenTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[closeRowClosed]})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "reopenTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
const embed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
|
||||||
.setDescription(l.messages.reopenDescription)
|
|
||||||
|
|
||||||
interaction.message.edit({embeds:[embed],components:[closeRowNormal]})
|
|
||||||
|
|
||||||
reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
//COMMAND WAY
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "reopenTicket1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[reopenBar1]})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "reopenTicketFalse1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[reopenCommandBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "reopenTicketTrue1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
const embed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(":unlock: "+l.messages.reopenTitle+" :unlock:")
|
|
||||||
.setDescription(l.messages.reopenDescription)
|
|
||||||
|
|
||||||
interaction.message.edit({content:null,embeds:[embed],components:[closeRowNormal]})
|
|
||||||
|
|
||||||
reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
/** @param {discord.TextBasedChannel} channel @returns {Promise<{ticketname:String,ticketopener:{discordjsuser:discord.User,name:String,id:String}>} */
|
|
||||||
const getUserInfo = (channel) => {
|
|
||||||
return new Promise((promiseresolve,reject) => {
|
|
||||||
//getID
|
|
||||||
var result = {
|
|
||||||
ticketopener:{
|
|
||||||
discordjsuser:"",
|
|
||||||
id:"/",
|
|
||||||
name:"/"
|
|
||||||
},
|
|
||||||
ticketname:"/"
|
|
||||||
}
|
|
||||||
channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type")
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
result.ticketopener.id = id
|
|
||||||
|
|
||||||
const ticketopener = client.users.cache.find(u => u.id == id)
|
|
||||||
const name = ticketopener.tag
|
|
||||||
|
|
||||||
const channelname = channel.name
|
|
||||||
|
|
||||||
promiseresolve({ticketname:channelname,ticketopener:{discordjsuser:ticketopener,name:name,id:id}})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.Message[]} messagecollection
|
|
||||||
* @param {discord.Channel} channel
|
|
||||||
* @returns new `discord.attachmentBuilder`
|
|
||||||
*/
|
|
||||||
|
|
||||||
exports.createTranscript = async (messagecollection,channel) => {
|
|
||||||
const ticketuserdata = await getUserInfo(channel)
|
|
||||||
|
|
||||||
require("./api/modules/events").onTranscriptCreation(messagecollection,channel,channel.guild,new Date())
|
|
||||||
try {
|
|
||||||
const cd = new Date()
|
|
||||||
const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
|
||||||
const dateString = cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getSeconds()+":"+cd.getMinutes()+":"+cd.getHours()
|
|
||||||
const filearray = ["open ticket transcript:\ntranscript creation: "+dateString+"\nticket name: "+ticketuserdata.ticketname+"\nticket opener: "+ticketuserdata.ticketopener.name,"\nTRANSCRIPT START:"]
|
|
||||||
|
|
||||||
messagecollection.reverse()
|
|
||||||
|
|
||||||
messagecollection.forEach((msg) => {
|
|
||||||
const timestamp = new Date(msg.createdTimestamp)
|
|
||||||
|
|
||||||
if (msg.content){var content = msg.content}else{var content = "*empty message*"}
|
|
||||||
|
|
||||||
const msgstats = "files: "+msg.attachments.size+", embeds: "+msg.embeds.length
|
|
||||||
filearray.push("["+timestamp.getDate()+"/"+timestamp.getMonth()+"/"+timestamp.getFullYear()+", "+timestamp.getHours()+":"+timestamp.getMinutes()+":"+timestamp.getSeconds()+"|"+msg.author.tag+"] ["+msgstats+"]\n"+content+"\n")
|
|
||||||
})
|
|
||||||
|
|
||||||
if (filearray.length < 2) filearray.push("transcript is empty")
|
|
||||||
const filestring = filearray.join("\n")
|
|
||||||
const filebuff = Buffer.from(filestring,"utf-8")
|
|
||||||
return new discord.AttachmentBuilder(filebuff,{name:"transcript_"+ticketuserdata.ticketname+".txt",description:"An Open Ticket transcript"})
|
|
||||||
}catch(err){
|
|
||||||
console.log("[error] "+err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const config = bot.config
|
|
||||||
const getoptions = require("../getoptions")
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
|
||||||
const getColor = (color) => {
|
|
||||||
const b = discord.ButtonStyle
|
|
||||||
if (color.toLowerCase() == "red"){
|
|
||||||
return b.Danger
|
|
||||||
}else if (color.toLowerCase() == "green"){
|
|
||||||
return b.Success
|
|
||||||
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
|
||||||
return b.Primary
|
|
||||||
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
|
||||||
return b.Secondary
|
|
||||||
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
|
||||||
return color
|
|
||||||
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
|
||||||
return b.Secondary
|
|
||||||
}else return b.Secondary
|
|
||||||
}
|
|
||||||
|
|
||||||
const getOption = (id) => {
|
|
||||||
const result = config.options.find((option) => option.id == id)
|
|
||||||
if (!result){return false}else return result
|
|
||||||
}
|
|
||||||
exports.getOption = getOption
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {discord.ButtonBuilder|false}
|
|
||||||
*/
|
|
||||||
exports.getButton = (id) => {
|
|
||||||
const option = getOption(id)
|
|
||||||
if (!option) return false
|
|
||||||
if (option.type == "ticket"){
|
|
||||||
var button = new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTnewT"+option.id)
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(option.color))
|
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
|
||||||
if (option.icon){button.setEmoji(option.icon)}
|
|
||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
|
||||||
|
|
||||||
}else if (option.type == "website"){
|
|
||||||
var button = new discord.ButtonBuilder()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Link)
|
|
||||||
.setURL(option.url)
|
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
|
||||||
if (option.icon){button.setEmoji(option.icon)}
|
|
||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
|
||||||
|
|
||||||
}else if (option.type == "role"){
|
|
||||||
var button = new discord.ButtonBuilder()
|
|
||||||
.setCustomId("newR"+option.id)
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(option.color))
|
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
|
||||||
if (option.icon){button.setEmoji(option.icon)}
|
|
||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return button
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
exports.rawButtonData = class {
|
|
||||||
constructor() {
|
|
||||||
this.id = ""
|
|
||||||
this.name = ""
|
|
||||||
this.description = ""
|
|
||||||
this.icon = ""
|
|
||||||
this.label = ""
|
|
||||||
this.type = ""
|
|
||||||
|
|
||||||
this.color = ""
|
|
||||||
this.enableDMMessage = true
|
|
||||||
this.url = ""
|
|
||||||
this.roles = ["",""]
|
|
||||||
this.mode = ""
|
|
||||||
this.adminroles = ["",""]
|
|
||||||
this.channelprefix = ""
|
|
||||||
this.category = ""
|
|
||||||
this.message = ""
|
|
||||||
this.ticketmessage = ""
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
const bot = require("../../index")
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
exports.getTicketMessage = (input) => {
|
|
||||||
var returned = config.messages.find(a => a.id == input)
|
|
||||||
if (returned){
|
|
||||||
return returned
|
|
||||||
}
|
|
||||||
var result = config.messages[0]
|
|
||||||
if (!result){
|
|
||||||
throw new Error("'messages' object in config.json is empty")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
|
|
||||||
/**@typedef {{type:String,data:[{key:String,value:String}]}} hiddenData */
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} messageContent
|
|
||||||
* @returns {hiddenData}
|
|
||||||
*/
|
|
||||||
|
|
||||||
exports.readHiddenData = (messageContent) => {
|
|
||||||
//ticketdata//type:123|userid:456)
|
|
||||||
const rawhidden = messageContent.split("[ ](OTDATA|")[1]
|
|
||||||
const rawhidden2 = rawhidden.split("//")
|
|
||||||
|
|
||||||
const datatype = rawhidden2[0]
|
|
||||||
var rawhiddendata = rawhidden2[1]
|
|
||||||
var rawhiddendataArray = rawhiddendata.split("")
|
|
||||||
rawhiddendataArray.pop()
|
|
||||||
|
|
||||||
rawhiddendata = rawhiddendataArray.join("")
|
|
||||||
|
|
||||||
const splittedData = rawhiddendata.split("|")
|
|
||||||
|
|
||||||
const resultData = []
|
|
||||||
splittedData.forEach((data) => {
|
|
||||||
// type:123
|
|
||||||
const dataresult = data.split(":")
|
|
||||||
|
|
||||||
resultData.push({key:dataresult[0],value:dataresult[1]})
|
|
||||||
})
|
|
||||||
|
|
||||||
return {type:datatype,data:resultData}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} type
|
|
||||||
* @param {[{key:String,value:String}]} data
|
|
||||||
* @returns {String}
|
|
||||||
*/
|
|
||||||
exports.writeHiddenData = (type,data) => {
|
|
||||||
const dataValues = []
|
|
||||||
data.forEach((d) => {
|
|
||||||
dataValues.push(d.key+":"+d.value)
|
|
||||||
})
|
|
||||||
|
|
||||||
const datastring = dataValues.join("|")
|
|
||||||
|
|
||||||
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} memberid
|
|
||||||
* @param {String} guildid
|
|
||||||
* @returns {Boolean} has permissions?
|
|
||||||
*/
|
|
||||||
exports.command = (memberid,guildid) => {
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == guildid).members.cache.find(m => m.id == memberid)
|
|
||||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
|
||||||
return false
|
|
||||||
}else {return true}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendUserNoPerms = (user) => {
|
|
||||||
try {
|
|
||||||
user.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendUserNoTicket = (user) => {
|
|
||||||
try {
|
|
||||||
user.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendUserNoDelete = (user) => {
|
|
||||||
try {
|
|
||||||
user.send({embeds:[bot.errorLog.noPermsDelete]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendChannelNoPerms = (channel) => {
|
|
||||||
try {
|
|
||||||
channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendChannelNoTicket = (channel) => {
|
|
||||||
try {
|
|
||||||
channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendChannelNoDelete = (channel) => {
|
|
||||||
try {
|
|
||||||
channel.send({embeds:[bot.errorLog.noPermsDelete]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const loadChalk = async () => {
|
|
||||||
return await (await import("chalk")).default
|
|
||||||
}
|
|
||||||
|
|
||||||
//ENABLE message for when there is too less translation
|
|
||||||
const enableNoTranslationMessage = true
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = await loadChalk()
|
|
||||||
if (enableNoTranslationMessage){
|
|
||||||
console.log(chalk.red("[warning]"),"WARNING!!\n"+chalk.blue("We have a small problem with translation atm, so it can be that "+chalk.redBright("some translations are in English!")+"\n\nYou can help us if you want by joining our server!\n"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
[
|
||||||
|
{"category":"openticket:last-version","key":"openticket:version","value":"v4.0.0"},
|
||||||
|
{"category":"openticket:last-version","key":"openticket:api","value":"v1.0.0"},
|
||||||
|
{"category":"openticket:last-version","key":"openticket:transcripts","value":"v2.0.0"},
|
||||||
|
{"category":"openticket:last-version","key":"openticket:livestatus","value":"v2.0.0"},
|
||||||
|
{"category":"openticket:last-version","key":"openticket:last-version","value":"v4.0.0"}
|
||||||
|
]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
// __________ __________ ___________ ____ ____
|
|
||||||
// / ____ \ / ______ \ / | | \ | |
|
|
||||||
// | / \ | | | | | | |_______| | \ | |
|
|
||||||
// | | | | | |____| | | | | |\ \ | |
|
|
||||||
// | | | | | ________/ | |______ | | \ \ | |
|
|
||||||
// | | | | | | | _____| | | \ \ | |
|
|
||||||
// | | | | | | | | | | \ \ | |
|
|
||||||
// | | | | | | | |________ | | \ \| |
|
|
||||||
// | \____/ | | | | | | | \ |
|
|
||||||
// \__________/ |__| \__________| |__| \___|
|
|
||||||
|
|
||||||
|
|
||||||
const discord = require('discord.js')
|
|
||||||
const fs = require('fs')
|
|
||||||
const {GatewayIntentBits,Partials} = discord
|
|
||||||
const client = new discord.Client({
|
|
||||||
intents:[
|
|
||||||
GatewayIntentBits.DirectMessages,
|
|
||||||
GatewayIntentBits.GuildInvites,
|
|
||||||
GatewayIntentBits.GuildMembers,
|
|
||||||
GatewayIntentBits.GuildMessages,
|
|
||||||
GatewayIntentBits.Guilds,
|
|
||||||
GatewayIntentBits.MessageContent
|
|
||||||
],
|
|
||||||
partials:[Partials.Channel,Partials.Message]
|
|
||||||
})
|
|
||||||
exports.client = client
|
|
||||||
|
|
||||||
client.setMaxListeners(50)
|
|
||||||
|
|
||||||
if (process.argv[2]){
|
|
||||||
if (process.argv[2].endsWith("d")){
|
|
||||||
var isDev = true
|
|
||||||
console.log("starting in dev mode...")
|
|
||||||
}else{var isDev = false}
|
|
||||||
}else{var isDev = false}
|
|
||||||
|
|
||||||
exports.developerMode = isDev
|
|
||||||
const language = require("./core/languageManager").language
|
|
||||||
exports.language = language
|
|
||||||
|
|
||||||
if (isDev){
|
|
||||||
try {
|
|
||||||
var config = require('./devConfig.json')
|
|
||||||
}catch{
|
|
||||||
console.log("devConfig.json not found! Trying the normal config...")
|
|
||||||
var config = require("./config.json")
|
|
||||||
}
|
|
||||||
}else{var config = require('./config.json')}
|
|
||||||
exports.config = config
|
|
||||||
exports.storage = require('./core/dynamicdatabase/storage')
|
|
||||||
|
|
||||||
exports.errorLog = require("./core/errorLogSystem")
|
|
||||||
const log = this.errorLog.log
|
|
||||||
|
|
||||||
exports.hiddenData = require("./core/utils/hiddendata")
|
|
||||||
|
|
||||||
exports.embeds = {
|
|
||||||
commands:require("./core/interactionHandlers/embeds/commands")
|
|
||||||
}
|
|
||||||
exports.buttons = {
|
|
||||||
close:require("./core/interactionHandlers/buttons/close"),
|
|
||||||
firstmsg:require("./core/interactionHandlers/buttons/firstmsg"),
|
|
||||||
verifybars:require("./core/interactionHandlers/buttons/verifyBars")
|
|
||||||
}
|
|
||||||
|
|
||||||
client.on('ready',async () => {
|
|
||||||
var statusSet = false
|
|
||||||
const setStatus = (type,text) => {
|
|
||||||
if (statusSet == true) return
|
|
||||||
const getTypeEnum = (text) => {
|
|
||||||
if (text.toLowerCase() == "playing") return discord.ActivityType.Playing
|
|
||||||
else if (text.toLowerCase() == "listening") return discord.ActivityType.Listening
|
|
||||||
else if (text.toLowerCase() == "watching") return discord.ActivityType.Watching
|
|
||||||
else return discord.ActivityType.Listening
|
|
||||||
}
|
|
||||||
client.user.setActivity(text,{type:getTypeEnum(type)})
|
|
||||||
statusSet = true
|
|
||||||
log("system","loaded status",[{key:"type",value:type},{key:"text",value:text}])
|
|
||||||
}
|
|
||||||
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
if (!process.argv[2]){
|
|
||||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
|
||||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
|
||||||
require("./core/utils/warningManager")()
|
|
||||||
|
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
|
||||||
if (config.status.enabled){
|
|
||||||
setStatus(config.status.type,config.status.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
log("system","bot logged in!")
|
|
||||||
|
|
||||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv[2] == "d"){
|
|
||||||
if (config.status.enabled){
|
|
||||||
setStatus(config.status.type,config.status.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!process.argv[2].startsWith("slash")){
|
|
||||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
|
||||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
|
||||||
require("./core/utils/warningManager")()
|
|
||||||
|
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
|
||||||
if (config.status.enabled){
|
|
||||||
setStatus(config.status.type,config.status.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
log("system","bot logged in!")
|
|
||||||
|
|
||||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
|
||||||
}else{
|
|
||||||
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
|
||||||
console.log("logs:\n================")
|
|
||||||
console.log("client logged in...")
|
|
||||||
console.log("loading files...")
|
|
||||||
if (process.argv[3] == "enable"){
|
|
||||||
console.log(chalk.green("switching to slashEnable.js"))
|
|
||||||
require("./core/slashSystem/slashEnable")()
|
|
||||||
}else if (process.argv[3] == "disable"){
|
|
||||||
console.log(chalk.green("switching to slashDisable.js"))
|
|
||||||
require("./core/slashSystem/slashDisable")()
|
|
||||||
}else{
|
|
||||||
console.log(chalk.red("Internal Error: unknown slash mode!"))
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//load plugins
|
|
||||||
require("./core/api/pluginlauncher")()
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!isDev){
|
|
||||||
require("./core/checker").checker()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv[2] && process.argv[2].startsWith("slash")){
|
|
||||||
//do nothing
|
|
||||||
}else{
|
|
||||||
|
|
||||||
//commands
|
|
||||||
require('./commands/ticket')()
|
|
||||||
require("./commands/help")()
|
|
||||||
require("./commands/close")()
|
|
||||||
require("./commands/delete")()
|
|
||||||
require("./commands/rename")()
|
|
||||||
require("./commands/add")()
|
|
||||||
require("./commands/remove")()
|
|
||||||
require("./commands/reopen")()
|
|
||||||
|
|
||||||
//core
|
|
||||||
require('./core/ticketOpener')()
|
|
||||||
require("./core/ticketCloser").runThis()
|
|
||||||
//require("./core/closebuttons")() // => everything is now in ./core/interactionHandlers/
|
|
||||||
require("./core/reactionRoles")()
|
|
||||||
require("./core/ticketReopener").runThis()
|
|
||||||
|
|
||||||
//InteractionHandlers
|
|
||||||
require("./core/interactionHandlers/handlers/handlers")()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const APIEvents = require("./core/api/modules/events")
|
|
||||||
|
|
||||||
const debugLog = (debugString) => {
|
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
|
||||||
}
|
|
||||||
const errorLog = (errorString,stack) => {
|
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
|
|
||||||
}
|
|
||||||
|
|
||||||
client.on("debug", async (message) => {
|
|
||||||
if (message.startsWith("Provided token:")){
|
|
||||||
debugLog("Provided token: ***********bot token is invisible**************...")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
debugLog(message)
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on("uncaughtException",async (error,origin) => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
console.log(chalk.red("\nOPEN TICKET ERROR: ")+error+"\n"+chalk.green("\nCreate a ticket in our support server for more information!\nIf you do this, you might help us to avoid a future bug!\n"))
|
|
||||||
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
|
||||||
|
|
||||||
APIEvents.onError(error.name+": "+error.message,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
client.login(config.auth_token)
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"حجج باطلة",
|
|
||||||
"missingArgsDescription":"حجة مفقودة",
|
|
||||||
"noPermsTitle":"ليس لديك إذن",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"بطاقة التعريف غير صالحة",
|
|
||||||
"chooseFromListDescription":"اختر أحد المعرفات أدناه:",
|
|
||||||
"boterror":"مشكلة في الروبوت",
|
|
||||||
"notInTicketTitle":"أنت لست في تذكرة!",
|
|
||||||
"notInTicketDescription":"هذا الأمر لا يعمل خارج التذاكر!",
|
|
||||||
"ticketDoesntExist":"هذه التذكرة لم تعد موجودة!",
|
|
||||||
"roleDoesntExist":"هذا الدور لم يعد موجودًا!",
|
|
||||||
"anotherOption":"هذا الخيار ليس تذكرة بل نوع آخر!",
|
|
||||||
"maxAmountTitle":"بلغ الحد الأقصى!",
|
|
||||||
"maxAmountDescription":"لقد وصلت إلى الحد الأقصى لعدد التذاكر المسموح بها!\nلذلك لا يمكنك إنشاء واحدة جديدة!",
|
|
||||||
"somethingWentWrong":"**هناك خطأ ما!**\nالرجاء المحاولة مرة أخرى!",
|
|
||||||
"somethingWentWrongTranscript":"**حدث خطأ ما أثناء كتابة النص!**\nالرجاء المحاولة مرة أخرى!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**اذهب إلى {0} لإنشاء تذكرة!**\n\n",
|
|
||||||
"header2":"**قم بتشغيل الأمر `/new` أو `/ticket` لإنشاء تذكرة!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"تفرخ تضمين مع الأزرار. (المسؤولون فقط)",
|
|
||||||
"renameCmd":"إعادة تسمية تذكرة. (بدون مسافات)",
|
|
||||||
"closeCmd":"أغلق التذكرة.",
|
|
||||||
"deleteCmd":"حذف التذكرة.",
|
|
||||||
"addCmd":"أضف مستخدمًا إلى التذكرة.",
|
|
||||||
"removeCmd":"إزالة مستخدم من التذكرة.",
|
|
||||||
"reopenCmd":"أعد فتح التذكرة بعد إغلاقه."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"إغلاق التذكرة",
|
|
||||||
"delete":"حذف التذكرة",
|
|
||||||
"reopen":"إعادة فتح التذكرة",
|
|
||||||
"sendTranscript":"إرسال ملف النص"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"أعيد فتح هذه التذكرة!",
|
|
||||||
"reopenDescription":"لا تتردد في التحدث مرة أخرى!",
|
|
||||||
"closedTitle":"أغلقت هذه التذكرة!",
|
|
||||||
"closedDescription":"يمكن للمسؤولين فقط التحدث في هذه التذكرة الآن!\n\n*انقر فوق الزر أدناه لحذف هذه التذكرة أو إعادة فتحها!*",
|
|
||||||
"createdTitle":"تم إنشاء التذكرة!",
|
|
||||||
"createdDescription":"تم إنشاء تذكرتك ، يمكنك اكتشافها عن طريق ping",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"تذكرة جديدة!",
|
|
||||||
"closedTicketDmTitle":"تم إغلاق التذكرة!",
|
|
||||||
"deletedTicketDmTitle":"تم حذف التذكرة!",
|
|
||||||
"closedTicketDmDescription":"تم إغلاق تذكرتك!",
|
|
||||||
"deletedTicketDmDescription":"تم حذف تذكرتك!",
|
|
||||||
"reopenTicketDmTitle":"أعيد فتح التذكرة!",
|
|
||||||
"reopenTicketDmDescription":"تم إعادة فتح تذكرتك!",
|
|
||||||
"newTranscriptTitle":"نسخة جديدة هنا!",
|
|
||||||
"hereIsTheTranscript":"هذا هو النص:",
|
|
||||||
|
|
||||||
"chooseCategory":"اختر فئة:",
|
|
||||||
"gettingdeleted":"...يتم حذف التذكرة",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Invalid Arguments!",
|
|
||||||
"missingArgsDescription":"Missing Argument",
|
|
||||||
"noPermsTitle":"No Permissions!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Choose one of the id's below:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"You are not in a ticket!",
|
|
||||||
"notInTicketDescription":"This command doesn't work outside tickets!",
|
|
||||||
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
|
||||||
"roleDoesntExist":"This role doesn't exist anymore!",
|
|
||||||
"anotherOption":"This option is not a ticket but another type!",
|
|
||||||
"maxAmountTitle":"Max amount reached!",
|
|
||||||
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
|
||||||
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!",
|
|
||||||
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**Go to {0} to create a ticket!**\n\n",
|
|
||||||
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
|
||||||
"renameCmd":"Rename a ticket. (no spaces)",
|
|
||||||
"closeCmd":"Close a ticket.",
|
|
||||||
"deleteCmd":"Delete a ticket.",
|
|
||||||
"addCmd":"Add a user to the ticket.",
|
|
||||||
"removeCmd":"Remove a user from the ticket.",
|
|
||||||
"reopenCmd":"Re-Open a ticket after it was closed."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Close Ticket",
|
|
||||||
"delete":"Delete Ticket",
|
|
||||||
"reopen":"Re-Open Ticket",
|
|
||||||
"sendTranscript":"Transcript"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"reopenDescription":"Feel free to talk again!",
|
|
||||||
"closedTitle":"Closed this ticket!",
|
|
||||||
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
|
||||||
"createdTitle":"Ticket Created!",
|
|
||||||
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"New Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket Closed!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Deleted!",
|
|
||||||
"closedTicketDmDescription":"Your ticket is closed!",
|
|
||||||
"deletedTicketDmDescription":"Your ticket is deleted!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Re-opened!",
|
|
||||||
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
|
||||||
"newTranscriptTitle":"A new transcript is here!",
|
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"choose a category:",
|
|
||||||
"gettingdeleted":"Ticket is getting deleted...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Neplatné argumenty",
|
|
||||||
"missingArgsDescription":"Chybí argumenty",
|
|
||||||
"noPermsTitle":"Nemáš práva!",
|
|
||||||
"noPermsDescription":"Nemáš dostatečné práva na tento příkaz!\n Potřebuješ ADMINISTRATOR aby jsi mohl provést příkaz!",
|
|
||||||
"noPermsDelete":"Pouze admin může smazat ticket!",
|
|
||||||
"chooseFromListTitle":"Neplatné ID",
|
|
||||||
"chooseFromListDescription":"Vyber si z těchto ID:",
|
|
||||||
"boterror":"Error!",
|
|
||||||
"notInTicketTitle":"Nejsi v ticketu!",
|
|
||||||
"notInTicketDescription":"Tento příkaz nefunguje mimo tickety!",
|
|
||||||
"ticketDoesntExist":"Tento ticket už bohužel neexistuje!",
|
|
||||||
"roleDoesntExist":"Tato role bohužel neexistuje!",
|
|
||||||
"anotherOption":"Tato možnost není ticket ale něco jiného!",
|
|
||||||
"maxAmountTitle":"Maximální počet ticketů dosažen!",
|
|
||||||
"maxAmountDescription":"Dosáhl jsi maximálního povoleného počtu ticketů!\n Nemůžeš si vytvořit nový!",
|
|
||||||
"somethingWentWrong":"**Něco je špatně**\nProsím zkus to příště znovu!",
|
|
||||||
"somethingWentWrongTranscript":"Něco je špatně s transcriptem!**\nProsím zkus to příště znovu!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} byl přidán do ticketu!",
|
|
||||||
"userRemovedTitle":"{0} byl odebrám z ticketu!",
|
|
||||||
"renameTitle":"Jméno bylo změněno!",
|
|
||||||
"closeTitle":"Zavři tento ticket!",
|
|
||||||
"deleteTitle":"Smaž tento ticket!",
|
|
||||||
"reopenTitle":"Znovu otevři ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Varovaní:** _Můžeš si vytvořit použe {0} ticket(s) v jednu chvíli!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Příkazy:",
|
|
||||||
"header1":"**Běž {0} vytvořit si ticket!**\n\n",
|
|
||||||
"header2":"**Použij příkaz `/new` nebo `/ticket` k vytvoření ticketu!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Vytvoř možnost otevírat tickety přes tlačítko. (ADMIN)",
|
|
||||||
"renameCmd":"Přejmenovat ticket. (Žádné mezery)",
|
|
||||||
"closeCmd":"Zavři ticket.",
|
|
||||||
"deleteCmd":"Smaž ticket.",
|
|
||||||
"addCmd":"Přidej člena do ticketu.",
|
|
||||||
"removeCmd":"Odebere člena z ticketu.",
|
|
||||||
"reopenCmd":"Znovu otevři ticket po uzavření."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Zavři ticket",
|
|
||||||
"delete":"Smaž ticket",
|
|
||||||
"reopen":"Znovu otevři ticket",
|
|
||||||
"sendTranscript":"Odešli log ticketu"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Ticket znovu otevřen!",
|
|
||||||
"reopenDescription":"Cítím se skvěle že si můžeme zase povídat!",
|
|
||||||
"closedTitle":"Zavřený ticket!",
|
|
||||||
"closedDescription":"Pouze admin team zde může nyní komunikovat!\n\n*Klikni na tlačítko níže pro smazání nebo znovu otevření ticketu!*",
|
|
||||||
"createdTitle":"Ticket vytvořen!",
|
|
||||||
"createdDescription":"Váš tiket je vytvořen, můžete ho zjistit pomocí pingu!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nový ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket uzavřen!",
|
|
||||||
"deletedTicketDmTitle":"Ticket smazán!",
|
|
||||||
"closedTicketDmDescription":"Tvůj ticket byl uzavřen!",
|
|
||||||
"deletedTicketDmDescription":"Tvůj ticket byl smazán!",
|
|
||||||
"reopenTicketDmTitle":"Ticket znovu otevřen!",
|
|
||||||
"reopenTicketDmDescription":"Tvůj ticket byl znovu otevřen!",
|
|
||||||
"newTranscriptTitle":"Nový log ticketu je zde!",
|
|
||||||
"hereIsTheTranscript":"Zde je log:",
|
|
||||||
|
|
||||||
"chooseCategory":"Vyber kategorii:",
|
|
||||||
"gettingdeleted":"Ticket bude smazán",
|
|
||||||
|
|
||||||
"none":"nic",
|
|
||||||
"reason":"důvod"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Onjuiste parameters!",
|
|
||||||
"missingArgsDescription":"Er missen parameters",
|
|
||||||
"noPermsTitle":"Geen permissies!",
|
|
||||||
"noPermsDescription":"Je hebt de `ADMINISTRATOR` permissie nodig of je moet in de lijst van toegestane users staan!",
|
|
||||||
"noPermsDelete":"Alleen admins kunnen een ticket verwijderen!",
|
|
||||||
"chooseFromListTitle":"Onjuist ID",
|
|
||||||
"chooseFromListDescription":"Kies een van de id's hier onder:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"Je bent niet in een ticket!",
|
|
||||||
"notInTicketDescription":"Deze command werkt niet buiten tickets!",
|
|
||||||
"ticketDoesntExist":"Dit ticket bestaat niet meer!",
|
|
||||||
"roleDoesntExist":"Deze rol bestaat niet meer!",
|
|
||||||
"anotherOption":"Deze optie is niet een ticket, maar een ander type!",
|
|
||||||
"maxAmountTitle":"Maximum numer bereikt!",
|
|
||||||
"maxAmountDescription":"Je hebt het maximum aantal openstaande tickets bereikt!\nDus je kan geen nieuwe meer maken!",
|
|
||||||
"somethingWentWrong":"**Iets ging fout!**\nProbeer een andere keer opnieuw!",
|
|
||||||
"somethingWentWrongTranscript":"Iets ging fout terwijl het transcript gemaakt werd!**\nProbeer een andere keer opnieuw!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} is toegevoegd aan dit ticket!",
|
|
||||||
"userRemovedTitle":"{0} is verwijderd van dit ticket!",
|
|
||||||
"renameTitle":"De naam is veranderd naar {0}!",
|
|
||||||
"closeTitle":"Ticket gesloten!",
|
|
||||||
"deleteTitle":"Ticket aan het verwijderen...",
|
|
||||||
"reopenTitle":"Ticket heropend!",
|
|
||||||
|
|
||||||
"ticketWarning":"De embed is in het bericht hier onder!",
|
|
||||||
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd maken!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Beschikbare Commands:",
|
|
||||||
"header1":"**Ga naar {0} om een ticket te maken!**\n\n",
|
|
||||||
"header2":"**Run de command `/new` of `/ticket` om een ticket te maken!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Spawn een embed met knoppen. (alleen admins)",
|
|
||||||
"renameCmd":"Hernoem een ticket. (geen spaties)",
|
|
||||||
"closeCmd":"Sluit een ticket.",
|
|
||||||
"deleteCmd":"Verijder een ticket.",
|
|
||||||
"addCmd":"Voeg een user aan een ticket.",
|
|
||||||
"removeCmd":"Verwijder een user van een ticket.",
|
|
||||||
"reopenCmd":"Heropen een ticket nadat het gesloten is."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Sluit Ticket",
|
|
||||||
"delete":"Verwijder Ticket",
|
|
||||||
"reopen":"Heropen Ticket",
|
|
||||||
"sendTranscript":"Transcript"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Ticket heropend!",
|
|
||||||
"reopenDescription":"Voel vrij om weer te praten!",
|
|
||||||
"closedTitle":"Ticket gesloten!",
|
|
||||||
"closedDescription":"Alleen admins kunnen nog praten.\n\n*Klik op de knoppen hieronder voor meer acties!*",
|
|
||||||
"createdTitle":"Ticket Aangemaakt!",
|
|
||||||
"createdDescription":"U ticket is gemaakt, je kan het detecteren bij een ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nieuw Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket Gesloten!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Verwijderd!",
|
|
||||||
"closedTicketDmDescription":"Je ticket is gesloten!",
|
|
||||||
"deletedTicketDmDescription":"Je ticket is verwijderd!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Heropend!",
|
|
||||||
"reopenTicketDmDescription":"Je ticket is heropend!",
|
|
||||||
"newTranscriptTitle":"Er is een nieuw transcript!",
|
|
||||||
"hereIsTheTranscript":"Hier is het transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"kies een categorie:",
|
|
||||||
"gettingdeleted":"Ticket wordt verwijderd...",
|
|
||||||
|
|
||||||
"none":"geen",
|
|
||||||
"reason":"reden"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Invalid Arguments!",
|
|
||||||
"missingArgsDescription":"Missing Argument",
|
|
||||||
"noPermsTitle":"No Permissions!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Choose one of the id's below:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"You are not in a ticket!",
|
|
||||||
"notInTicketDescription":"This command doesn't work outside tickets!",
|
|
||||||
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
|
||||||
"roleDoesntExist":"This role doesn't exist anymore!",
|
|
||||||
"anotherOption":"This option is not a ticket but another type!",
|
|
||||||
"maxAmountTitle":"Max amount reached!",
|
|
||||||
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
|
||||||
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!",
|
|
||||||
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**Go to {0} to create a ticket!**\n\n",
|
|
||||||
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
|
||||||
"renameCmd":"Rename a ticket. (no spaces)",
|
|
||||||
"closeCmd":"Close a ticket.",
|
|
||||||
"deleteCmd":"Delete a ticket.",
|
|
||||||
"addCmd":"Add a user to the ticket.",
|
|
||||||
"removeCmd":"Remove a user from the ticket.",
|
|
||||||
"reopenCmd":"Re-Open a ticket after it was closed."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Close Ticket",
|
|
||||||
"delete":"Delete Ticket",
|
|
||||||
"reopen":"Re-Open Ticket",
|
|
||||||
"sendTranscript":"Transcript"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"reopenDescription":"Feel free to talk again!",
|
|
||||||
"closedTitle":"Closed this ticket!",
|
|
||||||
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
|
||||||
"createdTitle":"Ticket Created!",
|
|
||||||
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"New Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket Closed!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Deleted!",
|
|
||||||
"closedTicketDmDescription":"Your ticket is closed!",
|
|
||||||
"deletedTicketDmDescription":"Your ticket is deleted!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Re-opened!",
|
|
||||||
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
|
||||||
"newTranscriptTitle":"A new transcript is here!",
|
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"choose a category:",
|
|
||||||
"gettingdeleted":"Ticket is getting deleted...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Arguments invalides!",
|
|
||||||
"missingArgsDescription":"Argument manquant",
|
|
||||||
"noPermsTitle":"Pas de permissions!",
|
|
||||||
"noPermsDescription":"Vous avez besoin de la permission `ADMINISTRATOR` ou être dans la liste des rôles autorisés!",
|
|
||||||
"noPermsDelete":"Seuls les administrateurs peuvent supprimer un ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Choisissez l'un des identifiants ci-dessous:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"Vous n'êtes pas dans un ticket!",
|
|
||||||
"notInTicketDescription":"Cette commande ne fonctionne pas en dehors des tickets!",
|
|
||||||
"ticketDoesntExist":"Ce ticket n'existe plus!",
|
|
||||||
"roleDoesntExist":"Ce rôle n'existe plus!",
|
|
||||||
"anotherOption":"Cette option n'est pas un ticket mais un autre type!",
|
|
||||||
"maxAmountTitle":"Montant maximum atteint!",
|
|
||||||
"maxAmountDescription":"Vous avez atteint le nombre maximum de tickets autorisés!\nVous ne pouvez donc pas en créer un nouveau!",
|
|
||||||
"somethingWentWrong":"**Quelque chose s'est mal passé!**\nVeuillez réessayer une autre fois!",
|
|
||||||
"somethingWentWrongTranscript":"Une erreur s'est produite lors de la création de la transcription!**\nVeuillez réessayer une autre fois!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} a été ajouté à ce ticket!",
|
|
||||||
"userRemovedTitle":"Supprimé {0} de ce ticket!",
|
|
||||||
"renameTitle":"Changement du nom en {0}!",
|
|
||||||
"closeTitle":"Fermé ce ticket!",
|
|
||||||
"deleteTitle":"Suppression de ce ticket...",
|
|
||||||
"reopenTitle":"A rouvert ce ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"L'intégration est dans le message ci-dessous!",
|
|
||||||
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} ticket(s) à la fois !_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Commandes disponibles :",
|
|
||||||
"header1":"**Allez à {0} pour créer un ticket !**\n\n",
|
|
||||||
"header2":"**Exécutez la commande `/new` ou `/ticket` pour créer un ticket !**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Faire apparaître une intégration avec des boutons. (administrateurs uniquement)",
|
|
||||||
"renameCmd":"Renommer un ticket. (sans espaces)",
|
|
||||||
"closeCmd":"Fermer un ticket.",
|
|
||||||
"deleteCmd":"Supprimer un billet.",
|
|
||||||
"addCmd":"Ajouter un utilisateur au ticket.",
|
|
||||||
"removeCmd":"Supprimer un utilisateur du ticket.",
|
|
||||||
"reopenCmd":"Rouvrir un ticket après sa clôture."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Fermer le ticket",
|
|
||||||
"delete":"Supprimer le billet",
|
|
||||||
"reopen":"Billet de réouverture",
|
|
||||||
"sendTranscript":"Transcript"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"A rouvert ce ticket!",
|
|
||||||
"reopenDescription":"N'hésitez pas à reparler!",
|
|
||||||
"closedTitle":"Fermé ce ticket!",
|
|
||||||
"closedDescription":"Seuls les administrateurs peuvent parler dans ce ticket maintenant !\n\n*Cliquez sur le bouton ci-dessous pour supprimer ou rouvrir ce ticket !*",
|
|
||||||
"createdTitle":"Ticket créé !",
|
|
||||||
"createdDescription":"Votre ticket est créé, vous pouvez le détecter par un ping !",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nouveau billet!",
|
|
||||||
"closedTicketDmTitle":"Billet fermé!",
|
|
||||||
"deletedTicketDmTitle":"Billet supprimé !",
|
|
||||||
"closedTicketDmDescription":"Votre billet est fermé !",
|
|
||||||
"deletedTicketDmDescription":"Votre billet est supprimé !",
|
|
||||||
"reopenTicketDmTitle":"Billet rouvert!",
|
|
||||||
"reopenTicketDmDescription":"Votre billet est rouvert !",
|
|
||||||
"newTranscriptTitle":"Une nouvelle transcription est ici!",
|
|
||||||
"hereIsTheTranscript":"Voici la transcription :",
|
|
||||||
|
|
||||||
"chooseCategory":"choisissez une catégorie:",
|
|
||||||
"gettingdeleted":"Le ticket est en cours de suppression...",
|
|
||||||
|
|
||||||
"none":"rien",
|
|
||||||
"reason":"raison"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Ungültiges Argument!",
|
|
||||||
"missingArgsDescription":"Fehlendes Argument!",
|
|
||||||
"noPermsTitle":"Du hast keine Rechte!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"Ungültige ID",
|
|
||||||
"chooseFromListDescription":"Wählen Sie eine der folgenden ID:",
|
|
||||||
"boterror":"Bot Fehler!",
|
|
||||||
"notInTicketTitle":"Du bist ein kein Ticket!",
|
|
||||||
"notInTicketDescription":"Der Befehl funktioniert nicht außerhalb eines Tickets!",
|
|
||||||
"ticketDoesntExist":"Das Ticket Exisitert nicht mehr!",
|
|
||||||
"roleDoesntExist":"Die Rolle Exisitiert nicht mehr!",
|
|
||||||
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
|
||||||
"maxAmountTitle":"Das Limit wurde erreicht!",
|
|
||||||
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neue erstellen.!",
|
|
||||||
"somethingWentWrong":"**Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
|
||||||
"somethingWentWrongTranscript":"Bei der Erstellung der Transcript ist etwas schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
|
||||||
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Eine Einbettung mit Schaltflächen erzeugen. (nur admins)",
|
|
||||||
"renameCmd":"Ein Ticket umbenennen. (keine Leerzeichen)",
|
|
||||||
"closeCmd":"Schließen Sie ein Ticket.",
|
|
||||||
"deleteCmd":"Ein Ticket löschen.",
|
|
||||||
"addCmd":"Fügen Sie dem Ticket einen Benutzer hinzu.",
|
|
||||||
"removeCmd":"Entfernen eines Benutzers aus dem Ticket.",
|
|
||||||
"reopenCmd":"Öffnen Sie ein Ticket erneut, nachdem es geschlossen wurde."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Ticket schließen",
|
|
||||||
"delete":"Ticket löschen",
|
|
||||||
"reopen":"Ticket wieder öffnen",
|
|
||||||
"sendTranscript":"Transcript-Datei senden"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Dieses Ticket wiedereröffnet!",
|
|
||||||
"reopenDescription":"Sie können gerne weiterreden!",
|
|
||||||
"closedTitle":"Dieses Ticket geschlossen!",
|
|
||||||
"closedDescription":"Nur Admins können jetzt in diesem Ticket sprechen!\n\n*Klicken Sie auf die Schaltfläche unten, um dieses Ticket zu löschen oder erneut zu öffnen!*",
|
|
||||||
"createdTitle":"Ticket erstellt!",
|
|
||||||
"createdDescription":"Ihr Ticket ist erstellt, Sie können es durch einen Ping erkennen!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Neues Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket schließen!",
|
|
||||||
"deletedTicketDmTitle":"Ticket löschen!",
|
|
||||||
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
|
||||||
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
|
||||||
"reopenTicketDmTitle":"Ticket neu Eröffnen!",
|
|
||||||
"reopenTicketDmDescription":"Dein Ticket ist Neu eröffnet!",
|
|
||||||
"newTranscriptTitle":"Eine neue Transscript finden Sie hier!",
|
|
||||||
"hereIsTheTranscript":"Hier ist das Transscript:",
|
|
||||||
|
|
||||||
"chooseCategory":"Wähle eine Kategorie:",
|
|
||||||
"gettingdeleted":"Ticket wird gelöscht...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Argumente Invalide",
|
|
||||||
"missingArgsDescription":"Argument Lipsa",
|
|
||||||
"noPermsTitle":"Nu ai permisiunea necesara!",
|
|
||||||
"noPermsDescription":"Ai nevoie de permisiunea de `ADMINISTRATOR`!",
|
|
||||||
"noPermsDelete":"Doar adminii pot inchide un ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Alege unul dintre id-urile urmatoare:",
|
|
||||||
"boterror":"Eroare bot!",
|
|
||||||
"notInTicketTitle":"Nu esti intr-un ticket!",
|
|
||||||
"notInTicketDescription":"Aceasta comanda nu merge inafara unui ticket!",
|
|
||||||
"ticketDoesntExist":"Acest ticket nu mai exista!",
|
|
||||||
"roleDoesntExist":"Acest rol nu mai exista!",
|
|
||||||
"anotherOption":"Aceasta optiune este altceva decat un tip de ticket!",
|
|
||||||
"maxAmountTitle":"Limita atinsa!",
|
|
||||||
"maxAmountDescription":"Ai atins limita de tickets!\nAsa ca nu mai poti creea altele noi!",
|
|
||||||
"somethingWentWrong":"**Ceva nu a mers bine!**\nTe rugam sa incerci mai tarziu!",
|
|
||||||
"somethingWentWrongTranscript":"Ceva nu aa mers bine in timpul creeari transcript-ului!**\nTe rugam sa incerci mai tarziu!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} a fost adaugat in acest ticket!",
|
|
||||||
"userRemovedTitle":"{0} a fost scos din acest ticket!",
|
|
||||||
"renameTitle":"Nume schimbat in {0}!",
|
|
||||||
"closeTitle":"Ticket inchis!",
|
|
||||||
"deleteTitle":"Se sterge ticket-ul...",
|
|
||||||
"reopenTitle":"Ticket Re-deschis!",
|
|
||||||
|
|
||||||
"ticketWarning":"Embed-ul se afla in mesajul de mai jos!",
|
|
||||||
"maxTicketWarning":"**Avertizare:** _Poti creea doar {0} tickete active!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Comenzi disponibile:",
|
|
||||||
"header1":"**Mergi la {0} pentru a creea un ticket!**\n\n",
|
|
||||||
"header2":"**Ruleaza comanda `/new` ori `/ticket` pentru a creea un ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Trimite embed-ul cu tickete. (doar admini)",
|
|
||||||
"renameCmd":"Redenumeste un ticket. (fara spatii)",
|
|
||||||
"closeCmd":"Inchide un ticket.",
|
|
||||||
"deleteCmd":"Sterge un ticket.",
|
|
||||||
"addCmd":"Adauga un utilizator in ticket.",
|
|
||||||
"removeCmd":"Sterge un utilizator din ticket.",
|
|
||||||
"reopenCmd":"Re-deschide un ticket dupa ce a fost deschis."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Inchide ticket-ul",
|
|
||||||
"delete":"Sterge ticket-ul",
|
|
||||||
"reopen":"Re-deschide un ticket",
|
|
||||||
"sendTranscript":"Transcript"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Ticket Re-deschis!",
|
|
||||||
"reopenDescription":"Poti vorbi din nou!",
|
|
||||||
"closedTitle":"Ticket inchis!",
|
|
||||||
"closedDescription":"Doar adminii pot vorbi in acest ticket acum!\n\n*Apasa pe butonul de mai jos pentru a re-deschide ori sterge ticket-ul!*",
|
|
||||||
"createdTitle":"Ticket Creat!",
|
|
||||||
"createdDescription":"Ticket-ul tau a fost creat, poti sa il vezi in canalul pe care ai fost mentionat!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Ticket nou!",
|
|
||||||
"closedTicketDmTitle":"Ticket Inchis!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Sters!",
|
|
||||||
"closedTicketDmDescription":"Ticket-ul tau este inchis!",
|
|
||||||
"deletedTicketDmDescription":"Ticket-ul tau este sters!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Re-deschis!",
|
|
||||||
"reopenTicketDmDescription":"Ticket-ul tau este re-deschis!",
|
|
||||||
"newTranscriptTitle":"Un nou transcript este aici!",
|
|
||||||
"hereIsTheTranscript":"Aici este transcriptul:",
|
|
||||||
|
|
||||||
"chooseCategory":"Alege o categorie:",
|
|
||||||
"gettingdeleted":"Ticket-ul se sterge...",
|
|
||||||
|
|
||||||
"none":"niciunul",
|
|
||||||
"reason":"Motiv"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"¡Argumentos inválidos!",
|
|
||||||
"missingArgsDescription":"Argumento faltante.",
|
|
||||||
"noPermsTitle":"¡Sin permisos!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"ID Invalida",
|
|
||||||
"chooseFromListDescription":"Elije una de las ID de abajo:",
|
|
||||||
"boterror":"¡Error del bot!",
|
|
||||||
"notInTicketTitle":"¡No te encuentras en un ticket!",
|
|
||||||
"notInTicketDescription":"¡Este comando no funciona fuera de los tickets!",
|
|
||||||
"ticketDoesntExist":"¡Este ticket no existe!",
|
|
||||||
"roleDoesntExist":"¡Este rol no existe!",
|
|
||||||
"anotherOption":"¡Esta opción no es un ticket, si no otra cosa!",
|
|
||||||
"maxAmountTitle":"¡Máxima cantidad alcanzada!",
|
|
||||||
"maxAmountDescription":"¡Has alcanzado la máxima cantidad de tickets permitida!\n¡Por lo que no puedes crear otro!",
|
|
||||||
"somethingWentWrong":"**¡Algo salió mal!**\n¡Prueba dentro de un rato!",
|
|
||||||
"somethingWentWrongTranscript":"**¡Algo salió mal al hacer el transcript!**\n¡Prueba en otro momento!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**¡Dirígete a {0} para crear un nuevo ticket!**\n\n",
|
|
||||||
"header2":"**¡Ejecuta el comando `/new` o `/ticket` para crear un ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Generar un embed con botones. (Solo admins)",
|
|
||||||
"renameCmd":"Renombrar un ticket. (Sin espacios)",
|
|
||||||
"closeCmd":"Cerrar un ticket.",
|
|
||||||
"deleteCmd":"Eliminar un ticket.",
|
|
||||||
"addCmd":"Agregar un usuario al ticket.",
|
|
||||||
"removeCmd":"Eliminar un usuario del ticket.",
|
|
||||||
"reopenCmd":"Re-Abre un ticket después de que este se vea cerrado."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Cerrar ticket.",
|
|
||||||
"delete":"Eliminar ticket",
|
|
||||||
"reopen":"Re-Abrir ticket",
|
|
||||||
"sendTranscript":"Obtener transcript."
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"¡Ticket Re-Abierto!",
|
|
||||||
"reopenDescription":"¡Siéntete libre de hablar de nuevo!",
|
|
||||||
"closedTitle":"¡Ticket cerrado!",
|
|
||||||
"closedDescription":"¡Solo admins pueden hablar ahora en este ticket!\n\n*¡Presiona en el botón de abajo para eliminar o re-abrir el ticket!*",
|
|
||||||
"createdTitle":"¡Ticket creado!",
|
|
||||||
"createdDescription":"¡Ticket creado, también te he mencionado en él!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"¡Nuevo ticket!",
|
|
||||||
"closedTicketDmTitle":"¡Ticket cerrado!",
|
|
||||||
"deletedTicketDmTitle":"¡Ticket eliminado!",
|
|
||||||
"closedTicketDmDescription":"¡Tu ticket fué cerrado!",
|
|
||||||
"deletedTicketDmDescription":"¡Tu ticket fué eliminado!",
|
|
||||||
"reopenTicketDmTitle":"¡Ticket re-abierto!",
|
|
||||||
"reopenTicketDmDescription":"¡Tu ticket se vió abierto de nuevo!",
|
|
||||||
"newTranscriptTitle":"¡Un nuevo transcript está aquí!",
|
|
||||||
"hereIsTheTranscript":"Aquí está el transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"elije una categoría:",
|
|
||||||
"gettingdeleted":"El ticket se está viendo eliminado...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,477 @@
|
|||||||
|
{
|
||||||
|
"_TRANSLATION":{
|
||||||
|
"otversion":"v4.0.0",
|
||||||
|
"translator":"DJj123dj",
|
||||||
|
"lastedited":"21/08/2024",
|
||||||
|
"language":"Custom"
|
||||||
|
},
|
||||||
|
"checker":{
|
||||||
|
"system":{
|
||||||
|
"typeError":"[ERROR]",
|
||||||
|
"headerOpenTicket":"OPEN TICKET",
|
||||||
|
"typeWarning":"[WARNING]",
|
||||||
|
"typeInfo":"[INFO]",
|
||||||
|
"headerConfigChecker":"CONFIG CHECKER",
|
||||||
|
"headerDescription":"check for errors in you config files!",
|
||||||
|
"footerError":"the bot won't start until all {0}'s are fixed!",
|
||||||
|
"footerWarning":"it's recommended to fix all {0}'s before starting!",
|
||||||
|
"footerSupport":"SUPPORT: {0} - DOCS: {1}",
|
||||||
|
"compactInformation":"use {0} for more information!",
|
||||||
|
"dataPath":"path",
|
||||||
|
"dataDocs":"docs",
|
||||||
|
"dataMessages":"message"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"stringTooShort":"This string can't be shorter than {0} characters!",
|
||||||
|
"stringTooLong":"This string can't be longer than {0} characters!",
|
||||||
|
"stringLengthInvalid":"This string needs to be {0} characters long!",
|
||||||
|
"stringStartsWith":"This string needs to start with {0}!",
|
||||||
|
"stringEndsWith":"This string needs to end with {0}!",
|
||||||
|
"stringContains":"This string needs to contain {0}!",
|
||||||
|
"stringChoices":"This string can only be one of the following values: {0}!",
|
||||||
|
"stringRegex":"This string is invalid!",
|
||||||
|
|
||||||
|
"numberTooShort":"This number can't be shorter than {0} characters!",
|
||||||
|
"numberTooLong":"This number can't be longer than {0} characters!",
|
||||||
|
"numberLengthInvalid":"This number needs to be {0} characters long!",
|
||||||
|
"numberTooSmall":"This number needs to be at least {0}!",
|
||||||
|
"numberTooLarge":"This number needs to be at most {0}!",
|
||||||
|
"numberNotEqual":"This number needs to be {0}!",
|
||||||
|
"numberStep":"This number needs to be a multiple of {0}!",
|
||||||
|
"numberStepOffset":"This number needs to be a multiple of {0} starting with {1}!",
|
||||||
|
"numberStartsWith":"This number needs to start with {0}!",
|
||||||
|
"numberEndsWith":"This number needs to end with {0}!",
|
||||||
|
"numberContains":"This number needs to contain {0}!",
|
||||||
|
"numberChoices":"This number can only be one of the following values: {0}!",
|
||||||
|
"numberFloat":"This number can't be a decimal!",
|
||||||
|
"numberNegative":"This number can't be negative!",
|
||||||
|
"numberPositive":"This number can't be positive!",
|
||||||
|
"numberZero":"This number can't be zero!",
|
||||||
|
|
||||||
|
"booleanTrue":"This boolean can't be true!",
|
||||||
|
"booleanFalse":"This boolean can't be false!",
|
||||||
|
|
||||||
|
"arrayEmptyDisabled":"This array isn't allowed to be empty!",
|
||||||
|
"arrayEmptyRequired":"This array is required to be empty!",
|
||||||
|
"arrayTooShort":"This array needs to have a length of at least {0}!",
|
||||||
|
"arrayTooLong":"This array needs to have a length of at most {0}!",
|
||||||
|
"arrayLengthInvalid":"This array needs to have a length of {0}!",
|
||||||
|
"arrayInvalidTypes":"This array can only contain the following types: {0}!",
|
||||||
|
"arrayDouble":"This array doesn't allow the same value twice!",
|
||||||
|
|
||||||
|
"discordInvalidId":"This is an invalid discord {0} id!",
|
||||||
|
"discordInvalidIdOptions":"This is an invalid discord {0} id! You can also use one of these: {1}!",
|
||||||
|
"discordInvalidToken":"This is an invalid discord token (syntactically)!",
|
||||||
|
"colorInvalid":"This is an invalid hex color!",
|
||||||
|
"emojiTooShort":"This string needs to have at least {0} emoji's!",
|
||||||
|
"emojiTooLong":"This string needs to have at most {0} emoji's!",
|
||||||
|
"emojiCustom":"This emoji can't be a custom discord emoji!",
|
||||||
|
"emojiInvalid":"This is an invalid emoji!",
|
||||||
|
"urlInvalid":"This url is invalid!",
|
||||||
|
"urlInvalidHttp":"This url can only use the https:// protocol!",
|
||||||
|
"urlInvalidProtocol":"This url can only use the http:// & https:// protocols!",
|
||||||
|
"urlInvalidHostname":"This url has a disallowed hostname!",
|
||||||
|
"urlInvalidExtension":"This url has an invalid extension! Choose between: {0}!",
|
||||||
|
"urlInvalidPath":"This url has an invalid path!",
|
||||||
|
"idNotUnique":"This id isn't unique, use another id instead!",
|
||||||
|
"idNonExistent":"The id {0} doesn't exist!",
|
||||||
|
|
||||||
|
"invalidType":"This property needs to be the type: {0}!",
|
||||||
|
"propertyMissing":"The property {0} is missing from this object!",
|
||||||
|
"propertyOptional":"The property {0} is optional in this object!",
|
||||||
|
"objectDisabled":"This object is disabled, enable it using {0}!",
|
||||||
|
"nullInvalid":"This property can't be null!",
|
||||||
|
"switchInvalidType":"This needs to be one of the following types: {0}!",
|
||||||
|
"objectSwitchInvalid":"This object needs to be one of the following types: {0}!",
|
||||||
|
|
||||||
|
"invalidLanguage":"This is an invalid language!",
|
||||||
|
"invalidButton":"This button needs to have at least an {0} or {1}!",
|
||||||
|
"unusedOption":"The option {0} isn't used anywhere!",
|
||||||
|
"unusedQuestion":"The question {0} isn't used anywhere!",
|
||||||
|
"dropdownOption":"A panel with dropdown enabled can only contain options of the 'ticket' type!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actions":{
|
||||||
|
"buttons":{
|
||||||
|
"create":"Visit Ticket",
|
||||||
|
"close":"Close Ticket",
|
||||||
|
"delete":"Delete Ticket",
|
||||||
|
"reopen":"Reopen Ticket",
|
||||||
|
"claim":"Claim Ticket",
|
||||||
|
"unclaim":"Unclaim Ticket",
|
||||||
|
"pin":"Pin Ticket",
|
||||||
|
"unpin":"Unpin Ticket",
|
||||||
|
"clear":"Delete Tickets",
|
||||||
|
"helpSwitchSlash":"View Slash Commands",
|
||||||
|
"helpSwitchText":"View Text Commands",
|
||||||
|
"helpPage":"Page {0}",
|
||||||
|
"withReason":"With Reason",
|
||||||
|
"withoutTranscript":"Without Transcript"
|
||||||
|
},
|
||||||
|
"titles":{
|
||||||
|
"created":"Ticket Created",
|
||||||
|
"close":"Ticket Closed",
|
||||||
|
"delete":"Ticket Deleted",
|
||||||
|
"reopen":"Ticket Reopened",
|
||||||
|
"claim":"Ticket Claimed",
|
||||||
|
"unclaim":"Ticket Unclaimed",
|
||||||
|
"pin":"Ticket Pinned",
|
||||||
|
"unpin":"Ticket Unpinned",
|
||||||
|
"rename":"Ticket Renamed",
|
||||||
|
"move":"Ticket Moved",
|
||||||
|
"add":"Ticket User Added",
|
||||||
|
"remove":"Ticket User Removed",
|
||||||
|
|
||||||
|
"help":"Available Commands",
|
||||||
|
"statsReset":"Reset Stats",
|
||||||
|
"blacklistAdd":"User Blacklisted",
|
||||||
|
"blacklistRemove":"User Released",
|
||||||
|
"blacklistGet":"Blacklisted User",
|
||||||
|
"blacklistView":"Current Blacklist",
|
||||||
|
"blacklistAddDm":"Added To Blacklist",
|
||||||
|
"blacklistRemoveDm":"Removed From Blacklist",
|
||||||
|
"clear":"Tickets Cleared",
|
||||||
|
"roles":"Roles Updated",
|
||||||
|
|
||||||
|
"autoclose":"Ticket Autoclosed",
|
||||||
|
"autocloseEnabled":"Autoclose Enabled",
|
||||||
|
"autocloseDisabled":"Autoclose Disabled",
|
||||||
|
"autodelete":"Ticket Autodeleted",
|
||||||
|
"autodeleteEnabled":"Autodelete Enabled",
|
||||||
|
"autodeleteDisabled":"Autodelete Disabled"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"create":"Your ticket has been created. Click the button below to access it!",
|
||||||
|
"close":"The ticket has been closed succesfully!",
|
||||||
|
"delete":"The ticket has been deleted succesfully!",
|
||||||
|
"reopen":"The ticket has been reopened succesfully!",
|
||||||
|
"claim":"The ticket has been claimed succesfully!",
|
||||||
|
"unclaim":"The ticket has been unclaimed succesfully!",
|
||||||
|
"pin":"The ticket has been pinned succesfully!",
|
||||||
|
"unpin":"The ticket has been unpinned succesfully!",
|
||||||
|
"rename":"The ticket has been renamed to {0} succesfully!",
|
||||||
|
"move":"The ticket has been moved to {0} succesfully!",
|
||||||
|
"add":"{0} has been added to the ticket succesfully!",
|
||||||
|
"remove":"{0} has been removed from the ticket succesfully!",
|
||||||
|
|
||||||
|
"helpExplanation":"`<name>` => required parameter\n`[name]` => optional parameter",
|
||||||
|
"statsReset":"The bot stats have been reset successfully!",
|
||||||
|
"statsError":"Unable to view ticket stats!\n{0} is not a ticket!",
|
||||||
|
"blacklistAdd":"{0} has been blacklisted successfully!",
|
||||||
|
"blacklistRemove":"{0} has been released successfully!",
|
||||||
|
"blacklistGetSuccess":"{0} is currently blacklisted!",
|
||||||
|
"blacklistGetEmpty":"{0} is currently not blacklisted!",
|
||||||
|
"blacklistViewEmpty":"No-one has been blacklisted yet!",
|
||||||
|
"blacklistViewTip":"Use \"/blacklist add\" to blacklist a user!",
|
||||||
|
"clearVerify":"Are you sure you want to delete multiple tickets?\nThis action can't be undone!",
|
||||||
|
"clearReady":"{0} tickets have been deleted succesfully!",
|
||||||
|
"rolesEmpty":"No roles have been updated!",
|
||||||
|
|
||||||
|
"autocloseLeave":"This ticket has been autoclosed because the creator left the server!",
|
||||||
|
"autocloseTimeout":"This ticket has been autoclosed because it has been inactive for more than `{0}h`!",
|
||||||
|
"autodeleteLeave":"This ticket has been autodeleted because the creator left the server!",
|
||||||
|
"autodeleteTimeout":"This ticket has been autodeleted because it has been inactive for more than `{0} days`!",
|
||||||
|
"autocloseEnabled":"Autoclose has been enabled in this ticket!\nIt will be closed when it is inactive for more than `{0}h`!",
|
||||||
|
"autocloseDisabled":"Autoclose has been disabled in this ticket!\nIt won't be closed automatically anymore!",
|
||||||
|
"autodeleteEnabled":"Autodelete has been enabled in this ticket!\nIt will be deleted when it is inactive for more than `{0} days`!",
|
||||||
|
"autodeleteDisabled":"Autodelete has been disabled in this ticket!\nIt won't be deleted automatically anymore!",
|
||||||
|
|
||||||
|
"ticketMessageLimit":"You can only create {0} ticket(s) at the same time!",
|
||||||
|
"ticketMessageAutoclose":"This ticket will be autoclosed when inactive for {0}h!",
|
||||||
|
"ticketMessageAutodelete":"This ticket will be autodeleted when inactive for {0} days!",
|
||||||
|
"panelReady":"You can find the panel below!\nThis message can now be deleted!"
|
||||||
|
},
|
||||||
|
"modal":{
|
||||||
|
"closePlaceholder":"Why did you close this ticket?",
|
||||||
|
"deletePlaceholder":"Why did you delete this ticket?",
|
||||||
|
"reopenPlaceholder":"Why did you reopen this ticket?",
|
||||||
|
"claimPlaceholder":"Why did you claim this ticket?",
|
||||||
|
"unclaimPlaceholder":"Why did you unclaim this ticket?",
|
||||||
|
"pinPlaceholder":"Why did you pin this ticket?",
|
||||||
|
"unpinPlaceholder":"Why did you unpin this ticket?"
|
||||||
|
},
|
||||||
|
"logs":{
|
||||||
|
"createLog":"A new ticket got created by {0}!",
|
||||||
|
"closeLog":"This ticket has been closed by {0}!",
|
||||||
|
"closeDm":"Your ticket has been closed in our server!",
|
||||||
|
"deleteLog":"This ticket has been deleted by {0}!",
|
||||||
|
"deleteDm":"Your ticket has been deleted in our server!",
|
||||||
|
"reopenLog":"This ticket has been reopened by {0}!",
|
||||||
|
"reopenDm":"Your ticket has been reopened in our server!",
|
||||||
|
"claimLog":"This ticket has been claimed by {0}!",
|
||||||
|
"claimDm":"Your ticket has been claimed in our server!",
|
||||||
|
"unclaimLog":"This ticket has been unclaimed by {0}!",
|
||||||
|
"unclaimDm":"Your ticket has been unclaimed in our server!",
|
||||||
|
"pinLog":"This ticket has been pinned by {0}!",
|
||||||
|
"pinDm":"Your ticket has been pinned in our server!",
|
||||||
|
"unpinLog":"This ticket has been unpinned by {0}!",
|
||||||
|
"unpinDm":"Your ticket has been unpinned in our server!",
|
||||||
|
"renameLog":"This ticket has been renamed to {0} by {1}!",
|
||||||
|
"renameDm":"Your ticket has been renamed to {0} in our server!",
|
||||||
|
"moveLog":"This ticket has been moved to {0} by {1}!",
|
||||||
|
"moveDm":"Your ticket has been moved to {0} in our server!",
|
||||||
|
"addLog":"{0} has been added to this ticket by {1}!",
|
||||||
|
"addDm":"{0} has been added to your ticket in our server!",
|
||||||
|
"removeLog":"{0} has been removed from this ticket by {1}!",
|
||||||
|
"removeDm":"{0} has been removed from your ticket in our server!",
|
||||||
|
|
||||||
|
"blacklistAddLog":"{0} was blacklisted by {1}!",
|
||||||
|
"blacklistRemoveLog":"{0} was removed from the blacklist by {1}!",
|
||||||
|
"blacklistAddDm":"You have been blacklisted in our server!\nFrom now on, you are unable to create a ticket!",
|
||||||
|
"blacklistRemoveDm":"You have been removed from the blacklist in our server!\nNow you can create tickets again!",
|
||||||
|
"clearLog":"{0} tickets have been deleted by {1}!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"success":{
|
||||||
|
"visit":"Visit Transcript",
|
||||||
|
"ready":"Transcript Created",
|
||||||
|
"textFileDescription":"This is the text transcript of a deleted ticket!",
|
||||||
|
"htmlProgress":"Please wait while this html transcript is getting processed...",
|
||||||
|
|
||||||
|
"createdChannel":"A new {0} transcript has been created in the server!",
|
||||||
|
"createdCreator":"A new {0} transcript has been created for one of your tickets!",
|
||||||
|
"createdParticipant":"A new {0} transcript has been created in one of the tickets you participated in!",
|
||||||
|
"createdActiveAdmin":"A new {0} transcript has been created in one of the tickets you participated as admin!",
|
||||||
|
"createdEveryAdmin":"A new {0} transcript has been created in one of the tickets you were admin in!",
|
||||||
|
"createdOther":"A new {0} transcript has been created!"
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"retry":"Retry",
|
||||||
|
"continue":"Delete Without Transcript",
|
||||||
|
"backup":"Create Backup Transcript",
|
||||||
|
"error":"Something went wrong while trying to create the transcript.\nWhat would you like to do?\n\nThis ticket won't be deleted until you click one of these buttons."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"titles":{
|
||||||
|
"internalError":"Internal Error",
|
||||||
|
"optionMissing":"Command Option Missing",
|
||||||
|
"optionInvalid":"Command Option Invalid",
|
||||||
|
"unknownCommand":"Unknown Command",
|
||||||
|
"noPermissions":"No Permissions",
|
||||||
|
"unknownTicket":"Unknown Ticket",
|
||||||
|
"deprecatedTicket":"Deprecated Ticket",
|
||||||
|
"unknownOption":"Unknown Option",
|
||||||
|
"unknownPanel":"Unknown Panel",
|
||||||
|
"notInGuild":"Not In Server",
|
||||||
|
"channelRename":"Unable To Rename Channel",
|
||||||
|
"busy":"Ticket Is Busy"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"askForInfo":"Contact the owner of this bot for more info!",
|
||||||
|
"askForInfoResolve":"Contact the bot owner of this bot if this issue doesn't resolve after a few tries.",
|
||||||
|
"internalError":"Failed to respond to this {0} due to an internal error!",
|
||||||
|
"optionMissing":"A required parameter is missing in this command!",
|
||||||
|
"optionInvalid":"A parameter in this command is invalid!",
|
||||||
|
"optionInvalidChoose":"Choose between",
|
||||||
|
"unknownCommand":"Try visiting the help menu for more info!",
|
||||||
|
"noPermissions":"You are not allowed to use this {0}!",
|
||||||
|
"noPermissionsList":"Required Permissions: (one of them)",
|
||||||
|
"noPermissionsCooldown":"You are not allowed to use this {0} because you have a cooldown!",
|
||||||
|
"noPermissionsBlacklist":"You are not allowed to use this {0} because you have been blacklisted!",
|
||||||
|
"noPermissionsLimitGlobal":"You are not allowed to create a ticket because the server reached the max tickets limit!",
|
||||||
|
"noPermissionsLimitGlobalUser":"You are not allowed to create a ticket because you reached the max tickets limit!",
|
||||||
|
"noPermissionsLimitOption":"You are not allowed to create a ticket because the server reached the max tickets limit for this option!",
|
||||||
|
"noPermissionsLimitOptionUser":"You are not allowed to create a ticket because you reached the max tickets limit for this option!",
|
||||||
|
"unknownTicket":"Try this command again in a valid ticket!",
|
||||||
|
"deprecatedTicket":"The current channel is not a valid ticket! It might have been a ticket from an old Open Ticket version!",
|
||||||
|
"notInGuild":"This {0} doesn't work in DM! Please try it again in a server!",
|
||||||
|
"channelRename":"Due to discord ratelimits, it's currently impossible for the bot to rename the channel. The channel will automatically be renamed over 10 minutes if the bot isn't rebooted.",
|
||||||
|
"channelRenameSource":"The source of this error is: {0}",
|
||||||
|
"busy":"Unable to use this {0}!\nThe ticket is currently being processed by the bot.\n\nPlease try again in a few seconds!"
|
||||||
|
},
|
||||||
|
"optionInvalidReasons":{
|
||||||
|
"stringRegex":"Value doesn't match pattern!",
|
||||||
|
"stringMinLength":"Value needs to be at least {0} characters!",
|
||||||
|
"stringMaxLength":"Value needs to be at most {0} characters!",
|
||||||
|
"numberInvalid":"Invalid number!",
|
||||||
|
"numberMin":"Number needs to be at least {0}!",
|
||||||
|
"numberMax":"Number needs to be at most {0}!",
|
||||||
|
"numberDecimal":"Number is not allowed to be a decimal!",
|
||||||
|
"numberNegative":"Number is not allowed to be negative!",
|
||||||
|
"numberPositive":"Number is not allowed to be positive!",
|
||||||
|
"numberZero":"Number is not allowed to be zero!",
|
||||||
|
"channelNotFound":"Unable to find channel!",
|
||||||
|
"userNotFound":"Unable to find user!",
|
||||||
|
"roleNotFound":"Unable to find role!",
|
||||||
|
"memberNotFound":"Unable to find user!",
|
||||||
|
"mentionableNotFound":"Unable to find user or role!",
|
||||||
|
"channelType":"Invalid channel type!",
|
||||||
|
"notInGuild":"This option requires you to be in a server!"
|
||||||
|
},
|
||||||
|
"permissions":{
|
||||||
|
"developer":"You need to be the developer of the bot.",
|
||||||
|
"owner":"You need to be the server owner.",
|
||||||
|
"admin":"You need to be a server admin.",
|
||||||
|
"moderator":"You need to be a moderator.",
|
||||||
|
"support":"You need to be in the support team.",
|
||||||
|
"member":"You need to be a member.",
|
||||||
|
"discord-administrator":"You need to have the `ADMINISTRATOR` permission."
|
||||||
|
},
|
||||||
|
"actionInvalid":{
|
||||||
|
"close":"Ticket is already closed!",
|
||||||
|
"reopen":"Ticket is not closed yet!",
|
||||||
|
"claim":"Ticket is already claimed!",
|
||||||
|
"unclaim":"Ticket is not claimed yet!",
|
||||||
|
"pin":"Ticket is already pinned!",
|
||||||
|
"unpin":"Ticket is not pinned yet!",
|
||||||
|
"add":"This user is already able to access the ticket!",
|
||||||
|
"remove":"Unable to remove this user from the ticket!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"params":{
|
||||||
|
"uppercase":{
|
||||||
|
"ticket":"Ticket",
|
||||||
|
"tickets":"Tickets",
|
||||||
|
"reason":"Reason",
|
||||||
|
"creator":"Creator",
|
||||||
|
"remaining":"Time Remaining",
|
||||||
|
"added":"Added",
|
||||||
|
"removed":"Removed",
|
||||||
|
"filter":"Filter",
|
||||||
|
"claimedBy":"Claimed By {0}",
|
||||||
|
"method":"Method",
|
||||||
|
"type":"Type",
|
||||||
|
"blacklisted":"Blacklisted",
|
||||||
|
"panel":"Panel",
|
||||||
|
"command":"Command",
|
||||||
|
"system":"System",
|
||||||
|
"true":"True",
|
||||||
|
"false":"False",
|
||||||
|
"syntax":"Syntax",
|
||||||
|
"originalName":"Original Name",
|
||||||
|
"newName":"New Name",
|
||||||
|
"until":"Until",
|
||||||
|
"validOptions":"Valid Options",
|
||||||
|
"validPanels":"Valid Panels",
|
||||||
|
"autoclose":"Autoclose",
|
||||||
|
"autodelete":"Autodelete",
|
||||||
|
"startupDate":"Startup Date",
|
||||||
|
"version":"Version",
|
||||||
|
"name":"Name",
|
||||||
|
"role":"Role",
|
||||||
|
"status":"Status",
|
||||||
|
"claimed":"Claimed",
|
||||||
|
"pinned":"Pinned",
|
||||||
|
"creationDate":"Creation Date"
|
||||||
|
},
|
||||||
|
"lowercase":{
|
||||||
|
"text":"text",
|
||||||
|
"html":"html",
|
||||||
|
"command":"command",
|
||||||
|
"modal":"modal",
|
||||||
|
"button":"button",
|
||||||
|
"dropdown":"dropdown",
|
||||||
|
"method":"method"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"reason":"Specify an optional reason that will be visible in logs.",
|
||||||
|
"help":"Get a list of all the available commands.",
|
||||||
|
"panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
|
||||||
|
"panelId":"The identifier of the panel that you want to spawn.",
|
||||||
|
"panelAutoUpdate":"Do you want this panel to automatically update when edited?",
|
||||||
|
"ticket":"Instantly create a ticket.",
|
||||||
|
"ticketId":"The identifier of the ticket that you want to create.",
|
||||||
|
"close":"Close a ticket.",
|
||||||
|
"delete":"Delete a ticket.",
|
||||||
|
"deleteNoTranscript":"Delete this ticket without creating a transcript.",
|
||||||
|
"reopen":"Reopen a ticket.",
|
||||||
|
"claim":"Claim a ticket.",
|
||||||
|
"claimUser":"Claim this ticket to someone else instead of yourself.",
|
||||||
|
"unclaim":"Unclaim a ticket.",
|
||||||
|
"pin":"Pin a ticket.",
|
||||||
|
"unpin":"Unpin a ticket.",
|
||||||
|
"move":"Move a ticket.",
|
||||||
|
"moveId":"The identifier of the option that you want to move to.",
|
||||||
|
"rename":"Rename a ticket.",
|
||||||
|
"renameName":"The new name for this ticket.",
|
||||||
|
"add":"Add a user to a ticket.",
|
||||||
|
"addUser":"The user to add.",
|
||||||
|
"remove":"Remove a user from a ticket.",
|
||||||
|
"removeUser":"The user to remove.",
|
||||||
|
"blacklist":"Manage the ticket blacklist.",
|
||||||
|
"blacklistView":"View a list of the current blacklist.",
|
||||||
|
"blacklistAdd":"Add a user to the blacklist.",
|
||||||
|
"blacklistRemove":"Remove a user from the blacklist.",
|
||||||
|
"blacklistGet":"Get the details from a blacklisted user.",
|
||||||
|
"blacklistGetUser":"The user to get details from.",
|
||||||
|
"stats":"View statistics from the bot, a member or a ticket.",
|
||||||
|
"statsReset":"Reset all the stats of the bot (and start counting from zero).",
|
||||||
|
"statsGlobal":"View the global stats.",
|
||||||
|
"statsUser":"View the stats from a user in the server.",
|
||||||
|
"statsUserUser":"The user to view.",
|
||||||
|
"statsTicket":"View the stats of a ticket in the server.",
|
||||||
|
"statsTicketTicket":"The ticket to view.",
|
||||||
|
"clear":"Delete multiple tickets at the same time.",
|
||||||
|
"clearFilter":"The filter for clearing tickets.",
|
||||||
|
"clearFilters":{
|
||||||
|
"all":"All",
|
||||||
|
"open":"Open",
|
||||||
|
"close":"Closed",
|
||||||
|
"claim":"Claimed",
|
||||||
|
"unclaim":"Unclaimed",
|
||||||
|
"pin":"Pinned",
|
||||||
|
"unpin":"Unpinned",
|
||||||
|
"autoclose":"Autoclosed"
|
||||||
|
},
|
||||||
|
"autoclose":"Manage autoclose in a ticket.",
|
||||||
|
"autocloseDisable":"Disable autoclose in this ticket.",
|
||||||
|
"autocloseEnable":"Enable autoclose in this ticket.",
|
||||||
|
"autocloseEnableTime":"The amount of hours this ticket needs to be inactive to close it.",
|
||||||
|
"autodelete":"Manage autodelete in a ticket.",
|
||||||
|
"autodeleteDisable":"Disable autodelete in this ticket.",
|
||||||
|
"autodeleteEnable":"Enable autodelete in this ticket.",
|
||||||
|
"autodeleteEnableTime":"The amount of days this ticket needs to be inactive to delete it."
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"help":"Get a list of all the available commands.",
|
||||||
|
"ticket":"Instantly create a ticket.",
|
||||||
|
"close":"Close a ticket, this disables writing in this channel.",
|
||||||
|
"delete":"Delete a ticket, this creates a transcript when enabled.",
|
||||||
|
"reopen":"Reopen a ticket, this enables writing in this channel again.",
|
||||||
|
"pin":"Pin a ticket. This will move the ticket to the top and will add a '📌' emoij to the name.",
|
||||||
|
"unpin":"Unpin a ticket. The ticket will stay on it's position but will lose the '📌' emoij.",
|
||||||
|
"move":"Move a ticket. This will change the type of this ticket.",
|
||||||
|
"rename":"Rename a ticket. This will change the channel name of this ticket.",
|
||||||
|
"claim":"Claim a ticket. With this, you can let your team know you are handling this ticket.",
|
||||||
|
"unclaim":"Unclaim a ticket. With this, you can let your team know that this ticket is free again.",
|
||||||
|
"add":"Add a user to a ticket. This will allow the user to read & write in this ticket.",
|
||||||
|
"remove":"Remove a user from a ticket. This will remove the ability to read & write for a user in this ticket.",
|
||||||
|
"panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
|
||||||
|
"blacklistView":"View a list of the current blacklist.",
|
||||||
|
"blacklistAdd":"Add a user to the blacklist.",
|
||||||
|
"blacklistRemove":"Remove a user from the blacklist.",
|
||||||
|
"blacklistGet":"Get the details from a blacklisted user.",
|
||||||
|
"statsGlobal":"View the global stats.",
|
||||||
|
"statsTicket":"View the stats of a ticket in the server.",
|
||||||
|
"statsUser":"View the stats from a user in the server.",
|
||||||
|
"statsReset":"Reset all the stats of the bot (and start counting from zero).",
|
||||||
|
"autocloseDisable":"Disable autoclose in this ticket.",
|
||||||
|
"autocloseEnable":"Enable autoclose in this ticket.",
|
||||||
|
"autodeleteDisable":"Disable autodelete in this ticket.",
|
||||||
|
"autodeleteEnable":"Enable autodelete in this ticket."
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"scopes":{
|
||||||
|
"global":"Global Stats",
|
||||||
|
"system":"System Stats",
|
||||||
|
"user":"User Stats",
|
||||||
|
"ticket":"Ticket Stats",
|
||||||
|
"participants":"Participants"
|
||||||
|
},
|
||||||
|
"properties":{
|
||||||
|
"ticketsCreated":"Tickets Created",
|
||||||
|
"ticketsClosed":"Tickets Closed",
|
||||||
|
"ticketsDeleted":"Tickets Deleted",
|
||||||
|
"ticketsReopened":"Tickets Reopened",
|
||||||
|
"ticketsAutoclosed":"Tickets Autoclosed",
|
||||||
|
"ticketsClaimed":"Tickets Claimed",
|
||||||
|
"ticketsPinned":"Tickets Pinned",
|
||||||
|
"ticketsMoved":"Tickets Moved",
|
||||||
|
"usersBlacklisted":"Users Blacklisted",
|
||||||
|
"transcriptsCreated":"Transcripts Created"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,477 @@
|
|||||||
|
{
|
||||||
|
"_TRANSLATION":{
|
||||||
|
"otversion":"v4.0.0",
|
||||||
|
"translator":"spyeye_",
|
||||||
|
"lastedited":"21/08/2024",
|
||||||
|
"language":"Czech"
|
||||||
|
},
|
||||||
|
"checker":{
|
||||||
|
"system":{
|
||||||
|
"typeError":"[ERROR]",
|
||||||
|
"headerOpenTicket":"OPEN TICKET",
|
||||||
|
"typeWarning":"[WARNING]",
|
||||||
|
"typeInfo":"[INFO]",
|
||||||
|
"headerConfigChecker":"CONFIG CHECKER",
|
||||||
|
"headerDescription":"kontrola chyb v konfiguračních souborech!",
|
||||||
|
"footerError":"Bot se nespustí, dokud všechny {0} nebudou opraveny!",
|
||||||
|
"footerWarning":"Doporučejeme opravit všechny {0} před spuštěním!",
|
||||||
|
"footerSupport":"PODPORA: {0} - DOKUMENTACE: {1}",
|
||||||
|
"compactInformation":"Použij {0} pro více informací!",
|
||||||
|
"dataPath":"path",
|
||||||
|
"dataDocs":"docs",
|
||||||
|
"dataMessages":"message"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"stringTooShort":"Tento string nesmí být kratší než {0} znaků!",
|
||||||
|
"stringTooLong":"Tento string nesmí být delší než {0} znaků!",
|
||||||
|
"stringLengthInvalid":"Tento string musí mít délku {0} znaků!",
|
||||||
|
"stringStartsWith":"Tento string musí začínat {0}!",
|
||||||
|
"stringEndsWith":"Tento string musí končit {0}!",
|
||||||
|
"stringContains":"Tento string musí obsahovat {0}!",
|
||||||
|
"stringChoices":"Tento string může být pouze jednou z následujících možností: {0}!",
|
||||||
|
"stringRegex":"Tento string je neplatný!",
|
||||||
|
|
||||||
|
"numberTooShort":"Toto číslo nesmí být kratší než {0} znaků!",
|
||||||
|
"numberTooLong":"Toto číslo nesmí být delší než {0} znaků.!",
|
||||||
|
"numberLengthInvalid":"Toto číslo musí mít délku {0} znaků.!",
|
||||||
|
"numberTooSmall":"Toto číslo musí být alespoň {0}.!",
|
||||||
|
"numberTooLarge":"Toto číslo musí být nejvýše {0}!",
|
||||||
|
"numberNotEqual":"Toto číslo musí být {0}!",
|
||||||
|
"numberStep":"Toto číslo musí být násobkem {0}.!",
|
||||||
|
"numberStepOffset":"Toto číslo musí být násobkem {0} žačínající {1}.!",
|
||||||
|
"numberStartsWith":"Toto číslo musí začínat {0}!",
|
||||||
|
"numberEndsWith":"Toto číslo musí končit {0}!",
|
||||||
|
"numberContains":"Toto číslo musí obsahovat {0}!",
|
||||||
|
"numberChoices":"Toto číslo může být pouze jedno z následujících hodnot: {0}!",
|
||||||
|
"numberFloat":"Toto číslo nemůže být desetinné!",
|
||||||
|
"numberNegative":"Toto číslo nemůže být záporné!",
|
||||||
|
"numberPositive":"Toto číslo nemůže být kladné!",
|
||||||
|
"numberZero":"Toto číslo nemůže být nula!",
|
||||||
|
|
||||||
|
"booleanTrue":"Tento boolean nemůže být true!",
|
||||||
|
"booleanFalse":"Tento boolean nemůže být false!",
|
||||||
|
|
||||||
|
"arrayEmptyDisabled":"Toto pole nesmí být prázdné.!",
|
||||||
|
"arrayEmptyRequired":"Toto pole musí být prázdné!",
|
||||||
|
"arrayTooShort":"Toto pole musí mít délku alespoň {0}!",
|
||||||
|
"arrayTooLong":"Toto pole musí mít délku maximálně {0}!",
|
||||||
|
"arrayLengthInvalid":"Toto pole musí mít délku {0}!",
|
||||||
|
"arrayInvalidTypes":"Toto pole může obsahovat pouze následující typy: {0}!",
|
||||||
|
"arrayDouble":"Toto pole neumožňuje zadat stejnou hodnotu dvakrát.!",
|
||||||
|
|
||||||
|
"discordInvalidId":"Toto je neplatné discord {0} id!",
|
||||||
|
"discordInvalidIdOptions":"Toto je neplatné Discord ID {0}! Můžete také použít jeden z těchto: {1}!",
|
||||||
|
"discordInvalidToken":"Toto je neplatný discord token (syntakticky)!",
|
||||||
|
"colorInvalid":"Toto je neplatná hex barva!",
|
||||||
|
"emojiTooShort":"Tento string musí obsahovat alespoň {0} emotikonů.!",
|
||||||
|
"emojiTooLong":"Tento string musí obsahovat nejvýše {0} emotikonů.!",
|
||||||
|
"emojiCustom":"Tento emotikon nemůže být custom emotikon!",
|
||||||
|
"emojiInvalid":"Toto je neplatný emotikon!",
|
||||||
|
"urlInvalid":"Tato url adresa je neplatná!",
|
||||||
|
"urlInvalidHttp":"Tato url může používat pouze protokol https://!",
|
||||||
|
"urlInvalidProtocol":"Tato url může používat pouze protokoly http:// a https://!",
|
||||||
|
"urlInvalidHostname":"Tato url má zakázané hostitelské jméno!",
|
||||||
|
"urlInvalidExtension":"Tato url má neplatnou příponu! Vyberte si mezi: {0}!",
|
||||||
|
"urlInvalidPath":"Tato url má neplatnou cestu!",
|
||||||
|
"idNotUnique":"Toto id není jedinečné, místo něj použijte jiné id!",
|
||||||
|
"idNonExistent":"Id {0} neexistuje!",
|
||||||
|
|
||||||
|
"invalidType":"Toto nastavení musí být typu: {0}!",
|
||||||
|
"propertyMissing":"U tohoto objektu chybí vlastnost {0}!",
|
||||||
|
"propertyOptional":"Vlastnost {0} je v tomto objektu nepovinná!",
|
||||||
|
"objectDisabled":"Tento objekt je zakázán, povolte jej pomocí {0}!",
|
||||||
|
"nullInvalid":"Tato vlastnost nemůže být nulová!",
|
||||||
|
"switchInvalidType":"Musí se jednat o jeden z následujících typů: {0}!",
|
||||||
|
"objectSwitchInvalid":"Tento objekt musí být jednoho z následujících typů: {0}!",
|
||||||
|
|
||||||
|
"invalidLanguage":"Jedná se o neplatný jazyk!",
|
||||||
|
"invalidButton":"Toto tlačítko musí mít alespoň {0} nebo {1}!",
|
||||||
|
"unusedOption":"Možnost {0} se nikde nepoužívá!",
|
||||||
|
"unusedQuestion":"Otázka {0} není nikde použita!",
|
||||||
|
"dropdownOption":"Panel s povoleným rozevíracím seznamem může obsahovat pouze možnosti typu „ticketu“!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actions":{
|
||||||
|
"buttons":{
|
||||||
|
"create":"Zobrazit ticket",
|
||||||
|
"close":"Uzavřít ticket",
|
||||||
|
"delete":"Vymazat ticket",
|
||||||
|
"reopen":"Znovu otevřít ticket",
|
||||||
|
"claim":"Převzít ticket",
|
||||||
|
"unclaim":"Zrušit převzetí ticketu",
|
||||||
|
"pin":"Připnout ticket",
|
||||||
|
"unpin":"Odepnout ticket",
|
||||||
|
"clear":"Vymazat tickety",
|
||||||
|
"helpSwitchSlash":"Zobrazit slash příkazy",
|
||||||
|
"helpSwitchText":"Zobrazit textové příkazy",
|
||||||
|
"helpPage":"Strana {0}",
|
||||||
|
"withReason":"S důvodem",
|
||||||
|
"withoutTranscript":"Bez důvodu"
|
||||||
|
},
|
||||||
|
"titles":{
|
||||||
|
"created":"Ticket vytvořen",
|
||||||
|
"close":"Ticket uzavřen",
|
||||||
|
"delete":"Ticket vymazán",
|
||||||
|
"reopen":"Ticket znovu otevřen",
|
||||||
|
"claim":"Ticket převzat",
|
||||||
|
"unclaim":"Ticket již není převezmut",
|
||||||
|
"pin":"Ticket připnut",
|
||||||
|
"unpin":"Ticket odepnut",
|
||||||
|
"rename":"Ticket přejmenován",
|
||||||
|
"move":"Ticket přesunut",
|
||||||
|
"add":"Uživatel přidán",
|
||||||
|
"remove":"Uživatel odebrán",
|
||||||
|
|
||||||
|
"help":"Dostupné příkazy:",
|
||||||
|
"statsReset":"Resetovat statistiky",
|
||||||
|
"blacklistAdd":"Uživatel blacklistován",
|
||||||
|
"blacklistRemove":"Uživatel odebrán z blacklistu",
|
||||||
|
"blacklistGet":"Uživatel na blacklistu",
|
||||||
|
"blacklistView":"Aktuální blacklist",
|
||||||
|
"blacklistAddDm":"Přidán na blacklistu",
|
||||||
|
"blacklistRemoveDm":"Odebrán z blacklistu",
|
||||||
|
"clear":"Tickety vyčištěny",
|
||||||
|
"roles":"Role aktualizovány",
|
||||||
|
|
||||||
|
"autoclose":"Ticket automaticky uzavřen",
|
||||||
|
"autocloseEnabled":"Automatické uzavření povoleno",
|
||||||
|
"autocloseDisabled":"Automatické uzavření zakázáno",
|
||||||
|
"autodelete":"Ticket automaticky vymazán",
|
||||||
|
"autodeleteEnabled":"Automatické mazání povoleno",
|
||||||
|
"autodeleteDisabled":"Automatické mazání zakázáno"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"create":"Tvůj ticket byl vytvořen. Klikni na tlačítko pod zprávou pro zobrazení!",
|
||||||
|
"close":"Ticket byl úspěšně uzavřen!",
|
||||||
|
"delete":"Ticket byl úspěšně vymazán!",
|
||||||
|
"reopen":"Ticket byl úspěšně znovu otevřen!",
|
||||||
|
"claim":"Ticket byl úspěšně převzat!",
|
||||||
|
"unclaim":"Ticket již není převezmut!",
|
||||||
|
"pin":"Ticket byl úspěšně připnut!",
|
||||||
|
"unpin":"Ticket byl úspěšně odepnut!",
|
||||||
|
"rename":"Ticket byl úspěšně přejmenován na {0}!",
|
||||||
|
"move":"Ticket byl úspěšně přesunut do {0}!",
|
||||||
|
"add":"{0} byl úspěšně přidán do ticketu!",
|
||||||
|
"remove":"{0} byl úspěšně odstraněn z ticketu!",
|
||||||
|
|
||||||
|
"helpExplanation":"`<name>` => povinný parametr\n`[name]` => nepovinný parametr",
|
||||||
|
"statsReset":"Statistiky bota byly úspěšně resetovány!",
|
||||||
|
"statsError":"Nelze zobrazit statistiky ticketu!\n{0} není ticket!",
|
||||||
|
"blacklistAdd":"{0} byl přídán na blacklist!",
|
||||||
|
"blacklistRemove":"{0} byl odebrán z blacklistu!",
|
||||||
|
"blacklistGetSuccess":"{0} je nyní na blacklistu!",
|
||||||
|
"blacklistGetEmpty":"{0} nyní není na blacklistu!",
|
||||||
|
"blacklistViewEmpty":"Na blacklistu ještě nikdo není",
|
||||||
|
"blacklistViewTip":"Použij \"/blacklist add\" pro přidání uživatele na blacklist!",
|
||||||
|
"clearVerify":"Opravdu chcete smazat více ticketů?\nTuto akci nelze vrátit zpět!",
|
||||||
|
"clearReady":"{0} ticketů bylo úspěšně smazány!",
|
||||||
|
"rolesEmpty":"Žádné role nebyly aktualizovány!",
|
||||||
|
|
||||||
|
"autocloseLeave":"Tento ticket byl automaticky uzavřen, protože jeho autor opustil server.!",
|
||||||
|
"autocloseTimeout":"Tento ticket byl automaticky uzavřen, protože byl neaktivní déle než `{0}h`!",
|
||||||
|
"autodeleteLeave":"Tento ticket byl automaticky smazán, protože jeho autor opustil server!",
|
||||||
|
"autodeleteTimeout":"Tento ticket byl automaticky smazán, protože je neaktivní déle než `{0} dní`!",
|
||||||
|
"autocloseEnabled":"U tohoto ticketu bylo povoleno automatické uzavření!\nTicket bude uzavřen, pokud bude neaktivní déle než `{0}h`!",
|
||||||
|
"autocloseDisabled":"U tohoto ticketu bylo vypnuto automatické zavírání!\nUž se nebude automaticky zavírat!",
|
||||||
|
"autodeleteEnabled":"U tohoto ticketu bylo povoleno automatické mazání!\nBude smazán, pokud je neaktivní déle než `{0} dní`!",
|
||||||
|
"autodeleteDisabled":"Automatické mazání bylo v tomto zakázáno!\nUž se nebude automaticky mazat!",
|
||||||
|
|
||||||
|
"ticketMessageLimit":"Současně lze vytvořit pouze {0} ticketu!",
|
||||||
|
"ticketMessageAutoclose":"Tento ticket se automaticky uzavře, pokud je neaktivní po dobu {0}h!",
|
||||||
|
"ticketMessageAutodelete":"Tento ticket bude automaticky smazán, pokud bude neaktivní po dobu {0} dnů!",
|
||||||
|
"panelReady":"Panel najdete níže!\nTuto zprávu lze nyní smazat!"
|
||||||
|
},
|
||||||
|
"modal":{
|
||||||
|
"closePlaceholder":"Proč jste tento ticket uzavřel?",
|
||||||
|
"deletePlaceholder":"Proč jste tento ticket smazali?",
|
||||||
|
"reopenPlaceholder":"Proč jste tento ticket znovu otevřeli?",
|
||||||
|
"claimPlaceholder":"Proč jste si vyžádal tento ticket?",
|
||||||
|
"unclaimPlaceholder":"Proč jste zrušili převzetí tohoto ticketu?",
|
||||||
|
"pinPlaceholder":"Proč jste připnuli tento ticket?",
|
||||||
|
"unpinPlaceholder":"Proč jste odepnuli tento ticket?"
|
||||||
|
},
|
||||||
|
"logs":{
|
||||||
|
"createLog":"Nový ticket byl vytvořen uživatelem {0}!",
|
||||||
|
"closeLog":"Tento ticket byl uzavřen uživatelem {0}!",
|
||||||
|
"closeDm":"Tvůj ticket byl uzavřen na našem serveru!",
|
||||||
|
"deleteLog":"Tento ticket byl smazán uživatelem {0}!",
|
||||||
|
"deleteDm":"Tvůj ticket byl smazán na našem serveru!",
|
||||||
|
"reopenLog":"Tento ticket byl znovu otevřen uživatelem {0}!",
|
||||||
|
"reopenDm":"Tvůj ticket byl znovu otevřen na našem serveru!",
|
||||||
|
"claimLog":"Tento ticket byl přidělen uživatelem {0}!",
|
||||||
|
"claimDm":"Tvůj ticket byl přidělen na našem serveru!",
|
||||||
|
"unclaimLog":"Tento ticket byl odhlášen uživatelem {0}!",
|
||||||
|
"unclaimDm":"Tvůj ticket byl odhlášen na našem serveru!",
|
||||||
|
"pinLog":"Tento ticket byl připnut uživatelem {0}!",
|
||||||
|
"pinDm":"Tvůj ticket byl připnut na našem serveru!",
|
||||||
|
"unpinLog":"Tento ticket byl odepnut uživatelem {0}!",
|
||||||
|
"unpinDm":"Tvůj ticket byl odepnut na našem serveru!",
|
||||||
|
"renameLog":"Tento ticket byl přejmenován na {0} uživatelem {1}!",
|
||||||
|
"renameDm":"Tvůj ticket byl přejmenován na {0} na našem serveru!",
|
||||||
|
"moveLog":"Tento ticket byl přesunut do {0} uživatelem {1}!",
|
||||||
|
"moveDm":"Tvůj ticket byl přesunut do {0} na našem serveru!",
|
||||||
|
"addLog":"{0} byl přidán do tohoto ticketu uživatelem {1}!",
|
||||||
|
"addDm":"{0} byl přidán do tvého ticketu na našem serveru!",
|
||||||
|
"removeLog":"{0} byl odstraněn z tohoto ticketu uživatelem {1}!",
|
||||||
|
"removeDm":"{0} byl odstraněn z tvého ticketu na našem serveru!",
|
||||||
|
|
||||||
|
"blacklistAddLog":"{0} byl přidán na blacklist uživatelem {1}!",
|
||||||
|
"blacklistRemoveLog":"{0} byl odstraněn z blacklistu uživatelem {1}!",
|
||||||
|
"blacklistAddDm":"Byl jsi přidán na blacklist na našem serveru!\nOd teď nemůžeš vytvářet tickety!",
|
||||||
|
"blacklistRemoveDm":"Byl jsi odstraněn z blacklistu na našem serveru!\nNyní můžeš opět vytvářet tickety!",
|
||||||
|
"clearLog":"{0} ticketů bylo smazáno uživatelem {1}!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"success":{
|
||||||
|
"visit":"Zobrazit přepis",
|
||||||
|
"ready":"Přepis vytvořen",
|
||||||
|
"textFileDescription":"Toto je textový přepis smazaného ticketu!",
|
||||||
|
"htmlProgress":"Prosím, počkejte, zatímco se zpracovává HTML přepis...",
|
||||||
|
|
||||||
|
"createdChannel":"Na serveru byl vytvořen nový přepis {0}!",
|
||||||
|
"createdCreator":"Byl vytvořen nový přepis {0} pro jeden z tvých ticketů!",
|
||||||
|
"createdParticipant":"Byl vytvořen nový přepis {0} v jednom z ticketů, kterých ses účastnil!",
|
||||||
|
"createdActiveAdmin":"Byl vytvořen nový přepis {0} v jednom z ticketů, kterých ses účastnil jako admin!",
|
||||||
|
"createdEveryAdmin":"Byl vytvořen nový přepis {0} v jednom z ticketů, kde jsi byl adminem!",
|
||||||
|
"createdOther":"Byl vytvořen nový přepis {0}!"
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"retry":"Zkusit Znovu",
|
||||||
|
"continue":"Vymazat bez přepisu",
|
||||||
|
"backup":"Vytvořit záložní přepis",
|
||||||
|
"error":"Při pokusu o vytvoření přepisu se něco pokazilo.\nCo chcete udělat?\n\nTento ticket nebude smazán, dokud nekliknete na jedno z těchto tlačítek."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"titles":{
|
||||||
|
"internalError":"Interní chyba",
|
||||||
|
"optionMissing":"Chybějící možnost příkazu",
|
||||||
|
"optionInvalid":"Neplatná možnost příkazu",
|
||||||
|
"unknownCommand":"Neznámý příkaz",
|
||||||
|
"noPermissions":"Nemáš oprávnění",
|
||||||
|
"unknownTicket":"Neznámý ticket",
|
||||||
|
"deprecatedTicket":"Zastaralý ticket",
|
||||||
|
"unknownOption":"Neznámá možnost",
|
||||||
|
"unknownPanel":"Neznámý panel",
|
||||||
|
"notInGuild":"Nejsi na serveru",
|
||||||
|
"channelRename":"Nepodařilo se přejmenovat kanál",
|
||||||
|
"busy":"Ticket je zaneprázdněn"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"askForInfo":"Pro více informací kontaktuj vlastníka tohoto bota!",
|
||||||
|
"askForInfoResolve":"Kontaktuj vlastníka tohoto bota, pokud se tento problém nevyřeší po několika pokusech.",
|
||||||
|
"internalError":"Nepodařilo se odpovědět na tento {0} kvůli interní chybě!",
|
||||||
|
"optionMissing":"V tomto příkazu chybí požadovaný parametr!",
|
||||||
|
"optionInvalid":"V tomto příkazu je neplatný parametr!",
|
||||||
|
"optionInvalidChoose":"Vyber z",
|
||||||
|
"unknownCommand":"Zkus navštívit nabídku nápovědy pro více informací!",
|
||||||
|
"noPermissions":"Nemáš oprávnění k použití tohoto {0}!",
|
||||||
|
"noPermissionsList":"Požadovaná oprávnění: (jedno z nich)",
|
||||||
|
"noPermissionsCooldown":"Nemáš oprávnění k použití tohoto {0}, protože máš cooldown!",
|
||||||
|
"noPermissionsBlacklist":"Nemáš oprávnění k použití tohoto {0}, protože jsi byl přidán na blacklist!",
|
||||||
|
"noPermissionsLimitGlobal":"Nemáš oprávnění vytvořit ticket, protože server dosáhl maximálního limitu ticketů!",
|
||||||
|
"noPermissionsLimitGlobalUser":"Nemáš oprávnění vytvořit ticket, protože jsi dosáhl maximálního limitu ticketů!",
|
||||||
|
"noPermissionsLimitOption":"Nemáš oprávnění vytvořit ticket, protože server dosáhl maximálního limitu ticketů pro tuto možnost!",
|
||||||
|
"noPermissionsLimitOptionUser":"Nemáš oprávnění vytvořit ticket, protože jsi dosáhl maximálního limitu ticketů pro tuto možnost!",
|
||||||
|
"unknownTicket":"Zkus tento příkaz znovu v platném ticketu!",
|
||||||
|
"deprecatedTicket":"Aktuální kanál není platný ticket! Může se jednat o ticket ze starší verze Open Ticketu!",
|
||||||
|
"notInGuild":"Tento {0} nefunguje v DM! Zkus to znovu na serveru!",
|
||||||
|
"channelRename":"Kvůli ratelimitům Discordu není momentálně možné, aby bot přejmenoval kanál. Kanál bude automaticky přejmenován do 10 minut, pokud nedojde k restartu bota.",
|
||||||
|
"channelRenameSource":"Zdroj této chyby je: {0}",
|
||||||
|
"busy":"Nelze použít tento {0}!\nTicket je momentálně zpracováván botem.\n\nZkus to prosím znovu za několik sekund!"
|
||||||
|
},
|
||||||
|
"optionInvalidReasons":{
|
||||||
|
"stringRegex":"Hodnota neodpovídá vzoru!",
|
||||||
|
"stringMinLength":"Hodnota musí mít alespoň {0} znaků!",
|
||||||
|
"stringMaxLength":"Hodnota může mít maximálně {0} znaků!",
|
||||||
|
"numberInvalid":"Neplatné číslo!",
|
||||||
|
"numberMin":"Číslo musí být alespoň {0}!",
|
||||||
|
"numberMax":"Číslo může být maximálně {0}!",
|
||||||
|
"numberDecimal":"Číslo nesmí být desetinné!",
|
||||||
|
"numberNegative":"Číslo nesmí být záporné!",
|
||||||
|
"numberPositive":"Číslo nesmí být kladné!",
|
||||||
|
"numberZero":"Číslo nesmí být nula!",
|
||||||
|
"channelNotFound":"Nelze najít kanál!",
|
||||||
|
"userNotFound":"Nelze najít uživatele!",
|
||||||
|
"roleNotFound":"Nelze najít roli!",
|
||||||
|
"memberNotFound":"Nelze najít uživatele!",
|
||||||
|
"mentionableNotFound":"Nelze najít uživatele nebo roli!",
|
||||||
|
"channelType":"Neplatný typ kanálu!",
|
||||||
|
"notInGuild":"Tato možnost vyžaduje, abys byl na serveru!"
|
||||||
|
},
|
||||||
|
"permissions":{
|
||||||
|
"developer":"Musíš být vývojářem tohoto bota.",
|
||||||
|
"owner":"Musíš být vlastníkem serveru.",
|
||||||
|
"admin":"Musíš být adminem serveru.",
|
||||||
|
"moderator":"Musíš být moderátorem.",
|
||||||
|
"support":"Musíš být členem týmu podpory.",
|
||||||
|
"member":"Musíš být členem.",
|
||||||
|
"discord-administrator":"Musíš mít oprávnění `ADMINISTRATOR`."
|
||||||
|
},
|
||||||
|
"actionInvalid":{
|
||||||
|
"close":"Ticket je již uzavřený!",
|
||||||
|
"reopen":"Ticket ještě není uzavřený!",
|
||||||
|
"claim":"Ticket je již přidělený!",
|
||||||
|
"unclaim":"Ticket ještě není přidělený!",
|
||||||
|
"pin":"Ticket je již připnutý!",
|
||||||
|
"unpin":"Ticket ještě není připnutý!",
|
||||||
|
"add":"Tento uživatel už má k ticketu přístup!",
|
||||||
|
"remove":"Tohoto uživatele nelze z ticketu odstranit!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"params":{
|
||||||
|
"uppercase":{
|
||||||
|
"ticket":"Ticket",
|
||||||
|
"tickets":"Tickety",
|
||||||
|
"reason":"Důvod",
|
||||||
|
"creator":"Tvůrce",
|
||||||
|
"remaining":"Zbývající čas",
|
||||||
|
"added":"Přidáno",
|
||||||
|
"removed":"Odstraněno",
|
||||||
|
"filter":"Filtr",
|
||||||
|
"claimedBy":"Přiděleno uživatelem {0}",
|
||||||
|
"method":"Metoda",
|
||||||
|
"type":"Typ",
|
||||||
|
"blacklisted":"Na blacklistu",
|
||||||
|
"panel":"Panel",
|
||||||
|
"command":"Příkaz",
|
||||||
|
"system":"Systém",
|
||||||
|
"true":"true",
|
||||||
|
"false":"false",
|
||||||
|
"syntax":"Syntaxe",
|
||||||
|
"originalName":"Původní jméno",
|
||||||
|
"newName":"Nové jméno",
|
||||||
|
"until":"Do",
|
||||||
|
"validOptions":"Platné možnosti",
|
||||||
|
"validPanels":"Platné panely",
|
||||||
|
"autoclose":"Automatické uzavření",
|
||||||
|
"autodelete":"Automatické smazání",
|
||||||
|
"startupDate":"Datum spuštění",
|
||||||
|
"version":"Verze",
|
||||||
|
"name":"Jméno",
|
||||||
|
"role":"Role",
|
||||||
|
"status":"Stav",
|
||||||
|
"claimed":"Přiděleno",
|
||||||
|
"pinned":"Připnuto",
|
||||||
|
"creationDate":"Datum vytvoření"
|
||||||
|
},
|
||||||
|
"lowercase":{
|
||||||
|
"text":"text",
|
||||||
|
"html":"html",
|
||||||
|
"command":"příkaz",
|
||||||
|
"modal":"modal",
|
||||||
|
"button":"tlačítko",
|
||||||
|
"dropdown":"roletka",
|
||||||
|
"method":"metoda"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"reason":"Zadej nepovinný důvod, který bude viditelný v logu.",
|
||||||
|
"help":"Získej seznam všech dostupných příkazů.",
|
||||||
|
"panel":"Vytvoř zprávu s roletkou nebo tlačítky (pro vytvoření ticketu).",
|
||||||
|
"panelId":"Identifikátor panelu, který chceš vytvořit.",
|
||||||
|
"panelAutoUpdate":"Chceš, aby se tento panel automaticky aktualizoval při úpravách?",
|
||||||
|
"ticket":"Okamžitě vytvoř ticket.",
|
||||||
|
"ticketId":"Identifikátor ticketu, který chceš vytvořit.",
|
||||||
|
"close":"Uzavři ticket.",
|
||||||
|
"delete":"Smaž ticket.",
|
||||||
|
"deleteNoTranscript":"Smaž tento ticket bez vytvoření přepisu.",
|
||||||
|
"reopen":"Znovu otevři ticket.",
|
||||||
|
"claim":"Přiděl ticket.",
|
||||||
|
"claimUser":"Přiděl tento ticket někomu jinému místo sebe.",
|
||||||
|
"unclaim":"Odeber přidělení ticketu.",
|
||||||
|
"pin":"Připni ticket.",
|
||||||
|
"unpin":"Odepni ticket.",
|
||||||
|
"move":"Přesuň ticket.",
|
||||||
|
"moveId":"Identifikátor možnost, na který chceš přesunout.",
|
||||||
|
"rename":"Přejmenuj ticket.",
|
||||||
|
"renameName":"Nový název pro tento ticket.",
|
||||||
|
"add":"Přidej uživatele k ticketu.",
|
||||||
|
"addUser":"Uživatel k přidání.",
|
||||||
|
"remove":"Odstraň uživatele z ticketu.",
|
||||||
|
"removeUser":"Uživatel k odstranění.",
|
||||||
|
"blacklist":"Spravuj blacklist ticketů.",
|
||||||
|
"blacklistView":"Zobraz seznam aktuálního blacklistu.",
|
||||||
|
"blacklistAdd":"Přidej uživatele na blacklist.",
|
||||||
|
"blacklistRemove":"Odstraň uživatele z blacklistu.",
|
||||||
|
"blacklistGet":"Získej detaily o uživateli na blacklistu.",
|
||||||
|
"blacklistGetUser":"Uživatel, o kterém chceš získat detaily.",
|
||||||
|
"stats":"Zobraz statistiky bota, člena nebo ticketu.",
|
||||||
|
"statsReset":"Resetuj všechny statistiky bota (a začni počítat od nuly).",
|
||||||
|
"statsGlobal":"Zobraz globální statistiky.",
|
||||||
|
"statsUser":"Zobraz statistiky uživatele na serveru.",
|
||||||
|
"statsUserUser":"Uživatel, jehož statistiky chceš zobrazit.",
|
||||||
|
"statsTicket":"Zobraz statistiky ticketu na serveru.",
|
||||||
|
"statsTicketTicket":"Ticket, jehož statistiky chceš zobrazit.",
|
||||||
|
"clear":"Smaž více ticketů najednou. Lze zadat volitelný filtr.",
|
||||||
|
"clearFilter":"Filtr pro vymazání tiketů.",
|
||||||
|
"clearFilters":{
|
||||||
|
"all":"Vše",
|
||||||
|
"open":"Otevřené",
|
||||||
|
"close":"Uzavřené",
|
||||||
|
"claim":"Přidělené",
|
||||||
|
"unclaim":"Nepřidělené",
|
||||||
|
"pin":"Připnuté",
|
||||||
|
"unpin":"Nepřipnuté",
|
||||||
|
"autoclose":"Automaticky uzavřené"
|
||||||
|
},
|
||||||
|
"autoclose":"Spravuj automatické uzavření ticketu.",
|
||||||
|
"autocloseDisable":"Deaktivuj automatické uzavření v tomto ticketu.",
|
||||||
|
"autocloseEnable":"Aktivuj automatické uzavření v tomto ticketu.",
|
||||||
|
"autocloseEnableTime":"Počet hodin neaktivity, po kterých se ticket uzavře.",
|
||||||
|
"autodelete":"Spravuj automatické smazání ticketu.",
|
||||||
|
"autodeleteDisable":"Deaktivuj automatické smazání v tomto ticketu.",
|
||||||
|
"autodeleteEnable":"Aktivuj automatické smazání v tomto ticketu.",
|
||||||
|
"autodeleteEnableTime":"Počet dnů neaktivity, po kterých se ticket smaže."
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"help":"Získej seznam všech dostupných příkazů.",
|
||||||
|
"ticket":"Okamžitě vytvoř ticket.",
|
||||||
|
"close":"Uzavři ticket, čímž se zakáže psaní v tomto kanálu.",
|
||||||
|
"delete":"Smaž ticket, čímž se vytvoří přepis, pokud je to povoleno.",
|
||||||
|
"reopen":"Znovu otevři ticket, což opět umožní psaní v tomto kanálu.",
|
||||||
|
"pin":"Připni ticket. Tento ticket se přesune na začátek a bude mít ve jménu emoji '📌'.",
|
||||||
|
"unpin":"Odepni ticket. Ticket zůstane na svém místě, ale ztratí emoji '📌'.",
|
||||||
|
"move":"Přesuň ticket. Tím se změní typ tohoto ticketu.",
|
||||||
|
"rename":"Přejmenuj ticket. Tím se změní název kanálu tohoto ticketu.",
|
||||||
|
"claim":"Přiděl ticket. Tím dáš svému týmu najevo, že tento ticket řešíš.",
|
||||||
|
"unclaim":"Odeber přidělení ticketu. Tím dáš svému týmu najevo, že je tento ticket znovu volný.",
|
||||||
|
"add":"Přidej uživatele k ticketu. Tímto uživateli umožníš číst a psát v tomto ticketu.",
|
||||||
|
"remove":"Odstraň uživatele z ticketu. Tímto uživateli odebereš možnost číst a psát v tomto ticketu.",
|
||||||
|
"panel":"Vytvoř zprávu s roletkou nebo tlačítky (pro vytvoření ticketu).",
|
||||||
|
"blacklistView":"Zobraz seznam aktuálního blacklistu.",
|
||||||
|
"blacklistAdd":"Přidej uživatele na blacklist.",
|
||||||
|
"blacklistRemove":"Odstraň uživatele z blacklistu.",
|
||||||
|
"blacklistGet":"Získej detaily o uživateli na blacklistu.",
|
||||||
|
"statsGlobal":"Zobraz globální statistiky.",
|
||||||
|
"statsTicket":"Zobraz statistiky ticketu na serveru.",
|
||||||
|
"statsUser":"Zobraz statistiky uživatele na serveru.",
|
||||||
|
"statsReset":"Resetuj všechny statistiky bota (a začni počítat od nuly).",
|
||||||
|
"autocloseDisable":"Deaktivuj automatické uzavření v tomto ticketu.",
|
||||||
|
"autocloseEnable":"Aktivuj automatické uzavření v tomto ticketu.",
|
||||||
|
"autodeleteDisable":"Deaktivuj automatické smazání v tomto ticketu.",
|
||||||
|
"autodeleteEnable":"Aktivuj automatické smazání v tomto ticketu."
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"scopes":{
|
||||||
|
"global":"Globální statistiky",
|
||||||
|
"system":"Statistiky systému",
|
||||||
|
"user":"Statistiky uživatele",
|
||||||
|
"ticket":"Statistiky ticketu",
|
||||||
|
"participants":"Účastníci"
|
||||||
|
},
|
||||||
|
"properties":{
|
||||||
|
"ticketsCreated":"Vytvořené tickety",
|
||||||
|
"ticketsClosed":"Uzavřené tickety",
|
||||||
|
"ticketsDeleted":"Smazané tickety",
|
||||||
|
"ticketsReopened":"Znovu otevřené tickety",
|
||||||
|
"ticketsAutoclosed":"Automaticky uzavřené tickety",
|
||||||
|
"ticketsClaimed":"Přidělené tickety",
|
||||||
|
"ticketsPinned":"Připnuté tickety",
|
||||||
|
"ticketsMoved":"Přesunuté tickety",
|
||||||
|
"usersBlacklisted":"Uživatelé na blacklistu",
|
||||||
|
"transcriptsCreated":"Vytvořené přepisy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,477 @@
|
|||||||
|
{
|
||||||
|
"_TRANSLATION":{
|
||||||
|
"otversion":"v4.0.0",
|
||||||
|
"translator":"DJj123dj",
|
||||||
|
"lastedited":"21/08/2024",
|
||||||
|
"language":"Dutch"
|
||||||
|
},
|
||||||
|
"checker":{
|
||||||
|
"system":{
|
||||||
|
"typeError":"[ERROR]",
|
||||||
|
"headerOpenTicket":"OPEN TICKET",
|
||||||
|
"typeWarning":"[WAARSCHUWING]",
|
||||||
|
"typeInfo":"[INFO]",
|
||||||
|
"headerConfigChecker":"CONFIG CHECKER",
|
||||||
|
"headerDescription":"check voor errors in je config bestanden!",
|
||||||
|
"footerError":"de bot start niet tot alle {0}'s opgelost zijn!",
|
||||||
|
"footerWarning":"het is aangeraden om alle {0}'en op te lossen voor het starten!",
|
||||||
|
"footerSupport":"SUPPORT: {0} - DOCS: {1}",
|
||||||
|
"compactInformation":"gebruik {0} voor meer informatie!",
|
||||||
|
"dataPath":"pad",
|
||||||
|
"dataDocs":"docs",
|
||||||
|
"dataMessages":"bericht"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"stringTooShort":"Deze tekst kan niet korter dan {0} karakters zijn!",
|
||||||
|
"stringTooLong":"Deze tekst kan niet langer dan {0} karakters zijn!",
|
||||||
|
"stringLengthInvalid":"Deze tekst moet {0} karakters lang zijn!",
|
||||||
|
"stringStartsWith":"Deze tekst moet starten met {0}!",
|
||||||
|
"stringEndsWith":"Deze tekst moet eindigen met {0}!",
|
||||||
|
"stringContains":"Deze tekst moet {0} bevatten!",
|
||||||
|
"stringChoices":"Deze tekst kan alleen de volgende waardes bevatten: {0}!",
|
||||||
|
"stringRegex":"Deze tekst is ongeldig!",
|
||||||
|
|
||||||
|
"numberTooShort":"Dit nummer kan niet korter dan {0} karakters zijn!",
|
||||||
|
"numberTooLong":"Dit nummer kan niet langer dan {0} karakters zijn!",
|
||||||
|
"numberLengthInvalid":"Dit nummer moet {0} karakters lang zijn!",
|
||||||
|
"numberTooSmall":"Dit nummer moet minimum {0} zijn!",
|
||||||
|
"numberTooLarge":"Dit nummer kan maximum {0} zijn!",
|
||||||
|
"numberNotEqual":"Dit nummer moet gelijk zijn aan {0}!",
|
||||||
|
"numberStep":"Dit nummer moet een meervoud zijn van {0}!",
|
||||||
|
"numberStepOffset":"Dit nummer moet een meervoud zijn van {0} startend bij {1}!",
|
||||||
|
"numberStartsWith":"Dit nummer moet starten met {0}!",
|
||||||
|
"numberEndsWith":"Dit nummer moet eindigen met {0}!",
|
||||||
|
"numberContains":"Dit nummer moet {0} bevatten!",
|
||||||
|
"numberChoices":"Dit nummer kan alleen een van de volgende waardes bevatten: {0}!",
|
||||||
|
"numberFloat":"Dit nummer kan geen kommagetal zijn!",
|
||||||
|
"numberNegative":"Dit nummer kan niet negatief zijn!",
|
||||||
|
"numberPositive":"Dit nummer kan niet positief zijn!",
|
||||||
|
"numberZero":"Dit nummer kan niet nul zijn!",
|
||||||
|
|
||||||
|
"booleanTrue":"Deze boolean kan niet true zijn!",
|
||||||
|
"booleanFalse":"Deze boolean kan niet false zijn!",
|
||||||
|
|
||||||
|
"arrayEmptyDisabled":"Deze array mag niet leeg zijn!",
|
||||||
|
"arrayEmptyRequired":"Deze array moet leeg zijn!",
|
||||||
|
"arrayTooShort":"Deze array moet een minimum lengte hebben van {0}!",
|
||||||
|
"arrayTooLong":"Deze array mag niet langer zijn dan {0}!",
|
||||||
|
"arrayLengthInvalid":"Deze array moet een lengte hebben van {0}!",
|
||||||
|
"arrayInvalidTypes":"Deze array kan alleen de volgende waardes bevatten: {0}!",
|
||||||
|
"arrayDouble":"Deze array staat dubbele waardes niet toe!",
|
||||||
|
|
||||||
|
"discordInvalidId":"Dit is een ongeldig discord {0} id!",
|
||||||
|
"discordInvalidIdOptions":"Dit is an ongeldig discord {0} id! Je kan ook een van deze gebruiken: {1}!",
|
||||||
|
"discordInvalidToken":"Dit is een ongeldig discord token (syntactisch)!",
|
||||||
|
"colorInvalid":"Dit is een ongeldig hex kleur!",
|
||||||
|
"emojiTooShort":"Deze tekst moet minimum {0} emoji's hebben!",
|
||||||
|
"emojiTooLong":"Deze tekst mag maximum {0} emoji's hebben!",
|
||||||
|
"emojiCustom":"Deze emoji kan geen custom discord emoji zijn!",
|
||||||
|
"emojiInvalid":"Dit is een ongeldige emoji!",
|
||||||
|
"urlInvalid":"Deze url is ongeldig!",
|
||||||
|
"urlInvalidHttp":"Deze url kan alleen het https:// protocol gebruiken!",
|
||||||
|
"urlInvalidProtocol":"Deze url kan alleen de http:// & https:// protocolen gebruiken!",
|
||||||
|
"urlInvalidHostname":"Deze url heeft een verboden hostnaam (domein)!",
|
||||||
|
"urlInvalidExtension":"Deze url heeft een ongeldige extensie! Kies tussen: {0}!",
|
||||||
|
"urlInvalidPath":"Deze url heeft een ongeldig pad!",
|
||||||
|
"idNotUnique":"Dit id is niet uniek, gebruik een andere in de plaats!",
|
||||||
|
"idNonExistent":"Het id {0} bestaat niet!",
|
||||||
|
|
||||||
|
"invalidType":"Het type van deze property moet gelijk zijn aan: {0}!",
|
||||||
|
"propertyMissing":"De property {0} mist in dit object!",
|
||||||
|
"propertyOptional":"De property {0} is optioneel in dit object!",
|
||||||
|
"objectDisabled":"Dit object is uitgeschakeld, gebruik het met behulp van {0}!",
|
||||||
|
"nullInvalid":"Deze property kan niet null zijn!",
|
||||||
|
"switchInvalidType":"Dit moet een van de volgende types zijn: {0}!",
|
||||||
|
"objectSwitchInvalid":"Dit object moet een van de volgende types zijn: {0}!",
|
||||||
|
|
||||||
|
"invalidLanguage":"Dit is een ongeldige taal!",
|
||||||
|
"invalidButton":"Deze knop moet een {0} of {1} hebben!",
|
||||||
|
"unusedOption":"De optie {0} wordt nergens gebruikt!",
|
||||||
|
"unusedQuestion":"The vraag {0} wordt nergens gebruikt!",
|
||||||
|
"dropdownOption":"Een paneel met dropdown mag alleen opties bevaten van het 'ticket' type!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actions":{
|
||||||
|
"buttons":{
|
||||||
|
"create":"Bekijk Ticket",
|
||||||
|
"close":"Sluit Ticket",
|
||||||
|
"delete":"Verwijder Ticket",
|
||||||
|
"reopen":"Heropen Ticket",
|
||||||
|
"claim":"Claim Ticket",
|
||||||
|
"unclaim":"Ontclaim Ticket",
|
||||||
|
"pin":"Pin Ticket",
|
||||||
|
"unpin":"Maak Ticket Los",
|
||||||
|
"clear":"Verwijder Tickets",
|
||||||
|
"helpSwitchSlash":"Bekijk Slash Commands",
|
||||||
|
"helpSwitchText":"Bekijk Text Commands",
|
||||||
|
"helpPage":"Pagina {0}",
|
||||||
|
"withReason":"Met Reden",
|
||||||
|
"withoutTranscript":"Zonder Transcript"
|
||||||
|
},
|
||||||
|
"titles":{
|
||||||
|
"created":"Ticket Gecreëerd",
|
||||||
|
"close":"Ticket Gesloten",
|
||||||
|
"delete":"Ticket Verwijderd",
|
||||||
|
"reopen":"Ticket Heropend",
|
||||||
|
"claim":"Ticket Geclaimd",
|
||||||
|
"unclaim":"Ticket Ontclaimd",
|
||||||
|
"pin":"Ticket Gepind",
|
||||||
|
"unpin":"Ticket Losgemaakt",
|
||||||
|
"rename":"Ticket Hernoemd",
|
||||||
|
"move":"Ticket Verplaatst",
|
||||||
|
"add":"Ticket Gebruiker Toegevoegd",
|
||||||
|
"remove":"Ticket Gebruiker Verwijderd",
|
||||||
|
|
||||||
|
"help":"Beschikbare Commands",
|
||||||
|
"statsReset":"Reset Stats",
|
||||||
|
"blacklistAdd":"Gebruiker Geblacklisted",
|
||||||
|
"blacklistRemove":"Gebruiker Vrijgelaten",
|
||||||
|
"blacklistGet":"Geblackliste Gebruiker",
|
||||||
|
"blacklistView":"Huidige Blacklist",
|
||||||
|
"blacklistAddDm":"Toegevoegd Aan Blacklist",
|
||||||
|
"blacklistRemoveDm":"Verwijderd Van Blacklist",
|
||||||
|
"clear":"Tickets Opgeruimd",
|
||||||
|
"roles":"Rollen Bijgewerkt",
|
||||||
|
|
||||||
|
"autoclose":"Ticket Automatisch Gesloten",
|
||||||
|
"autocloseEnabled":"Autoclose Ingeschakeld",
|
||||||
|
"autocloseDisabled":"Autoclose Uitgeschakeld",
|
||||||
|
"autodelete":"Ticket Automatisch Verwijderd",
|
||||||
|
"autodeleteEnabled":"Autodelete Ingeschakeld",
|
||||||
|
"autodeleteDisabled":"Autodelete Uitgeschakeld"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"create":"Je ticket is aangemaakt. Klik op de knop hier onder om er naar toe te gaan!",
|
||||||
|
"close":"Het ticket is succesvol gesloten!",
|
||||||
|
"delete":"Het ticket is succesvol verwijderd!",
|
||||||
|
"reopen":"Het ticket is succesvol heropend!",
|
||||||
|
"claim":"Het ticket is succesvol geclaimd!",
|
||||||
|
"unclaim":"Het ticket is succesvol ontclaimd!",
|
||||||
|
"pin":"Het ticket is succesvol gepind!",
|
||||||
|
"unpin":"Het ticket is succesvol losgemaakt!",
|
||||||
|
"rename":"Het ticket is succesvol hernoemd naar {0}!",
|
||||||
|
"move":"Het ticket is succesvol verplaatst naar {0}!",
|
||||||
|
"add":"{0} is succesvol toegevoegd aan het ticket!",
|
||||||
|
"remove":"{0} is succesvol verwijderd van het ticket!",
|
||||||
|
|
||||||
|
"helpExplanation":"`<naam>` => verplichte parameter\n`[naam]` => optionele parameter",
|
||||||
|
"statsReset":"De bot stats zijn succesvol gereset!",
|
||||||
|
"statsError":"Kan ticket stats niet bekijken!\n{0} is geen ticket!",
|
||||||
|
"blacklistAdd":"{0} is succesvol geblacklist!",
|
||||||
|
"blacklistRemove":"{0} is succesvol vrijgelaten!",
|
||||||
|
"blacklistGetSuccess":"{0} is op dit moment geblacklist!",
|
||||||
|
"blacklistGetEmpty":"{0} is op dit moment niet geblacklist!",
|
||||||
|
"blacklistViewEmpty":"Nog niemand is geblacklist!",
|
||||||
|
"blacklistViewTip":"Gebruik \"/blacklist add\" om een gebruiker te blacklisten!",
|
||||||
|
"clearVerify":"Weet je zeker dat je meerdere tickets wilt verwijderen? Deze actie kan niet teruggedraaid worden!",
|
||||||
|
"clearReady":"{0} tickets zijn succesvol verwijderd!",
|
||||||
|
"rolesEmpty":"Geen enkele rollen zijn bijgewerkt!",
|
||||||
|
|
||||||
|
"autocloseLeave":"Dit ticket is automatisch gesloten omdat de maker de server verlaten is!",
|
||||||
|
"autocloseTimeout":"Dit ticket is automatisch gesloten omdat het inactief was voor meer dan `{0} uur`!",
|
||||||
|
"autodeleteLeave":"Dit ticket is automatisch verwijderd omdat de maker de server verlaten is!",
|
||||||
|
"autodeleteTimeout":"Dit ticket is automatisch verwijderd omdat het inactief was voor meer dan `{0} dagen`!",
|
||||||
|
"autocloseEnabled":"Autoclose is ingeschakeld in dit ticket!\nHet wordt gesloten wanneer het inactief is voor meer dan `{0} uur`!",
|
||||||
|
"autocloseDisabled":"Autoclose is uitgeschakeld in dit ticket!\nHet wordt niet meer automatisch gesloten!",
|
||||||
|
"autodeleteEnabled":"Autodelete is ingeschakeld in dit ticket!\nHet wordt verwijderd wanneer het inactief is voor meer dan `{0} dagen`!",
|
||||||
|
"autodeleteDisabled":"Autodelete is uitgeschakeld in dit ticket!\nHet wordt niet meer automatisch verwijderd!",
|
||||||
|
|
||||||
|
"ticketMessageLimit":"Je kan maar {0} ticket(s) op het zelfde moment aanmaken!",
|
||||||
|
"ticketMessageAutoclose":"Dit ticket wordt automatisch gesloten wanneer het inactief is voor {0} uur!",
|
||||||
|
"ticketMessageAutodelete":"Dit ticket wordt automatisch verwijderd wanneer het inactief is voor {0} dagen!",
|
||||||
|
"panelReady":"Je kan het paneel hier onder vinden!\nDit bericht kan nu verwijderd worden!"
|
||||||
|
},
|
||||||
|
"modal":{
|
||||||
|
"closePlaceholder":"Waarom heb je dit ticket gesloten?",
|
||||||
|
"deletePlaceholder":"Waarom heb je dit ticket verwijderd?",
|
||||||
|
"reopenPlaceholder":"Waarom heb je dit ticket heropend?",
|
||||||
|
"claimPlaceholder":"Waarom heb je dit ticket geclaimd?",
|
||||||
|
"unclaimPlaceholder":"Waarom heb je dit ticket ontclaimd?",
|
||||||
|
"pinPlaceholder":"Waarom heb je dit ticket gepind?",
|
||||||
|
"unpinPlaceholder":"Waarom heb je dit ticket losgemaakt?"
|
||||||
|
},
|
||||||
|
"logs":{
|
||||||
|
"createLog":"Een nieuw ticket is aangemaakt door {0}!",
|
||||||
|
"closeLog":"Dit ticket is gesloten door {0}!",
|
||||||
|
"closeDm":"Jouw ticket is gesloten in onze server!",
|
||||||
|
"deleteLog":"Dit ticket is verwijderd door {0}!",
|
||||||
|
"deleteDm":"Jouw ticket is verwijderd in onze server!",
|
||||||
|
"reopenLog":"Dit ticket is heropend door {0}!",
|
||||||
|
"reopenDm":"Jouw ticket is heropend in onze server!",
|
||||||
|
"claimLog":"Dit ticket is geclaimd door {0}!",
|
||||||
|
"claimDm":"Jouw ticket is geclaimd in onze server!",
|
||||||
|
"unclaimLog":"Dit ticket is ontclaimd door {0}!",
|
||||||
|
"unclaimDm":"Jouw ticket is ontclaimd in onze server!",
|
||||||
|
"pinLog":"Dit ticket is gepind door {0}!",
|
||||||
|
"pinDm":"Jouw ticket is gepind in onze server!",
|
||||||
|
"unpinLog":"Dit ticket is losgemaakt door {0}!",
|
||||||
|
"unpinDm":"Jouw ticket is losgemaakt in onze server!",
|
||||||
|
"renameLog":"Dit ticket is hernoemd naar {0} door {1}!",
|
||||||
|
"renameDm":"Jouw ticket is hernoemd naar {0} in onze server!",
|
||||||
|
"moveLog":"Dit ticket is verplaatst naar {0} door {1}!",
|
||||||
|
"moveDm":"Jouw ticket is verplaatst naar {0} in onze server!",
|
||||||
|
"addLog":"{0} is toegevoegd aan dit ticket door {1}!",
|
||||||
|
"addDm":"{0} is toegevoegd aan jouw ticket in onze server!",
|
||||||
|
"removeLog":"{0} is verwijderd van dit ticket door {1}!",
|
||||||
|
"removeDm":"{0} is verwijderd van jouw ticket in onze server!",
|
||||||
|
|
||||||
|
"blacklistAddLog":"{0} is geblacklist door {1}!",
|
||||||
|
"blacklistRemoveLog":"{0} is verwijderd van de blacklist door {1}!",
|
||||||
|
"blacklistAddDm":"Je bent geblacklist in onze server!\nVanaf nu kan je geen tickets meer aanmaken!",
|
||||||
|
"blacklistRemoveDm":"Je bent verwijderd van de blacklist in onze server!\nNormaal zou je nu terug tickets kunnen aanmaken!",
|
||||||
|
"clearLog":"{0} tickets zijn verwijderd door by {1}!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"success":{
|
||||||
|
"visit":"Bekijk Transcript",
|
||||||
|
"ready":"Transcript Aangemaakt",
|
||||||
|
"textFileDescription":"Dit is een tekst transcript van een verwijderd ticket!",
|
||||||
|
"htmlProgress":"Gelieve te wachten terwijl dit html transcript verwerkt wordt...",
|
||||||
|
|
||||||
|
"createdChannel":"Een nieuw {0} transcript is aangemaakt in de server!",
|
||||||
|
"createdCreator":"Een nieuw {0} transcript is aangemaakt voor een van jouw tickets!",
|
||||||
|
"createdParticipant":"Een nieuw {0} transcript is aangemaakt in een van de tickets waar jij lid van was!",
|
||||||
|
"createdActiveAdmin":"Een nieuw {0} transcript is aangemaakt in een van de tickets waar jij een actieve admin was!",
|
||||||
|
"createdEveryAdmin":"Een nieuw {0} transcript is aangemaakt in een van de tickets waar jij admin was!",
|
||||||
|
"createdOther":"Een nieuw {0} transcript is aangemaakt!"
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"retry":"Herprobeer",
|
||||||
|
"continue":"Verwijder Zonder Transcript",
|
||||||
|
"backup":"Maak Backup Transcript",
|
||||||
|
"error":"Er is iets misgegaan bij het maken van het transcript.\nWat wil je doen?\n\nDit ticket wordt niet meer verwijderd to je een van de onderstaande knoppen gebruikt."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"titles":{
|
||||||
|
"internalError":"Interne Error",
|
||||||
|
"optionMissing":"Missende Command Optie",
|
||||||
|
"optionInvalid":"Onjuiste Command Optie",
|
||||||
|
"unknownCommand":"Onbekende Command",
|
||||||
|
"noPermissions":"Geen Permissies",
|
||||||
|
"unknownTicket":"Onbekend Ticket",
|
||||||
|
"deprecatedTicket":"Verouderd Ticket",
|
||||||
|
"unknownOption":"Onbekende Optie",
|
||||||
|
"unknownPanel":"Onbekend Paneel",
|
||||||
|
"notInGuild":"Niet In Server",
|
||||||
|
"channelRename":"Kan Kanaal Niet Hernoemen",
|
||||||
|
"busy":"Ticket Is Bezig"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"askForInfo":"Contacteer the eigenaar van deze bot voor meer info!",
|
||||||
|
"askForInfoResolve":"Contacteer de eigenaar van deze bot als het probleem niet opgelost wordt na enkele keren.",
|
||||||
|
"internalError":"Gefaald om te reageren op deze {0} door een interne error!",
|
||||||
|
"optionMissing":"Een verplichte parameter mist in deze command!",
|
||||||
|
"optionInvalid":"Een parameter in deze command is ongeldig!",
|
||||||
|
"optionInvalidChoose":"Kies tussen",
|
||||||
|
"unknownCommand":"Probeer het help menu te bekijken voor meer info!",
|
||||||
|
"noPermissions":"Je bent niet toegestaan om deze {0} te gebruiken!",
|
||||||
|
"noPermissionsList":"Benodigde Permissies: (één van deze)",
|
||||||
|
"noPermissionsCooldown":"Je bent niet toegestaan om deze {0} te gebruiken omdat je een cooldown hebt!",
|
||||||
|
"noPermissionsBlacklist":"Je bent niet toegestaan om deze {0} te gebruiken omdat je geblacklist bent!",
|
||||||
|
"noPermissionsLimitGlobal":"Je bent niet toegestaan om een ticket aan te maken omdat de server het maximum tickets limiet heeft bereikt!",
|
||||||
|
"noPermissionsLimitGlobalUser":"Je bent niet toegestaan om een ticket aan te maken omdat je het maximum tickets limiet hebt bereikt!",
|
||||||
|
"noPermissionsLimitOption":"Je bent niet toegestaan om een ticket aan te maken omdat de server het maximum tickets limiet van deze optie heeft bereikt!",
|
||||||
|
"noPermissionsLimitOptionUser":"Je bent niet toegestaan om een ticket aan te maken omdat je het maximum tickets limiet van deze optie hebt bereikt!",
|
||||||
|
"unknownTicket":"Probeer deze command opnieuw in een geldig ticket!",
|
||||||
|
"deprecatedTicket":"Het huidige kanaal is geen geldig ticket! Het is misschien een ticket van een oudere Open Ticket versie!",
|
||||||
|
"notInGuild":"Deze {0} werkt niet in DM! Probeer het opnieuw in een server!",
|
||||||
|
"channelRename":"Door discord ratelimits is het op dit moment onmogelijk voor de bot om het kanaal te hernoemen. Het kanaal zal automatisch hernoemd worden over 10 min als de bot niet herstart wordt.",
|
||||||
|
"channelRenameSource":"De bron van deze error is: {0}",
|
||||||
|
"busy":"Kan deze {0} niet gebruiken!\nHet ticket wordt op dit moment verwerkt door de bot.\n\nProbeer het opnieuw binnen een paar seconden!"
|
||||||
|
},
|
||||||
|
"optionInvalidReasons":{
|
||||||
|
"stringRegex":"Waarde is niet gelijk aan het patroon!",
|
||||||
|
"stringMinLength":"Waarde moet minstens {0} karakters hebben!",
|
||||||
|
"stringMaxLength":"Waarde moet maximum {0} karakters hebben!",
|
||||||
|
"numberInvalid":"Ongeldig nummer!",
|
||||||
|
"numberMin":"Nummer moet minstens {0} zijn!",
|
||||||
|
"numberMax":"Nummer moet maximum {0} zijn!",
|
||||||
|
"numberDecimal":"Nummer kan geen kommagetal zijn!",
|
||||||
|
"numberNegative":"Nummer mag niet negatief zijn!",
|
||||||
|
"numberPositive":"Nummer mag niet positief zijn!",
|
||||||
|
"numberZero":"Nummer mag niet nul zijn!",
|
||||||
|
"channelNotFound":"Kan kanaal niet vinden!",
|
||||||
|
"userNotFound":"Kan gebruiker niet vinden!",
|
||||||
|
"roleNotFound":"Kan rol niet vinden!",
|
||||||
|
"memberNotFound":"Kan gebruiker niet vinden!",
|
||||||
|
"mentionableNotFound":"Kan gebruiker of rol niet vinden!",
|
||||||
|
"channelType":"Ongeldig kanaal type!",
|
||||||
|
"notInGuild":"Voor deze optie moet je in een server zitten!"
|
||||||
|
},
|
||||||
|
"permissions":{
|
||||||
|
"developer":"Je moet de ontwikkelaar van de bot zijn.",
|
||||||
|
"owner":"Je moet de server eigenaar zijn.",
|
||||||
|
"admin":"Je moet een server admin zijn.",
|
||||||
|
"moderator":"Je moet een server moderator zijn.",
|
||||||
|
"support":"Je moet in het support team zitten.",
|
||||||
|
"member":"Je moet een member van de server zijn.",
|
||||||
|
"discord-administrator":"Je hebt de `ADMINISTRATOR` permissie nodig."
|
||||||
|
},
|
||||||
|
"actionInvalid":{
|
||||||
|
"close":"Ticket is al gesloten!",
|
||||||
|
"reopen":"Ticket is nog niet gesloten!",
|
||||||
|
"claim":"Ticket is al geclaimd!",
|
||||||
|
"unclaim":"Ticket nog niet geclaimd!",
|
||||||
|
"pin":"Ticket is al gepind!",
|
||||||
|
"unpin":"Ticket nog niet gepind!",
|
||||||
|
"add":"Deze gebruiker heeft al toegang tot dit ticket!",
|
||||||
|
"remove":"Deze gebruiker kan niet verwijderd worden van dit ticket!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"params":{
|
||||||
|
"uppercase":{
|
||||||
|
"ticket":"Ticket",
|
||||||
|
"tickets":"Tickets",
|
||||||
|
"reason":"Reden",
|
||||||
|
"creator":"Maker",
|
||||||
|
"remaining":"Resterende Tijd",
|
||||||
|
"added":"Toegevoegd",
|
||||||
|
"removed":"Verwijderd",
|
||||||
|
"filter":"Filter",
|
||||||
|
"claimedBy":"Geclaimd Door {0}",
|
||||||
|
"method":"Methode",
|
||||||
|
"type":"Type",
|
||||||
|
"blacklisted":"Geblacklist",
|
||||||
|
"panel":"Paneel",
|
||||||
|
"command":"Command",
|
||||||
|
"system":"Systeem",
|
||||||
|
"true":"Waar",
|
||||||
|
"false":"Onwaar",
|
||||||
|
"syntax":"Syntax",
|
||||||
|
"originalName":"Originele Naam",
|
||||||
|
"newName":"Nieuwe Naam",
|
||||||
|
"until":"Tot",
|
||||||
|
"validOptions":"Geldige Opties",
|
||||||
|
"validPanels":"Geldige Panelen",
|
||||||
|
"autoclose":"Autoclose",
|
||||||
|
"autodelete":"Autodelete",
|
||||||
|
"startupDate":"Opstart Datum",
|
||||||
|
"version":"Versie",
|
||||||
|
"name":"Naam",
|
||||||
|
"role":"Rol",
|
||||||
|
"status":"Status",
|
||||||
|
"claimed":"Geclaimd",
|
||||||
|
"pinned":"Gepind",
|
||||||
|
"creationDate":"Aanmaakdatum"
|
||||||
|
},
|
||||||
|
"lowercase":{
|
||||||
|
"text":"tekst",
|
||||||
|
"html":"html",
|
||||||
|
"command":"command",
|
||||||
|
"modal":"form",
|
||||||
|
"button":"knop",
|
||||||
|
"dropdown":"dropdown",
|
||||||
|
"method":"methode"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"reason":"Specifieer een optionele reden die zichtbaar is in de logs.",
|
||||||
|
"help":"Verkrijg een lijst met alle beschikbare commands.",
|
||||||
|
"panel":"Spawn een bericht met een dropdown of knoppen (voor ticket creatie).",
|
||||||
|
"panelId":"Het id van het paneel dat je wilt spawnen.",
|
||||||
|
"panelAutoUpdate":"Wil je dat dit paneel automatisch bijwerkt wanneer het aangepast wordt?",
|
||||||
|
"ticket":"Maak een instant ticket.",
|
||||||
|
"ticketId":"Het id van het ticket dat je wilt aanmaken.",
|
||||||
|
"close":"Sluit een ticket, dit schakelt schrijven in het kanaal uit.",
|
||||||
|
"delete":"Verwijder een ticket, dit maakt een transcript waneer ingeschakeld.",
|
||||||
|
"deleteNoTranscript":"Verwijder dit ticket zonder een transcript aan te maken.",
|
||||||
|
"reopen":"Heropen een ticket, dit schakelt schrijven in het kanaal terug aan.",
|
||||||
|
"claim":"Claim een ticket.",
|
||||||
|
"claimUser":"Claim dit ticket voor iemand anders.",
|
||||||
|
"unclaim":"Ontclaim dit ticket.",
|
||||||
|
"pin":"Pin dit ticket.",
|
||||||
|
"unpin":"Maak dit ticket los.",
|
||||||
|
"move":"Verplaats een ticket.",
|
||||||
|
"moveId":"Het id van de optie waarnaar je wilt verplaatsen.",
|
||||||
|
"rename":"Hernoem een ticket.",
|
||||||
|
"renameName":"De nieuwe naam voor dit ticket.",
|
||||||
|
"add":"Voeg een gebruiker toe aan dit ticket.",
|
||||||
|
"addUser":"De gebruiker om toe te voegen.",
|
||||||
|
"remove":"Verwijder een user van dit ticket.",
|
||||||
|
"removeUser":"De gebruiker om te verwijderen.",
|
||||||
|
"blacklist":"Beheer de ticket blacklist.",
|
||||||
|
"blacklistView":"Bekijk de huidige blacklist.",
|
||||||
|
"blacklistAdd":"Voeg een gebruiker toe aan de blacklist.",
|
||||||
|
"blacklistRemove":"Verwijder een gebruiker van de blacklist.",
|
||||||
|
"blacklistGet":"Verkrijg de details van een geblackliste gebruiker.",
|
||||||
|
"blacklistGetUser":"De gebruiker om details van te verkrijgen.",
|
||||||
|
"stats":"Bekijk statistieken van de bot, een gebruiker of ticket.",
|
||||||
|
"statsReset":"Reset alle stats van de bot (en begin terug bij nul).",
|
||||||
|
"statsGlobal":"Bekijk de globale stats.",
|
||||||
|
"statsUser":"Bekijk de stats van een gebruiker in de server.",
|
||||||
|
"statsUserUser":"De gebruiker om te bekijken.",
|
||||||
|
"statsTicket":"Bekijk de stats van een ticket in de server.",
|
||||||
|
"statsTicketTicket":"Het ticket om te bekijken.",
|
||||||
|
"clear":"Verwijder meerdere tickets tegelijkertijd.",
|
||||||
|
"clearFilter":"De filter om tickets op te ruimen.",
|
||||||
|
"clearFilters":{
|
||||||
|
"all":"Allemaal",
|
||||||
|
"open":"Open (niet gesloten)",
|
||||||
|
"close":"Gesloten",
|
||||||
|
"claim":"Geclaimd",
|
||||||
|
"unclaim":"Ontclaimd (niet geclaimd)",
|
||||||
|
"pin":"Gepind",
|
||||||
|
"unpin":"Losgemaakt (niet gepind)",
|
||||||
|
"autoclose":"Automatisch Gesloten"
|
||||||
|
},
|
||||||
|
"autoclose":"Beheer autoclose in een ticket.",
|
||||||
|
"autocloseDisable":"Schakel autoclose in dit ticket uit.",
|
||||||
|
"autocloseEnable":"Schakel autoclose in dit ticket in.",
|
||||||
|
"autocloseEnableTime":"De hoeveelheid uren dat dit ticket inactief moet zijn voor het te sluiten.",
|
||||||
|
"autodelete":"Beheer autodelete in een ticket.",
|
||||||
|
"autodeleteDisable":"Schakel autodelete in dit ticket aan.",
|
||||||
|
"autodeleteEnable":"Schakel autodelete in dit ticket aan.",
|
||||||
|
"autodeleteEnableTime":"De hoeveelheid dagen dat dit ticket inactief moet zijn voor het te verwijderen."
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"help":"Krijg een lijst van alle beschikbare commands.",
|
||||||
|
"ticket":"Maak een instant ticket.",
|
||||||
|
"close":"Sluit een ticket, dit schakelt schrijven in het kanaal uit.",
|
||||||
|
"delete":"Verwijder een ticket, dit maakt een transcript wanneer ingeschakeld.",
|
||||||
|
"reopen":"Heropen een ticket, dit schakeld schrijven in het kanaal terug aan.",
|
||||||
|
"pin":"Pin een ticket. Dit verplaatst het ticket naar boven & voegt een '📌' emoij toe.",
|
||||||
|
"unpin":"Maak een ticket los. Het ticket zal blijven staan, maar de '📌' emoij verliezen.",
|
||||||
|
"move":"Verplaats een ticket. Dit verandert het soort van dit ticket.",
|
||||||
|
"rename":"Hernoem een ticket. Dit zal de kanaalnaam veranderen.",
|
||||||
|
"claim":"Claim een ticket. Hiermee kan je laten weten dat je bezig bent met dit ticket.",
|
||||||
|
"unclaim":"Ontclaim een ticket. Hiermee kan je laten weten dat het ticket terug vrij is.",
|
||||||
|
"add":"Voeg een user toe aan een ticket.",
|
||||||
|
"remove":"Verwijder een user van een ticket.",
|
||||||
|
"panel":"Spawn een bericht met dropdown of knoppen.",
|
||||||
|
"blacklistView":"Bekijk een lijst van de huidige blacklist.",
|
||||||
|
"blacklistAdd":"Voeg een user toe aan de blacklist.",
|
||||||
|
"blacklistRemove":"Verwijder een user van de blacklist.",
|
||||||
|
"blacklistGet":"Verkrijg de details van een geblacklisted user.",
|
||||||
|
"statsGlobal":"Bekijk de globale stats.",
|
||||||
|
"statsTicket":"Bekijk de stats van een ticket in de server.",
|
||||||
|
"statsUser":"Bekijk de stats van een user in de server.",
|
||||||
|
"statsReset":"Reset alle stats van de bot (en begin terug vanaf 0).",
|
||||||
|
"autocloseDisable":"Zet autoclose uit in dit ticket.",
|
||||||
|
"autocloseEnable":"Zet autoclose in aan dit ticket.",
|
||||||
|
"autodeleteDisable":"Zet autodelete uit in dit ticket.",
|
||||||
|
"autodeleteEnable":"Zet autodelete aan in dit ticket."
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"scopes":{
|
||||||
|
"global":"Globale Stats",
|
||||||
|
"system":"Systeem Stats",
|
||||||
|
"user":"User Stats",
|
||||||
|
"ticket":"Ticket Stats",
|
||||||
|
"participants":"Deelnemers"
|
||||||
|
},
|
||||||
|
"properties":{
|
||||||
|
"ticketsCreated":"Tickets Aangemaakt",
|
||||||
|
"ticketsClosed":"Tickets Gesloten",
|
||||||
|
"ticketsDeleted":"Tickets Verwijderd",
|
||||||
|
"ticketsReopened":"Tickets Heropend",
|
||||||
|
"ticketsAutoclosed":"Tickets Autoclosed",
|
||||||
|
"ticketsClaimed":"Tickets Geclaimd",
|
||||||
|
"ticketsPinned":"Tickets Gepind",
|
||||||
|
"ticketsMoved":"Tickets Verplaatst",
|
||||||
|
"usersBlacklisted":"Users Geblacklist",
|
||||||
|
"transcriptsCreated":"Transcripts Aangemaakt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,477 @@
|
|||||||
|
{
|
||||||
|
"_TRANSLATION":{
|
||||||
|
"otversion":"v4.0.0",
|
||||||
|
"translator":"DJj123dj",
|
||||||
|
"lastedited":"21/08/2024",
|
||||||
|
"language":"English"
|
||||||
|
},
|
||||||
|
"checker":{
|
||||||
|
"system":{
|
||||||
|
"typeError":"[ERROR]",
|
||||||
|
"headerOpenTicket":"OPEN TICKET",
|
||||||
|
"typeWarning":"[WARNING]",
|
||||||
|
"typeInfo":"[INFO]",
|
||||||
|
"headerConfigChecker":"CONFIG CHECKER",
|
||||||
|
"headerDescription":"check for errors in you config files!",
|
||||||
|
"footerError":"the bot won't start until all {0}'s are fixed!",
|
||||||
|
"footerWarning":"it's recommended to fix all {0}'s before starting!",
|
||||||
|
"footerSupport":"SUPPORT: {0} - DOCS: {1}",
|
||||||
|
"compactInformation":"use {0} for more information!",
|
||||||
|
"dataPath":"path",
|
||||||
|
"dataDocs":"docs",
|
||||||
|
"dataMessages":"message"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"stringTooShort":"This string can't be shorter than {0} characters!",
|
||||||
|
"stringTooLong":"This string can't be longer than {0} characters!",
|
||||||
|
"stringLengthInvalid":"This string needs to be {0} characters long!",
|
||||||
|
"stringStartsWith":"This string needs to start with {0}!",
|
||||||
|
"stringEndsWith":"This string needs to end with {0}!",
|
||||||
|
"stringContains":"This string needs to contain {0}!",
|
||||||
|
"stringChoices":"This string can only be one of the following values: {0}!",
|
||||||
|
"stringRegex":"This string is invalid!",
|
||||||
|
|
||||||
|
"numberTooShort":"This number can't be shorter than {0} characters!",
|
||||||
|
"numberTooLong":"This number can't be longer than {0} characters!",
|
||||||
|
"numberLengthInvalid":"This number needs to be {0} characters long!",
|
||||||
|
"numberTooSmall":"This number needs to be at least {0}!",
|
||||||
|
"numberTooLarge":"This number needs to be at most {0}!",
|
||||||
|
"numberNotEqual":"This number needs to be {0}!",
|
||||||
|
"numberStep":"This number needs to be a multiple of {0}!",
|
||||||
|
"numberStepOffset":"This number needs to be a multiple of {0} starting with {1}!",
|
||||||
|
"numberStartsWith":"This number needs to start with {0}!",
|
||||||
|
"numberEndsWith":"This number needs to end with {0}!",
|
||||||
|
"numberContains":"This number needs to contain {0}!",
|
||||||
|
"numberChoices":"This number can only be one of the following values: {0}!",
|
||||||
|
"numberFloat":"This number can't be a decimal!",
|
||||||
|
"numberNegative":"This number can't be negative!",
|
||||||
|
"numberPositive":"This number can't be positive!",
|
||||||
|
"numberZero":"This number can't be zero!",
|
||||||
|
|
||||||
|
"booleanTrue":"This boolean can't be true!",
|
||||||
|
"booleanFalse":"This boolean can't be false!",
|
||||||
|
|
||||||
|
"arrayEmptyDisabled":"This array isn't allowed to be empty!",
|
||||||
|
"arrayEmptyRequired":"This array is required to be empty!",
|
||||||
|
"arrayTooShort":"This array needs to have a length of at least {0}!",
|
||||||
|
"arrayTooLong":"This array needs to have a length of at most {0}!",
|
||||||
|
"arrayLengthInvalid":"This array needs to have a length of {0}!",
|
||||||
|
"arrayInvalidTypes":"This array can only contain the following types: {0}!",
|
||||||
|
"arrayDouble":"This array doesn't allow the same value twice!",
|
||||||
|
|
||||||
|
"discordInvalidId":"This is an invalid discord {0} id!",
|
||||||
|
"discordInvalidIdOptions":"This is an invalid discord {0} id! You can also use one of these: {1}!",
|
||||||
|
"discordInvalidToken":"This is an invalid discord token (syntactically)!",
|
||||||
|
"colorInvalid":"This is an invalid hex color!",
|
||||||
|
"emojiTooShort":"This string needs to have at least {0} emoji's!",
|
||||||
|
"emojiTooLong":"This string needs to have at most {0} emoji's!",
|
||||||
|
"emojiCustom":"This emoji can't be a custom discord emoji!",
|
||||||
|
"emojiInvalid":"This is an invalid emoji!",
|
||||||
|
"urlInvalid":"This url is invalid!",
|
||||||
|
"urlInvalidHttp":"This url can only use the https:// protocol!",
|
||||||
|
"urlInvalidProtocol":"This url can only use the http:// & https:// protocols!",
|
||||||
|
"urlInvalidHostname":"This url has a disallowed hostname!",
|
||||||
|
"urlInvalidExtension":"This url has an invalid extension! Choose between: {0}!",
|
||||||
|
"urlInvalidPath":"This url has an invalid path!",
|
||||||
|
"idNotUnique":"This id isn't unique, use another id instead!",
|
||||||
|
"idNonExistent":"The id {0} doesn't exist!",
|
||||||
|
|
||||||
|
"invalidType":"This property needs to be the type: {0}!",
|
||||||
|
"propertyMissing":"The property {0} is missing from this object!",
|
||||||
|
"propertyOptional":"The property {0} is optional in this object!",
|
||||||
|
"objectDisabled":"This object is disabled, enable it using {0}!",
|
||||||
|
"nullInvalid":"This property can't be null!",
|
||||||
|
"switchInvalidType":"This needs to be one of the following types: {0}!",
|
||||||
|
"objectSwitchInvalid":"This object needs to be one of the following types: {0}!",
|
||||||
|
|
||||||
|
"invalidLanguage":"This is an invalid language!",
|
||||||
|
"invalidButton":"This button needs to have at least an {0} or {1}!",
|
||||||
|
"unusedOption":"The option {0} isn't used anywhere!",
|
||||||
|
"unusedQuestion":"The question {0} isn't used anywhere!",
|
||||||
|
"dropdownOption":"A panel with dropdown enabled can only contain options of the 'ticket' type!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actions":{
|
||||||
|
"buttons":{
|
||||||
|
"create":"Visit Ticket",
|
||||||
|
"close":"Close Ticket",
|
||||||
|
"delete":"Delete Ticket",
|
||||||
|
"reopen":"Reopen Ticket",
|
||||||
|
"claim":"Claim Ticket",
|
||||||
|
"unclaim":"Unclaim Ticket",
|
||||||
|
"pin":"Pin Ticket",
|
||||||
|
"unpin":"Unpin Ticket",
|
||||||
|
"clear":"Delete Tickets",
|
||||||
|
"helpSwitchSlash":"View Slash Commands",
|
||||||
|
"helpSwitchText":"View Text Commands",
|
||||||
|
"helpPage":"Page {0}",
|
||||||
|
"withReason":"With Reason",
|
||||||
|
"withoutTranscript":"Without Transcript"
|
||||||
|
},
|
||||||
|
"titles":{
|
||||||
|
"created":"Ticket Created",
|
||||||
|
"close":"Ticket Closed",
|
||||||
|
"delete":"Ticket Deleted",
|
||||||
|
"reopen":"Ticket Reopened",
|
||||||
|
"claim":"Ticket Claimed",
|
||||||
|
"unclaim":"Ticket Unclaimed",
|
||||||
|
"pin":"Ticket Pinned",
|
||||||
|
"unpin":"Ticket Unpinned",
|
||||||
|
"rename":"Ticket Renamed",
|
||||||
|
"move":"Ticket Moved",
|
||||||
|
"add":"Ticket User Added",
|
||||||
|
"remove":"Ticket User Removed",
|
||||||
|
|
||||||
|
"help":"Available Commands",
|
||||||
|
"statsReset":"Reset Stats",
|
||||||
|
"blacklistAdd":"User Blacklisted",
|
||||||
|
"blacklistRemove":"User Released",
|
||||||
|
"blacklistGet":"Blacklisted User",
|
||||||
|
"blacklistView":"Current Blacklist",
|
||||||
|
"blacklistAddDm":"Added To Blacklist",
|
||||||
|
"blacklistRemoveDm":"Removed From Blacklist",
|
||||||
|
"clear":"Tickets Cleared",
|
||||||
|
"roles":"Roles Updated",
|
||||||
|
|
||||||
|
"autoclose":"Ticket Autoclosed",
|
||||||
|
"autocloseEnabled":"Autoclose Enabled",
|
||||||
|
"autocloseDisabled":"Autoclose Disabled",
|
||||||
|
"autodelete":"Ticket Autodeleted",
|
||||||
|
"autodeleteEnabled":"Autodelete Enabled",
|
||||||
|
"autodeleteDisabled":"Autodelete Disabled"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"create":"Your ticket has been created. Click the button below to access it!",
|
||||||
|
"close":"The ticket has been closed succesfully!",
|
||||||
|
"delete":"The ticket has been deleted succesfully!",
|
||||||
|
"reopen":"The ticket has been reopened succesfully!",
|
||||||
|
"claim":"The ticket has been claimed succesfully!",
|
||||||
|
"unclaim":"The ticket has been unclaimed succesfully!",
|
||||||
|
"pin":"The ticket has been pinned succesfully!",
|
||||||
|
"unpin":"The ticket has been unpinned succesfully!",
|
||||||
|
"rename":"The ticket has been renamed to {0} succesfully!",
|
||||||
|
"move":"The ticket has been moved to {0} succesfully!",
|
||||||
|
"add":"{0} has been added to the ticket succesfully!",
|
||||||
|
"remove":"{0} has been removed from the ticket succesfully!",
|
||||||
|
|
||||||
|
"helpExplanation":"`<name>` => required parameter\n`[name]` => optional parameter",
|
||||||
|
"statsReset":"The bot stats have been reset successfully!",
|
||||||
|
"statsError":"Unable to view ticket stats!\n{0} is not a ticket!",
|
||||||
|
"blacklistAdd":"{0} has been blacklisted successfully!",
|
||||||
|
"blacklistRemove":"{0} has been released successfully!",
|
||||||
|
"blacklistGetSuccess":"{0} is currently blacklisted!",
|
||||||
|
"blacklistGetEmpty":"{0} is currently not blacklisted!",
|
||||||
|
"blacklistViewEmpty":"No-one has been blacklisted yet!",
|
||||||
|
"blacklistViewTip":"Use \"/blacklist add\" to blacklist a user!",
|
||||||
|
"clearVerify":"Are you sure you want to delete multiple tickets?\nThis action can't be undone!",
|
||||||
|
"clearReady":"{0} tickets have been deleted succesfully!",
|
||||||
|
"rolesEmpty":"No roles have been updated!",
|
||||||
|
|
||||||
|
"autocloseLeave":"This ticket has been autoclosed because the creator left the server!",
|
||||||
|
"autocloseTimeout":"This ticket has been autoclosed because it has been inactive for more than `{0}h`!",
|
||||||
|
"autodeleteLeave":"This ticket has been autodeleted because the creator left the server!",
|
||||||
|
"autodeleteTimeout":"This ticket has been autodeleted because it has been inactive for more than `{0} days`!",
|
||||||
|
"autocloseEnabled":"Autoclose has been enabled in this ticket!\nIt will be closed when it is inactive for more than `{0}h`!",
|
||||||
|
"autocloseDisabled":"Autoclose has been disabled in this ticket!\nIt won't be closed automatically anymore!",
|
||||||
|
"autodeleteEnabled":"Autodelete has been enabled in this ticket!\nIt will be deleted when it is inactive for more than `{0} days`!",
|
||||||
|
"autodeleteDisabled":"Autodelete has been disabled in this ticket!\nIt won't be deleted automatically anymore!",
|
||||||
|
|
||||||
|
"ticketMessageLimit":"You can only create {0} ticket(s) at the same time!",
|
||||||
|
"ticketMessageAutoclose":"This ticket will be autoclosed when inactive for {0}h!",
|
||||||
|
"ticketMessageAutodelete":"This ticket will be autodeleted when inactive for {0} days!",
|
||||||
|
"panelReady":"You can find the panel below!\nThis message can now be deleted!"
|
||||||
|
},
|
||||||
|
"modal":{
|
||||||
|
"closePlaceholder":"Why did you close this ticket?",
|
||||||
|
"deletePlaceholder":"Why did you delete this ticket?",
|
||||||
|
"reopenPlaceholder":"Why did you reopen this ticket?",
|
||||||
|
"claimPlaceholder":"Why did you claim this ticket?",
|
||||||
|
"unclaimPlaceholder":"Why did you unclaim this ticket?",
|
||||||
|
"pinPlaceholder":"Why did you pin this ticket?",
|
||||||
|
"unpinPlaceholder":"Why did you unpin this ticket?"
|
||||||
|
},
|
||||||
|
"logs":{
|
||||||
|
"createLog":"A new ticket got created by {0}!",
|
||||||
|
"closeLog":"This ticket has been closed by {0}!",
|
||||||
|
"closeDm":"Your ticket has been closed in our server!",
|
||||||
|
"deleteLog":"This ticket has been deleted by {0}!",
|
||||||
|
"deleteDm":"Your ticket has been deleted in our server!",
|
||||||
|
"reopenLog":"This ticket has been reopened by {0}!",
|
||||||
|
"reopenDm":"Your ticket has been reopened in our server!",
|
||||||
|
"claimLog":"This ticket has been claimed by {0}!",
|
||||||
|
"claimDm":"Your ticket has been claimed in our server!",
|
||||||
|
"unclaimLog":"This ticket has been unclaimed by {0}!",
|
||||||
|
"unclaimDm":"Your ticket has been unclaimed in our server!",
|
||||||
|
"pinLog":"This ticket has been pinned by {0}!",
|
||||||
|
"pinDm":"Your ticket has been pinned in our server!",
|
||||||
|
"unpinLog":"This ticket has been unpinned by {0}!",
|
||||||
|
"unpinDm":"Your ticket has been unpinned in our server!",
|
||||||
|
"renameLog":"This ticket has been renamed to {0} by {1}!",
|
||||||
|
"renameDm":"Your ticket has been renamed to {0} in our server!",
|
||||||
|
"moveLog":"This ticket has been moved to {0} by {1}!",
|
||||||
|
"moveDm":"Your ticket has been moved to {0} in our server!",
|
||||||
|
"addLog":"{0} has been added to this ticket by {1}!",
|
||||||
|
"addDm":"{0} has been added to your ticket in our server!",
|
||||||
|
"removeLog":"{0} has been removed from this ticket by {1}!",
|
||||||
|
"removeDm":"{0} has been removed from your ticket in our server!",
|
||||||
|
|
||||||
|
"blacklistAddLog":"{0} was blacklisted by {1}!",
|
||||||
|
"blacklistRemoveLog":"{0} was removed from the blacklist by {1}!",
|
||||||
|
"blacklistAddDm":"You have been blacklisted in our server!\nFrom now on, you are unable to create a ticket!",
|
||||||
|
"blacklistRemoveDm":"You have been removed from the blacklist in our server!\nNow you can create tickets again!",
|
||||||
|
"clearLog":"{0} tickets have been deleted by {1}!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"success":{
|
||||||
|
"visit":"Visit Transcript",
|
||||||
|
"ready":"Transcript Created",
|
||||||
|
"textFileDescription":"This is the text transcript of a deleted ticket!",
|
||||||
|
"htmlProgress":"Please wait while this html transcript is getting processed...",
|
||||||
|
|
||||||
|
"createdChannel":"A new {0} transcript has been created in the server!",
|
||||||
|
"createdCreator":"A new {0} transcript has been created for one of your tickets!",
|
||||||
|
"createdParticipant":"A new {0} transcript has been created in one of the tickets you participated in!",
|
||||||
|
"createdActiveAdmin":"A new {0} transcript has been created in one of the tickets you participated as admin!",
|
||||||
|
"createdEveryAdmin":"A new {0} transcript has been created in one of the tickets you were admin in!",
|
||||||
|
"createdOther":"A new {0} transcript has been created!"
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"retry":"Retry",
|
||||||
|
"continue":"Delete Without Transcript",
|
||||||
|
"backup":"Create Backup Transcript",
|
||||||
|
"error":"Something went wrong while trying to create the transcript.\nWhat would you like to do?\n\nThis ticket won't be deleted until you click one of these buttons."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"titles":{
|
||||||
|
"internalError":"Internal Error",
|
||||||
|
"optionMissing":"Command Option Missing",
|
||||||
|
"optionInvalid":"Command Option Invalid",
|
||||||
|
"unknownCommand":"Unknown Command",
|
||||||
|
"noPermissions":"No Permissions",
|
||||||
|
"unknownTicket":"Unknown Ticket",
|
||||||
|
"deprecatedTicket":"Deprecated Ticket",
|
||||||
|
"unknownOption":"Unknown Option",
|
||||||
|
"unknownPanel":"Unknown Panel",
|
||||||
|
"notInGuild":"Not In Server",
|
||||||
|
"channelRename":"Unable To Rename Channel",
|
||||||
|
"busy":"Ticket Is Busy"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"askForInfo":"Contact the owner of this bot for more info!",
|
||||||
|
"askForInfoResolve":"Contact the bot owner of this bot if this issue doesn't resolve after a few tries.",
|
||||||
|
"internalError":"Failed to respond to this {0} due to an internal error!",
|
||||||
|
"optionMissing":"A required parameter is missing in this command!",
|
||||||
|
"optionInvalid":"A parameter in this command is invalid!",
|
||||||
|
"optionInvalidChoose":"Choose between",
|
||||||
|
"unknownCommand":"Try visiting the help menu for more info!",
|
||||||
|
"noPermissions":"You are not allowed to use this {0}!",
|
||||||
|
"noPermissionsList":"Required Permissions: (one of them)",
|
||||||
|
"noPermissionsCooldown":"You are not allowed to use this {0} because you have a cooldown!",
|
||||||
|
"noPermissionsBlacklist":"You are not allowed to use this {0} because you have been blacklisted!",
|
||||||
|
"noPermissionsLimitGlobal":"You are not allowed to create a ticket because the server reached the max tickets limit!",
|
||||||
|
"noPermissionsLimitGlobalUser":"You are not allowed to create a ticket because you reached the max tickets limit!",
|
||||||
|
"noPermissionsLimitOption":"You are not allowed to create a ticket because the server reached the max tickets limit for this option!",
|
||||||
|
"noPermissionsLimitOptionUser":"You are not allowed to create a ticket because you reached the max tickets limit for this option!",
|
||||||
|
"unknownTicket":"Try this command again in a valid ticket!",
|
||||||
|
"deprecatedTicket":"The current channel is not a valid ticket! It might have been a ticket from an old Open Ticket version!",
|
||||||
|
"notInGuild":"This {0} doesn't work in DM! Please try it again in a server!",
|
||||||
|
"channelRename":"Due to discord ratelimits, it's currently impossible for the bot to rename the channel. The channel will automatically be renamed over 10 minutes if the bot isn't rebooted.",
|
||||||
|
"channelRenameSource":"The source of this error is: {0}",
|
||||||
|
"busy":"Unable to use this {0}!\nThe ticket is currently being processed by the bot.\n\nPlease try again in a few seconds!"
|
||||||
|
},
|
||||||
|
"optionInvalidReasons":{
|
||||||
|
"stringRegex":"Value doesn't match pattern!",
|
||||||
|
"stringMinLength":"Value needs to be at least {0} characters!",
|
||||||
|
"stringMaxLength":"Value needs to be at most {0} characters!",
|
||||||
|
"numberInvalid":"Invalid number!",
|
||||||
|
"numberMin":"Number needs to be at least {0}!",
|
||||||
|
"numberMax":"Number needs to be at most {0}!",
|
||||||
|
"numberDecimal":"Number is not allowed to be a decimal!",
|
||||||
|
"numberNegative":"Number is not allowed to be negative!",
|
||||||
|
"numberPositive":"Number is not allowed to be positive!",
|
||||||
|
"numberZero":"Number is not allowed to be zero!",
|
||||||
|
"channelNotFound":"Unable to find channel!",
|
||||||
|
"userNotFound":"Unable to find user!",
|
||||||
|
"roleNotFound":"Unable to find role!",
|
||||||
|
"memberNotFound":"Unable to find user!",
|
||||||
|
"mentionableNotFound":"Unable to find user or role!",
|
||||||
|
"channelType":"Invalid channel type!",
|
||||||
|
"notInGuild":"This option requires you to be in a server!"
|
||||||
|
},
|
||||||
|
"permissions":{
|
||||||
|
"developer":"You need to be the developer of the bot.",
|
||||||
|
"owner":"You need to be the server owner.",
|
||||||
|
"admin":"You need to be a server admin.",
|
||||||
|
"moderator":"You need to be a moderator.",
|
||||||
|
"support":"You need to be in the support team.",
|
||||||
|
"member":"You need to be a member.",
|
||||||
|
"discord-administrator":"You need to have the `ADMINISTRATOR` permission."
|
||||||
|
},
|
||||||
|
"actionInvalid":{
|
||||||
|
"close":"Ticket is already closed!",
|
||||||
|
"reopen":"Ticket is not closed yet!",
|
||||||
|
"claim":"Ticket is already claimed!",
|
||||||
|
"unclaim":"Ticket is not claimed yet!",
|
||||||
|
"pin":"Ticket is already pinned!",
|
||||||
|
"unpin":"Ticket is not pinned yet!",
|
||||||
|
"add":"This user is already able to access the ticket!",
|
||||||
|
"remove":"Unable to remove this user from the ticket!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"params":{
|
||||||
|
"uppercase":{
|
||||||
|
"ticket":"Ticket",
|
||||||
|
"tickets":"Tickets",
|
||||||
|
"reason":"Reason",
|
||||||
|
"creator":"Creator",
|
||||||
|
"remaining":"Time Remaining",
|
||||||
|
"added":"Added",
|
||||||
|
"removed":"Removed",
|
||||||
|
"filter":"Filter",
|
||||||
|
"claimedBy":"Claimed By {0}",
|
||||||
|
"method":"Method",
|
||||||
|
"type":"Type",
|
||||||
|
"blacklisted":"Blacklisted",
|
||||||
|
"panel":"Panel",
|
||||||
|
"command":"Command",
|
||||||
|
"system":"System",
|
||||||
|
"true":"True",
|
||||||
|
"false":"False",
|
||||||
|
"syntax":"Syntax",
|
||||||
|
"originalName":"Original Name",
|
||||||
|
"newName":"New Name",
|
||||||
|
"until":"Until",
|
||||||
|
"validOptions":"Valid Options",
|
||||||
|
"validPanels":"Valid Panels",
|
||||||
|
"autoclose":"Autoclose",
|
||||||
|
"autodelete":"Autodelete",
|
||||||
|
"startupDate":"Startup Date",
|
||||||
|
"version":"Version",
|
||||||
|
"name":"Name",
|
||||||
|
"role":"Role",
|
||||||
|
"status":"Status",
|
||||||
|
"claimed":"Claimed",
|
||||||
|
"pinned":"Pinned",
|
||||||
|
"creationDate":"Creation Date"
|
||||||
|
},
|
||||||
|
"lowercase":{
|
||||||
|
"text":"text",
|
||||||
|
"html":"html",
|
||||||
|
"command":"command",
|
||||||
|
"modal":"modal",
|
||||||
|
"button":"button",
|
||||||
|
"dropdown":"dropdown",
|
||||||
|
"method":"method"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"reason":"Specify an optional reason that will be visible in logs.",
|
||||||
|
"help":"Get a list of all the available commands.",
|
||||||
|
"panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
|
||||||
|
"panelId":"The identifier of the panel that you want to spawn.",
|
||||||
|
"panelAutoUpdate":"Do you want this panel to automatically update when edited?",
|
||||||
|
"ticket":"Instantly create a ticket.",
|
||||||
|
"ticketId":"The identifier of the ticket that you want to create.",
|
||||||
|
"close":"Close a ticket.",
|
||||||
|
"delete":"Delete a ticket.",
|
||||||
|
"deleteNoTranscript":"Delete this ticket without creating a transcript.",
|
||||||
|
"reopen":"Reopen a ticket.",
|
||||||
|
"claim":"Claim a ticket.",
|
||||||
|
"claimUser":"Claim this ticket to someone else instead of yourself.",
|
||||||
|
"unclaim":"Unclaim a ticket.",
|
||||||
|
"pin":"Pin a ticket.",
|
||||||
|
"unpin":"Unpin a ticket.",
|
||||||
|
"move":"Move a ticket.",
|
||||||
|
"moveId":"The identifier of the option that you want to move to.",
|
||||||
|
"rename":"Rename a ticket.",
|
||||||
|
"renameName":"The new name for this ticket.",
|
||||||
|
"add":"Add a user to a ticket.",
|
||||||
|
"addUser":"The user to add.",
|
||||||
|
"remove":"Remove a user from a ticket.",
|
||||||
|
"removeUser":"The user to remove.",
|
||||||
|
"blacklist":"Manage the ticket blacklist.",
|
||||||
|
"blacklistView":"View a list of the current blacklist.",
|
||||||
|
"blacklistAdd":"Add a user to the blacklist.",
|
||||||
|
"blacklistRemove":"Remove a user from the blacklist.",
|
||||||
|
"blacklistGet":"Get the details from a blacklisted user.",
|
||||||
|
"blacklistGetUser":"The user to get details from.",
|
||||||
|
"stats":"View statistics from the bot, a member or a ticket.",
|
||||||
|
"statsReset":"Reset all the stats of the bot (and start counting from zero).",
|
||||||
|
"statsGlobal":"View the global stats.",
|
||||||
|
"statsUser":"View the stats from a user in the server.",
|
||||||
|
"statsUserUser":"The user to view.",
|
||||||
|
"statsTicket":"View the stats of a ticket in the server.",
|
||||||
|
"statsTicketTicket":"The ticket to view.",
|
||||||
|
"clear":"Delete multiple tickets at the same time.",
|
||||||
|
"clearFilter":"The filter for clearing tickets.",
|
||||||
|
"clearFilters":{
|
||||||
|
"all":"All",
|
||||||
|
"open":"Open",
|
||||||
|
"close":"Closed",
|
||||||
|
"claim":"Claimed",
|
||||||
|
"unclaim":"Unclaimed",
|
||||||
|
"pin":"Pinned",
|
||||||
|
"unpin":"Unpinned",
|
||||||
|
"autoclose":"Autoclosed"
|
||||||
|
},
|
||||||
|
"autoclose":"Manage autoclose in a ticket.",
|
||||||
|
"autocloseDisable":"Disable autoclose in this ticket.",
|
||||||
|
"autocloseEnable":"Enable autoclose in this ticket.",
|
||||||
|
"autocloseEnableTime":"The amount of hours this ticket needs to be inactive to close it.",
|
||||||
|
"autodelete":"Manage autodelete in a ticket.",
|
||||||
|
"autodeleteDisable":"Disable autodelete in this ticket.",
|
||||||
|
"autodeleteEnable":"Enable autodelete in this ticket.",
|
||||||
|
"autodeleteEnableTime":"The amount of days this ticket needs to be inactive to delete it."
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"help":"Get a list of all the available commands.",
|
||||||
|
"ticket":"Instantly create a ticket.",
|
||||||
|
"close":"Close a ticket, this disables writing in this channel.",
|
||||||
|
"delete":"Delete a ticket, this creates a transcript when enabled.",
|
||||||
|
"reopen":"Reopen a ticket, this enables writing in this channel again.",
|
||||||
|
"pin":"Pin a ticket. This will move the ticket to the top and will add a '📌' emoij to the name.",
|
||||||
|
"unpin":"Unpin a ticket. The ticket will stay on it's position but will lose the '📌' emoij.",
|
||||||
|
"move":"Move a ticket. This will change the type of this ticket.",
|
||||||
|
"rename":"Rename a ticket. This will change the channel name of this ticket.",
|
||||||
|
"claim":"Claim a ticket. With this, you can let your team know you are handling this ticket.",
|
||||||
|
"unclaim":"Unclaim a ticket. With this, you can let your team know that this ticket is free again.",
|
||||||
|
"add":"Add a user to a ticket. This will allow the user to read & write in this ticket.",
|
||||||
|
"remove":"Remove a user from a ticket. This will remove the ability to read & write for a user in this ticket.",
|
||||||
|
"panel":"Spawn a message with a dropdown or buttons (for ticket creation).",
|
||||||
|
"blacklistView":"View a list of the current blacklist.",
|
||||||
|
"blacklistAdd":"Add a user to the blacklist.",
|
||||||
|
"blacklistRemove":"Remove a user from the blacklist.",
|
||||||
|
"blacklistGet":"Get the details from a blacklisted user.",
|
||||||
|
"statsGlobal":"View the global stats.",
|
||||||
|
"statsTicket":"View the stats of a ticket in the server.",
|
||||||
|
"statsUser":"View the stats from a user in the server.",
|
||||||
|
"statsReset":"Reset all the stats of the bot (and start counting from zero).",
|
||||||
|
"autocloseDisable":"Disable autoclose in this ticket.",
|
||||||
|
"autocloseEnable":"Enable autoclose in this ticket.",
|
||||||
|
"autodeleteDisable":"Disable autodelete in this ticket.",
|
||||||
|
"autodeleteEnable":"Enable autodelete in this ticket."
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"scopes":{
|
||||||
|
"global":"Global Stats",
|
||||||
|
"system":"System Stats",
|
||||||
|
"user":"User Stats",
|
||||||
|
"ticket":"Ticket Stats",
|
||||||
|
"participants":"Participants"
|
||||||
|
},
|
||||||
|
"properties":{
|
||||||
|
"ticketsCreated":"Tickets Created",
|
||||||
|
"ticketsClosed":"Tickets Closed",
|
||||||
|
"ticketsDeleted":"Tickets Deleted",
|
||||||
|
"ticketsReopened":"Tickets Reopened",
|
||||||
|
"ticketsAutoclosed":"Tickets Autoclosed",
|
||||||
|
"ticketsClaimed":"Tickets Claimed",
|
||||||
|
"ticketsPinned":"Tickets Pinned",
|
||||||
|
"ticketsMoved":"Tickets Moved",
|
||||||
|
"usersBlacklisted":"Users Blacklisted",
|
||||||
|
"transcriptsCreated":"Transcripts Created"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,477 @@
|
|||||||
|
{
|
||||||
|
"_TRANSLATION":{
|
||||||
|
"otversion":"v4.0.0",
|
||||||
|
"translator":"quiradon",
|
||||||
|
"lastedited":"20/08/2024",
|
||||||
|
"language":"Portuguese"
|
||||||
|
},
|
||||||
|
"checker":{
|
||||||
|
"system":{
|
||||||
|
"typeError": "[ERRO]",
|
||||||
|
"headerOpenTicket": "ABRIR TICKET",
|
||||||
|
"typeWarning": "[AVISO]",
|
||||||
|
"typeInfo": "[INFORMAÇÃO]",
|
||||||
|
"headerConfigChecker": "Verificador de Configuração",
|
||||||
|
"headerDescription": "verifique erros nos seus arquivos de configuração!",
|
||||||
|
"footerError": "o bot não iniciará até que todos os {0} sejam corrigidos!",
|
||||||
|
"footerWarning": "é recomendado corrigir todos os {0} antes de iniciar!",
|
||||||
|
"footerSupport": "SUPORTE: {0} - DOCS: {1}",
|
||||||
|
"compactInformation": "use {0} para mais informações!",
|
||||||
|
"dataPath": "caminho",
|
||||||
|
"dataDocs": "documentos",
|
||||||
|
"dataMessages": "mensagem"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"stringTooShort": "Esta string não pode ter menos de {0} caracteres!",
|
||||||
|
"stringTooLong": "Esta string não pode ter mais de {0} caracteres!",
|
||||||
|
"stringLengthInvalid": "Esta string precisa ter {0} caracteres!",
|
||||||
|
"stringStartsWith": "Esta string precisa começar com {0}!",
|
||||||
|
"stringEndsWith": "Esta string precisa terminar com {0}!",
|
||||||
|
"stringContains": "Esta string precisa conter {0}!",
|
||||||
|
"stringChoices": "Esta string só pode ser um dos seguintes valores: {0}!",
|
||||||
|
"stringRegex": "Esta string é inválida!",
|
||||||
|
|
||||||
|
"numberTooShort": "Este número não pode ter menos de {0} caracteres!",
|
||||||
|
"numberTooLong": "Este número não pode ter mais de {0} caracteres!",
|
||||||
|
"numberLengthInvalid": "Este número precisa ter {0} caracteres!",
|
||||||
|
"numberTooSmall": "Este número precisa ser pelo menos {0}!",
|
||||||
|
"numberTooLarge": "Este número precisa ser no máximo {0}!",
|
||||||
|
"numberNotEqual": "Este número precisa ser {0}!",
|
||||||
|
"numberStep": "Este número precisa ser um múltiplo de {0}!",
|
||||||
|
"numberStepOffset": "Este número precisa ser um múltiplo de {0} começando com {1}!",
|
||||||
|
"numberStartsWith": "Este número precisa começar com {0}!",
|
||||||
|
"numberEndsWith": "Este número precisa terminar com {0}!",
|
||||||
|
"numberContains": "Este número precisa conter {0}!",
|
||||||
|
"numberChoices": "Este número só pode ser um dos seguintes valores: {0}!",
|
||||||
|
"numberFloat": "Este número não pode ser decimal!",
|
||||||
|
"numberNegative": "Este número não pode ser negativo!",
|
||||||
|
"numberPositive": "Este número não pode ser positivo!",
|
||||||
|
"numberZero": "Este número não pode ser zero!",
|
||||||
|
|
||||||
|
"booleanTrue": "Este booleano não pode ser verdadeiro!",
|
||||||
|
"booleanFalse": "Este booleano não pode ser falso!",
|
||||||
|
|
||||||
|
"arrayEmptyDisabled": "Este array não pode estar vazio!",
|
||||||
|
"arrayEmptyRequired": "Este array deve estar vazio!",
|
||||||
|
"arrayTooShort": "Este array precisa ter um comprimento de pelo menos {0}!",
|
||||||
|
"arrayTooLong": "Este array precisa ter um comprimento de no máximo {0}!",
|
||||||
|
"arrayLengthInvalid": "Este array precisa ter um comprimento de {0}!",
|
||||||
|
"arrayInvalidTypes": "Este array só pode conter os seguintes tipos: {0}!",
|
||||||
|
"arrayDouble": "Este array não permite o mesmo valor duas vezes!",
|
||||||
|
|
||||||
|
"discordInvalidId": "Este é um ID do Discord inválido {0}!",
|
||||||
|
"discordInvalidIdOptions": "Este é um ID do Discord inválido {0}! Você também pode usar um destes: {1}!",
|
||||||
|
"discordInvalidToken": "Este é um token do Discord inválido (sintaticamente)!",
|
||||||
|
"colorInvalid": "Esta é uma cor hexadecimal inválida!",
|
||||||
|
"emojiTooShort": "Esta string precisa ter pelo menos {0} emojis!",
|
||||||
|
"emojiTooLong": "Esta string precisa ter no máximo {0} emojis!",
|
||||||
|
"emojiCustom": "Este emoji não pode ser um emoji personalizado do Discord!",
|
||||||
|
"emojiInvalid": "Este é um emoji inválido!",
|
||||||
|
"urlInvalid": "Esta URL é inválida!",
|
||||||
|
"urlInvalidHttp": "Esta URL só pode usar o protocolo https://!",
|
||||||
|
"urlInvalidProtocol": "Esta URL só pode usar os protocolos http:// e https://!",
|
||||||
|
"urlInvalidHostname": "Esta URL tem um hostname não permitido!",
|
||||||
|
"urlInvalidExtension": "Esta URL tem uma extensão inválida! Escolha entre: {0}!",
|
||||||
|
"urlInvalidPath": "Esta URL tem um caminho inválido!",
|
||||||
|
"idNotUnique": "Este ID não é único, use outro ID!",
|
||||||
|
"idNonExistent": "O ID {0} não existe!",
|
||||||
|
|
||||||
|
"invalidType": "Esta propriedade precisa ser do tipo: {0}!",
|
||||||
|
"propertyMissing": "A propriedade {0} está faltando neste objeto!",
|
||||||
|
"propertyOptional": "A propriedade {0} é opcional neste objeto!",
|
||||||
|
"objectDisabled": "Este objeto está desabilitado, habilite-o usando {0}!",
|
||||||
|
"nullInvalid": "Esta propriedade não pode ser nula!",
|
||||||
|
"switchInvalidType": "Isso precisa ser um dos seguintes tipos: {0}!",
|
||||||
|
"objectSwitchInvalid": "Este objeto precisa ser um dos seguintes tipos: {0}!",
|
||||||
|
|
||||||
|
"invalidLanguage": "Este é um idioma inválido!",
|
||||||
|
"invalidButton": "Este botão precisa ter pelo menos um {0} ou {1}!",
|
||||||
|
"unusedOption": "A opção {0} não é usada em nenhum lugar!",
|
||||||
|
"unusedQuestion": "A pergunta {0} não é usada em nenhum lugar!",
|
||||||
|
"dropdownOption": "Um painel com dropdown habilitado só pode conter opções do tipo 'ticket'!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"actions":{
|
||||||
|
"buttons":{
|
||||||
|
"create": "Visitar Ticket",
|
||||||
|
"close": "Fechar Ticket",
|
||||||
|
"delete": "Excluir Ticket",
|
||||||
|
"reopen": "Reabrir Ticket",
|
||||||
|
"claim": "Reivindicar Ticket",
|
||||||
|
"unclaim": "Desreivindicar Ticket",
|
||||||
|
"pin": "Fixar Ticket",
|
||||||
|
"unpin": "Desfixar Ticket",
|
||||||
|
"clear": "Excluir Tickets",
|
||||||
|
"helpSwitchSlash": "Ver Comandos Slash",
|
||||||
|
"helpSwitchText": "Ver Comandos de Texto",
|
||||||
|
"helpPage": "Página {0}",
|
||||||
|
"withReason": "Com Motivo",
|
||||||
|
"withoutTranscript": "Sem Transcrição"
|
||||||
|
},
|
||||||
|
"titles":{
|
||||||
|
"created":"Ticket Criado",
|
||||||
|
"close":"Ticket Fechado",
|
||||||
|
"delete":"Ticket Deletado",
|
||||||
|
"reopen":"Ticket Re-abeto",
|
||||||
|
"claim":"Ticket Resgatado",
|
||||||
|
"unclaim":"Ticket Não Resgatado",
|
||||||
|
"pin":"Ticket Fixado",
|
||||||
|
"unpin":"Ticket Desfixado",
|
||||||
|
"rename":"Ticket Renomeado",
|
||||||
|
"move":"Ticket Movido",
|
||||||
|
"add":"Ticket Usuário Adicionado",
|
||||||
|
"remove":"Ticket Usuário Removido",
|
||||||
|
|
||||||
|
"help":"Comandos disponíveis",
|
||||||
|
"statsReset":"Redefinir Status",
|
||||||
|
"blacklistAdd":"User Blacklisted",
|
||||||
|
"blacklistRemove":"User Released",
|
||||||
|
"blacklistGet":"Usuário na Blacklisted",
|
||||||
|
"blacklistView":"Atualmente na Blacklist",
|
||||||
|
"blacklistAddDm":"Adicionado a Blacklist",
|
||||||
|
"blacklistRemoveDm":"Removido da Blacklist",
|
||||||
|
"clear":"Tickets Limpos",
|
||||||
|
"roles":"Cargos Atualizados",
|
||||||
|
|
||||||
|
"autoclose": "Ticket Fechado Automaticamente",
|
||||||
|
"autocloseEnabled": "Fechamento Automático Habilitado",
|
||||||
|
"autocloseDisabled": "Fechamento Automático Desabilitado",
|
||||||
|
"autodelete": "Ticket Excluído Automaticamente",
|
||||||
|
"autodeleteEnabled": "Exclusão Automática Habilitada",
|
||||||
|
"autodeleteDisabled": "Exclusão Automática Desabilitada"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"create": "Seu ticket foi criado. Clique no botão abaixo para acessá-lo!",
|
||||||
|
"close": "O ticket foi fechado com sucesso!",
|
||||||
|
"delete": "O ticket foi excluído com sucesso!",
|
||||||
|
"reopen": "O ticket foi reaberto com sucesso!",
|
||||||
|
"claim": "O ticket foi reivindicado com sucesso!",
|
||||||
|
"unclaim": "O ticket foi desreivindicado com sucesso!",
|
||||||
|
"pin": "O ticket foi fixado com sucesso!",
|
||||||
|
"unpin": "O ticket foi desfixado com sucesso!",
|
||||||
|
"rename": "O ticket foi renomeado para {0} com sucesso!",
|
||||||
|
"move": "O ticket foi movido para {0} com sucesso!",
|
||||||
|
"add": "{0} foi adicionado ao ticket com sucesso!",
|
||||||
|
"remove": "{0} foi removido do ticket com sucesso!",
|
||||||
|
|
||||||
|
"helpExplanation":"`<nome>` => parâmetro obrigatório\n`[nome]` => parâmetro opcional",
|
||||||
|
"statsReset":"As estatísticas do bot foram redefinidas com sucesso!",
|
||||||
|
"statsError":"Não foi possível visualizar as estatísticas do ticket!\n{0} não é um ticket!",
|
||||||
|
"blacklistAdd":"{0} foi adicionado à lista negra com sucesso!",
|
||||||
|
"blacklistRemove":"{0} foi removido da lista negra com sucesso!",
|
||||||
|
"blacklistGetSuccess":"{0} está atualmente na lista negra!",
|
||||||
|
"blacklistGetEmpty":"{0} não está atualmente na lista negra!",
|
||||||
|
"blacklistViewEmpty":"Ninguém foi adicionado à lista negra ainda!",
|
||||||
|
"blacklistViewTip":"Use \"/blacklist add\" para adicionar um usuário à lista negra!",
|
||||||
|
"clearVerify":"Você tem certeza de que deseja excluir vários tickets?\nEsta ação não pode ser desfeita!",
|
||||||
|
"clearReady":"{0} tickets foram excluídos com sucesso!",
|
||||||
|
"rolesEmpty":"Nenhum cargo foi atualizado!",
|
||||||
|
|
||||||
|
"autocloseLeave": "Este ticket foi fechado automaticamente porque o criador saiu do servidor!",
|
||||||
|
"autocloseTimeout": "Este ticket foi fechado automaticamente porque ficou inativo por mais de `{0}h`!",
|
||||||
|
"autodeleteLeave": "Este ticket foi excluído automaticamente porque o criador saiu do servidor!",
|
||||||
|
"autodeleteTimeout": "Este ticket foi excluído automaticamente porque ficou inativo por mais de `{0} dias`!",
|
||||||
|
"autocloseEnabled": "O fechamento automático foi habilitado neste ticket!\nEle será fechado quando ficar inativo por mais de `{0}h`!",
|
||||||
|
"autocloseDisabled": "O fechamento automático foi desabilitado neste ticket!\nEle não será mais fechado automaticamente!",
|
||||||
|
"autodeleteEnabled": "A exclusão automática foi habilitada neste ticket!\nEle será excluído quando ficar inativo por mais de `{0} dias`!",
|
||||||
|
"autodeleteDisabled": "A exclusão automática foi desabilitada neste ticket!\nEle não será mais excluído automaticamente!",
|
||||||
|
|
||||||
|
"ticketMessageLimit": "Você só pode criar {0} ticket(s) ao mesmo tempo!",
|
||||||
|
"ticketMessageAutoclose": "Este ticket será fechado automaticamente quando inativo por {0}h!",
|
||||||
|
"ticketMessageAutodelete": "Este ticket será excluído automaticamente quando inativo por {0} dias!",
|
||||||
|
"panelReady": "Você pode encontrar o painel abaixo!\nEsta mensagem agora pode ser excluída!"
|
||||||
|
},
|
||||||
|
"modal":{
|
||||||
|
"closePlaceholder": "Por que você fechou este ticket?",
|
||||||
|
"deletePlaceholder": "Por que você excluiu este ticket?",
|
||||||
|
"reopenPlaceholder": "Por que você reabriu este ticket?",
|
||||||
|
"claimPlaceholder": "Por que você reivindicou este ticket?",
|
||||||
|
"unclaimPlaceholder": "Por que você desreivindicou este ticket?",
|
||||||
|
"pinPlaceholder": "Por que você fixou este ticket?",
|
||||||
|
"unpinPlaceholder": "Por que você desfixou este ticket?"
|
||||||
|
},
|
||||||
|
"logs":{
|
||||||
|
"createLog": "Um novo ticket foi criado por {0}!",
|
||||||
|
"closeLog": "Este ticket foi fechado por {0}!",
|
||||||
|
"closeDm": "Seu ticket foi fechado em nosso servidor!",
|
||||||
|
"deleteLog": "Este ticket foi excluído por {0}!",
|
||||||
|
"deleteDm": "Seu ticket foi excluído em nosso servidor!",
|
||||||
|
"reopenLog": "Este ticket foi reaberto por {0}!",
|
||||||
|
"reopenDm": "Seu ticket foi reaberto em nosso servidor!",
|
||||||
|
"claimLog": "Este ticket foi reivindicado por {0}!",
|
||||||
|
"claimDm": "Seu ticket foi reivindicado em nosso servidor!",
|
||||||
|
"unclaimLog": "Este ticket foi desreivindicado por {0}!",
|
||||||
|
"unclaimDm": "Seu ticket foi desreivindicado em nosso servidor!",
|
||||||
|
"pinLog": "Este ticket foi fixado por {0}!",
|
||||||
|
"pinDm": "Seu ticket foi fixado em nosso servidor!",
|
||||||
|
"unpinLog": "Este ticket foi desfixado por {0}!",
|
||||||
|
"unpinDm": "Seu ticket foi desfixado em nosso servidor!",
|
||||||
|
"renameLog": "Este ticket foi renomeado para {0} por {1}!",
|
||||||
|
"renameDm": "Seu ticket foi renomeado para {0} em nosso servidor!",
|
||||||
|
"moveLog": "Este ticket foi movido para {0} por {1}!",
|
||||||
|
"moveDm": "Seu ticket foi movido para {0} em nosso servidor!",
|
||||||
|
"addLog": "{0} foi adicionado a este ticket por {1}!",
|
||||||
|
"addDm": "{0} foi adicionado ao seu ticket em nosso servidor!",
|
||||||
|
"removeLog": "{0} foi removido deste ticket por {1}!",
|
||||||
|
"removeDm": "{0} foi removido do seu ticket em nosso servidor!",
|
||||||
|
|
||||||
|
"blacklistAddLog": "{0} foi adicionado à lista negra por {1}!",
|
||||||
|
"blacklistRemoveLog": "{0} foi removido da lista negra por {1}!",
|
||||||
|
"blacklistAddDm": "Você foi adicionado à lista negra em nosso servidor!\nA partir de agora, você não pode criar um ticket!",
|
||||||
|
"blacklistRemoveDm": "Você foi removido da lista negra em nosso servidor!\nAgora você pode criar tickets novamente!",
|
||||||
|
"clearLog": "{0} tickets foram excluídos por {1}!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"success":{
|
||||||
|
"visit": "Visitar Transcrição",
|
||||||
|
"ready": "Transcrição Criada",
|
||||||
|
"textFileDescription": "Esta é a transcrição em texto de um ticket excluído!",
|
||||||
|
"htmlProgress": "Por favor, aguarde enquanto esta transcrição em HTML está sendo processada...",
|
||||||
|
|
||||||
|
"createdChannel": "Uma nova transcrição de {0} foi criada no servidor!",
|
||||||
|
"createdCreator": "Uma nova transcrição de {0} foi criada para um dos seus tickets!",
|
||||||
|
"createdParticipant": "Uma nova transcrição de {0} foi criada em um dos tickets em que você participou!",
|
||||||
|
"createdActiveAdmin": "Uma nova transcrição de {0} foi criada em um dos tickets em que você participou como administrador!",
|
||||||
|
"createdEveryAdmin": "Uma nova transcrição de {0} foi criada em um dos tickets em que você era administrador!",
|
||||||
|
"createdOther": "Uma nova transcrição de {0} foi criada!"
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"retry": "Tentar Novamente",
|
||||||
|
"continue": "Excluir Sem Transcrição",
|
||||||
|
"backup": "Criar Transcrição de Backup",
|
||||||
|
"error": "Algo deu errado ao tentar criar a transcrição.\nO que você gostaria de fazer?\n\nEste ticket não será excluído até que você clique em um desses botões."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"errors":{
|
||||||
|
"titles":{
|
||||||
|
"internalError": "Erro Interno",
|
||||||
|
"optionMissing": "Opção de Comando Ausente",
|
||||||
|
"optionInvalid": "Opção de Comando Inválida",
|
||||||
|
"unknownCommand": "Comando Desconhecido",
|
||||||
|
"noPermissions": "Sem Permissões",
|
||||||
|
"unknownTicket": "Ticket Desconhecido",
|
||||||
|
"deprecatedTicket": "Ticket Obsoleto",
|
||||||
|
"unknownOption": "Opção Desconhecida",
|
||||||
|
"unknownPanel": "Painel Desconhecido",
|
||||||
|
"notInGuild": "Não Está no Servidor",
|
||||||
|
"channelRename": "Incapaz de Renomear Canal",
|
||||||
|
"busy": "Ticket Está Ocupado"
|
||||||
|
},
|
||||||
|
"descriptions":{
|
||||||
|
"askForInfo": "Entre em contato com o proprietário deste bot para mais informações!",
|
||||||
|
"askForInfoResolve": "Entre em contato com o proprietário deste bot se este problema não for resolvido após algumas tentativas.",
|
||||||
|
"internalError": "Falha ao responder a este {0} devido a um erro interno!",
|
||||||
|
"optionMissing": "Um parâmetro obrigatório está faltando neste comando!",
|
||||||
|
"optionInvalid": "Um parâmetro neste comando é inválido!",
|
||||||
|
"optionInvalidChoose": "Escolha entre",
|
||||||
|
"unknownCommand": "Tente visitar o menu de ajuda para mais informações!",
|
||||||
|
"noPermissions": "Você não tem permissão para usar este {0}!",
|
||||||
|
"noPermissionsList": "Permissões Necessárias: (uma delas)",
|
||||||
|
"noPermissionsCooldown": "Você não tem permissão para usar este {0} porque você está em período de cooldown!",
|
||||||
|
"noPermissionsBlacklist": "Você não tem permissão para usar este {0} porque você foi colocado na lista negra!",
|
||||||
|
"noPermissionsLimitGlobal": "Você não tem permissão para criar um ticket porque o servidor atingiu o limite máximo de tickets!",
|
||||||
|
"noPermissionsLimitGlobalUser": "Você não tem permissão para criar um ticket porque você atingiu o limite máximo de tickets!",
|
||||||
|
"noPermissionsLimitOption": "Você não tem permissão para criar um ticket porque o servidor atingiu o limite máximo de tickets para esta opção!",
|
||||||
|
"noPermissionsLimitOptionUser": "Você não tem permissão para criar um ticket porque você atingiu o limite máximo de tickets para esta opção!",
|
||||||
|
"unknownTicket": "Tente este comando novamente em um ticket válido!",
|
||||||
|
"deprecatedTicket": "O canal atual não é um ticket válido! Pode ter sido um ticket de uma versão antiga do Open Ticket!",
|
||||||
|
"notInGuild": "Este {0} não funciona em DM! Por favor, tente novamente em um servidor!",
|
||||||
|
"channelRename": "Devido aos limites de taxa do Discord, atualmente é impossível para o bot renomear o canal. O canal será renomeado automaticamente em 10 minutos se o bot não for reiniciado.",
|
||||||
|
"channelRenameSource": "A fonte deste erro é: {0}",
|
||||||
|
"busy": "Não é possível usar este {0}!\nO ticket está sendo processado pelo bot no momento.\n\nPor favor, tente novamente em alguns segundos!"
|
||||||
|
},
|
||||||
|
"optionInvalidReasons":{
|
||||||
|
"stringRegex": "O valor não corresponde ao padrão!",
|
||||||
|
"stringMinLength": "O valor precisa ter pelo menos {0} caracteres!",
|
||||||
|
"stringMaxLength": "O valor precisa ter no máximo {0} caracteres!",
|
||||||
|
"numberInvalid": "Número inválido!",
|
||||||
|
"numberMin": "O número precisa ser pelo menos {0}!",
|
||||||
|
"numberMax": "O número precisa ser no máximo {0}!",
|
||||||
|
"numberDecimal": "Não é permitido que o número seja decimal!",
|
||||||
|
"numberNegative": "Não é permitido que o número seja negativo!",
|
||||||
|
"numberPositive": "Não é permitido que o número seja positivo!",
|
||||||
|
"numberZero": "Não é permitido que o número seja zero!",
|
||||||
|
"channelNotFound": "Não foi possível encontrar o canal!",
|
||||||
|
"userNotFound": "Não foi possível encontrar o usuário!",
|
||||||
|
"roleNotFound": "Não foi possível encontrar o cargo!",
|
||||||
|
"memberNotFound": "Não foi possível encontrar o usuário!",
|
||||||
|
"mentionableNotFound": "Não foi possível encontrar o usuário ou cargo!",
|
||||||
|
"channelType": "Tipo de canal inválido!",
|
||||||
|
"notInGuild": "Esta opção requer que você esteja em um servidor!"
|
||||||
|
},
|
||||||
|
"permissions": {
|
||||||
|
"developer": "Você precisa ser o desenvolvedor do bot.",
|
||||||
|
"owner": "Você precisa ser o dono do servidor.",
|
||||||
|
"admin": "Você precisa ser um administrador do servidor.",
|
||||||
|
"moderator": "Você precisa ser um moderador.",
|
||||||
|
"support": "Você precisa estar na equipe de suporte.",
|
||||||
|
"member": "Você precisa ser um membro.",
|
||||||
|
"discord-administrator": "Você precisa ter a permissão `ADMINISTRATOR`."
|
||||||
|
},
|
||||||
|
"actionInvalid":{
|
||||||
|
"close": "O ticket já está fechado!",
|
||||||
|
"reopen": "O ticket ainda não está fechado!",
|
||||||
|
"claim": "O ticket já está reivindicado!",
|
||||||
|
"unclaim": "O ticket ainda não está reivindicado!",
|
||||||
|
"pin": "O ticket já está fixado!",
|
||||||
|
"unpin": "O ticket ainda não está fixado!",
|
||||||
|
"add": "Este usuário já pode acessar o ticket!",
|
||||||
|
"remove": "Não foi possível remover este usuário do ticket!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"params":{
|
||||||
|
"uppercase":{
|
||||||
|
"ticket":"Ticket",
|
||||||
|
"tickets":"Tickets",
|
||||||
|
"reason":"Motivo",
|
||||||
|
"creator":"Criador",
|
||||||
|
"remaining":"Tempo Restante",
|
||||||
|
"added":"Adicionado",
|
||||||
|
"removed":"Removido",
|
||||||
|
"filter":"Filtro",
|
||||||
|
"claimedBy":"Reivindicado por {0}",
|
||||||
|
"method":"Método",
|
||||||
|
"type":"Tipo",
|
||||||
|
"blacklisted":"Na Lista Negra",
|
||||||
|
"panel":"Painel",
|
||||||
|
"command":"Comando",
|
||||||
|
"system":"Sistema",
|
||||||
|
"true":"Verdadeiro",
|
||||||
|
"false":"Falso",
|
||||||
|
"syntax":"Sintaxe",
|
||||||
|
"originalName":"Nome Original",
|
||||||
|
"newName":"Novo Nome",
|
||||||
|
"until":"Até",
|
||||||
|
"validOptions":"Opções Válidas",
|
||||||
|
"validPanels":"Painéis Válidos",
|
||||||
|
"autoclose":"Auto-fechar",
|
||||||
|
"autodelete":"Auto-deletar",
|
||||||
|
"startupDate":"Data de Início",
|
||||||
|
"version":"Versão",
|
||||||
|
"name":"Nome",
|
||||||
|
"role":"Cargo",
|
||||||
|
"status":"Status",
|
||||||
|
"claimed":"Reivindicado",
|
||||||
|
"pinned":"Fixado",
|
||||||
|
"creationDate":"Data de Criação"
|
||||||
|
},
|
||||||
|
"lowercase":{
|
||||||
|
"text":"texto",
|
||||||
|
"html":"html",
|
||||||
|
"command":"comando",
|
||||||
|
"modal":"modal",
|
||||||
|
"button":"botão",
|
||||||
|
"dropdown":"dropdown",
|
||||||
|
"method":"método"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"reason": "Especifique um motivo opcional que será visível nos logs.",
|
||||||
|
"help": "Obtenha uma lista de todos os comandos disponíveis.",
|
||||||
|
"panel": "Gerar uma mensagem com um dropdown ou botões (para criação de tickets).",
|
||||||
|
"panelId": "O identificador do painel que você deseja gerar.",
|
||||||
|
"panelAutoUpdate": "Você quer que este painel atualize automaticamente quando editado?",
|
||||||
|
"ticket": "Crie um ticket instantaneamente.",
|
||||||
|
"ticketId": "O identificador do ticket que você deseja criar.",
|
||||||
|
"close": "Feche um ticket.",
|
||||||
|
"delete": "Exclua um ticket.",
|
||||||
|
"deleteNoTranscript": "Exclua este ticket sem criar uma transcrição.",
|
||||||
|
"reopen": "Reabra um ticket.",
|
||||||
|
"claim": "Assuma um ticket.",
|
||||||
|
"claimUser": "Assuma este ticket para outra pessoa em vez de você mesmo.",
|
||||||
|
"unclaim": "Desassuma um ticket.",
|
||||||
|
"pin": "Fixe um ticket.",
|
||||||
|
"unpin": "Desfixe um ticket.",
|
||||||
|
"move": "Mova um ticket.",
|
||||||
|
"moveId": "O identificador do opção para o qual você deseja mover.",
|
||||||
|
"rename": "Renomeie um ticket.",
|
||||||
|
"renameName": "O novo nome para este ticket.",
|
||||||
|
"add": "Adicione um usuário a um ticket.",
|
||||||
|
"addUser": "O usuário a ser adicionado.",
|
||||||
|
"remove": "Remover um usuário de um ticket.",
|
||||||
|
"removeUser": "O usuário a ser removido.",
|
||||||
|
"blacklist": "Gerenciar a lista negra de tickets.",
|
||||||
|
"blacklistView": "Ver uma lista da blacklist atual.",
|
||||||
|
"blacklistAdd": "Adicionar um usuário à blacklist.",
|
||||||
|
"blacklistRemove": "Remover um usuário da blacklist.",
|
||||||
|
"blacklistGet": "Obter os detalhes de um usuário na blacklist.",
|
||||||
|
"blacklistGetUser": "O usuário para obter detalhes.",
|
||||||
|
"stats": "Ver estatísticas do bot, de um membro ou de um ticket.",
|
||||||
|
"statsReset": "Redefinir todas as estatísticas do bot (e começar a contar do zero).",
|
||||||
|
"statsGlobal": "Ver as estatísticas globais.",
|
||||||
|
"statsUser": "Ver as estatísticas de um usuário no servidor.",
|
||||||
|
"statsUserUser": "O usuário para visualizar.",
|
||||||
|
"statsTicket": "Ver as estatísticas de um ticket no servidor.",
|
||||||
|
"statsTicketTicket": "O ticket para visualizar.",
|
||||||
|
"clear": "Excluir vários tickets ao mesmo tempo. Um filtro opcional pode ser especificado.",
|
||||||
|
"clearFilter": "O filtro para limpar tickets.",
|
||||||
|
"clearFilters": {
|
||||||
|
"all": "Todos",
|
||||||
|
"open": "Aberto",
|
||||||
|
"close": "Fechado",
|
||||||
|
"claim": "Reivindicado",
|
||||||
|
"unclaim": "Não Reivindicado",
|
||||||
|
"pin": "Fixado",
|
||||||
|
"unpin": "Desfixado",
|
||||||
|
"autoclose": "Fechado Automaticamente"
|
||||||
|
},
|
||||||
|
"autoclose": "Gerenciar fechamento automático em um ticket.",
|
||||||
|
"autocloseDisable": "Desabilitar fechamento automático neste ticket.",
|
||||||
|
"autocloseEnable": "Habilitar fechamento automático neste ticket.",
|
||||||
|
"autocloseEnableTime": "A quantidade de horas que este ticket precisa estar inativo para ser fechado.",
|
||||||
|
"autodelete": "Gerenciar exclusão automática em um ticket.",
|
||||||
|
"autodeleteDisable": "Desabilitar exclusão automática neste ticket.",
|
||||||
|
"autodeleteEnable": "Habilitar exclusão automática neste ticket.",
|
||||||
|
"autodeleteEnableTime": "A quantidade de dias que este ticket precisa estar inativo para ser excluído."
|
||||||
|
},
|
||||||
|
"helpMenu": {
|
||||||
|
"help": "Obtenha uma lista de todos os comandos disponíveis.",
|
||||||
|
"ticket": "Crie um ticket instantaneamente.",
|
||||||
|
"close": "Feche um ticket, isso desabilita a escrita neste canal.",
|
||||||
|
"delete": "Exclua um ticket, isso cria uma transcrição quando habilitado.",
|
||||||
|
"reopen": "Reabra um ticket, isso habilita a escrita neste canal novamente.",
|
||||||
|
"pin": "Fixe um ticket. Isso moverá o ticket para o topo e adicionará um emoji '📌' ao nome.",
|
||||||
|
"unpin": "Desfixe um ticket. O ticket permanecerá na sua posição, mas perderá o emoji '📌'.",
|
||||||
|
"move": "Mova um ticket. Isso mudará o tipo deste ticket.",
|
||||||
|
"rename": "Renomeie um ticket. Isso mudará o nome do canal deste ticket.",
|
||||||
|
"claim": "Assuma um ticket. Com isso, você pode informar à sua equipe que está lidando com este ticket.",
|
||||||
|
"unclaim": "Desassuma um ticket. Com isso, você pode informar à sua equipe que este ticket está livre novamente.",
|
||||||
|
"add": "Adicione um usuário a um ticket. Isso permitirá que o usuário leia e escreva neste ticket.",
|
||||||
|
"remove": "Remova um usuário de um ticket. Isso removerá a capacidade de ler e escrever para um usuário neste ticket.",
|
||||||
|
"panel": "Gere uma mensagem com um dropdown ou botões (para criação de tickets).",
|
||||||
|
"blacklistView": "Veja uma lista da blacklist atual.",
|
||||||
|
"blacklistAdd": "Adicione um usuário à blacklist.",
|
||||||
|
"blacklistRemove": "Remova um usuário da blacklist.",
|
||||||
|
"blacklistGet": "Obtenha os detalhes de um usuário na blacklist.",
|
||||||
|
"statsGlobal": "Veja as estatísticas globais.",
|
||||||
|
"statsTicket": "Veja as estatísticas de um ticket no servidor.",
|
||||||
|
"statsUser": "Veja as estatísticas de um usuário no servidor.",
|
||||||
|
"statsReset": "Redefina todas as estatísticas do bot (e comece a contar do zero).",
|
||||||
|
"autocloseDisable": "Desabilite o fechamento automático neste ticket.",
|
||||||
|
"autocloseEnable": "Habilite o fechamento automático neste ticket.",
|
||||||
|
"autodeleteDisable": "Desabilite a exclusão automática neste ticket.",
|
||||||
|
"autodeleteEnable": "Habilite a exclusão automática neste ticket."
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"scopes": {
|
||||||
|
"global": "Status Global",
|
||||||
|
"system": "Status do Sistema",
|
||||||
|
"user": "Status do Usuário",
|
||||||
|
"ticket": "Status do Ticket",
|
||||||
|
"participants": "Participantes"
|
||||||
|
},
|
||||||
|
"properties":{
|
||||||
|
"ticketsCreated":"Tickets Criados",
|
||||||
|
"ticketsClosed":"Tickets Fechados",
|
||||||
|
"ticketsDeleted":"Tickets Deletados",
|
||||||
|
"ticketsReopened":"Tickets Re-Abertos",
|
||||||
|
"ticketsAutoclosed":"Tickets Auto Fechados",
|
||||||
|
"ticketsClaimed":"Tickets Claimados",
|
||||||
|
"ticketsPinned":"Tickets Fixados",
|
||||||
|
"ticketsMoved":"Tickets Movidos",
|
||||||
|
"usersBlacklisted":"Usuários na Blacklist",
|
||||||
|
"transcriptsCreated":"Transcrição Criada"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
-29
@@ -1,31 +1,33 @@
|
|||||||
{
|
{
|
||||||
"name": "open-ticket",
|
"name": "open-ticket",
|
||||||
"version": "2.5.0",
|
"author": "DJdj Development",
|
||||||
"description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.",
|
"version": "4.0.0",
|
||||||
"main": "index.js",
|
"description": "The most advanced open-source discord ticket bot with HTML transcripts, plugins, questions, claiming, pinning & more! Using discord.js v14 & JSON database! ",
|
||||||
"scripts": {
|
"keywords": ["ticket-bot","discord","open-ticket","plugins","discord-ticket-bot"],
|
||||||
"start": "node index.js",
|
"main": "./src/index.ts",
|
||||||
"test": "node index.js d",
|
"scripts": {
|
||||||
"slashEnable": "node index.js slash enable",
|
"verify": "tsc -p ./tsconfig.json",
|
||||||
"slashDisable": "node index.js slash disable",
|
"start": "npx tsx ./src/index.ts",
|
||||||
"cleardata": "node ./core/dynamicdatabase/cleardata.js"
|
"test": "npm run verify && npx tsx ./src/index.ts --dev-config --dev-database"
|
||||||
},
|
},
|
||||||
"author": "DJdj Development",
|
"type": "commonjs",
|
||||||
"license": "ISC",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"ansis": "^2.3.0",
|
||||||
"chalk": "^5.0.1",
|
"discord.js": "^14.15.3",
|
||||||
"discord.js": "^14.0.2",
|
"formatted-json-stringify": "^1.1.0",
|
||||||
"express": "^4.17.1",
|
"tsx": "^4.17.0"
|
||||||
"node": "^16.10.0",
|
},
|
||||||
"node-localstorage": "^2.2.1"
|
"devDependencies": {
|
||||||
},
|
"typescript": "^5.3.3"
|
||||||
"repository": {
|
},
|
||||||
"type": "git",
|
"repository": {
|
||||||
"url": "git+https://github.com/DJj123dj/open-ticket.git"
|
"type": "git",
|
||||||
},
|
"url": "git+https://github.com/DJj123dj/open-ticket.git"
|
||||||
"bugs": {
|
},
|
||||||
"url": "https://github.com/DJj123dj/open-ticket/issues"
|
"bugs": {
|
||||||
},
|
"url": "https://github.com/DJj123dj/open-ticket/issues",
|
||||||
"homepage": "https://github.com/DJj123dj/open-ticket#readme"
|
"email": "support@dj-dj.be"
|
||||||
|
},
|
||||||
|
"homepage": "https://openticket.dj-dj.be"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"testVariable1":true,
|
||||||
|
"testVariable2":123,
|
||||||
|
"testVariable3":"abc"
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import {api, openticket, utilities} from "../../src/index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
//// This plugin is not enabled yet! ////
|
||||||
|
//// Enable it in the plugin.json file! ////
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
|
||||||
|
if (utilities.project != "openticket") throw new api.ODPluginError("This plugin only works in Open Ticket!")
|
||||||
|
if (!utilities.isBeta) throw new api.ODPluginError("This plugin is made for the beta version of Open Ticket!")
|
||||||
|
|
||||||
|
//Add Typescript autocomplete support for plugin data. (!!!OPTIONAL!!!)
|
||||||
|
declare module "../../src/core/api/api.ts" {
|
||||||
|
export interface ODConfigManagerIds_Default {
|
||||||
|
"example-plugin:config":api.ODJsonConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Let's register the example config. This way it's available for all plugins & systems.
|
||||||
|
openticket.events.get("onConfigLoad").listen((configManager) => {
|
||||||
|
configManager.add(new api.ODJsonConfig("example-plugin:config","config.json","./plugins/example-plugin/"))
|
||||||
|
/*===== What did we do? =====
|
||||||
|
- "example-plugin:config" Is the ID of this config. You can use this id troughout the bot to access this config file. Even in other plugins.
|
||||||
|
- "config.json" Is the FILE of this config. It is just the filename.
|
||||||
|
- "./plugins/example-plugin/" Is the DIRECTORY of this config. By default it's "./config/", but we want to change it to point at the plugin directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//Let's also log it to the console to let us know it worked!
|
||||||
|
const ourConfig = configManager.get("example-plugin:config")
|
||||||
|
openticket.log("The example config loaded succesfully!","plugin",[
|
||||||
|
{key:"var-1",value:ourConfig.data.testVariable1},
|
||||||
|
{key:"var-2",value:ourConfig.data.testVariable2.toString()},
|
||||||
|
{key:"var-3",value:ourConfig.data.testVariable3.toString()}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
openticket.events.get("onTicketCreate").listen((creator) => {
|
||||||
|
//This is logged before the ticket is created (after the button is pressed)
|
||||||
|
openticket.log("Ticket is getting created...","plugin")
|
||||||
|
})
|
||||||
|
openticket.events.get("afterTicketCreated").listen((ticket,creator,channel) => {
|
||||||
|
//This is logged after the ticket is created
|
||||||
|
openticket.log("Ticket ready!","plugin")
|
||||||
|
})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name":"Example Plugin",
|
||||||
|
"id":"example-plugin",
|
||||||
|
"version":"1.0.0",
|
||||||
|
"startFile":"index.ts",
|
||||||
|
|
||||||
|
"enabled":false,
|
||||||
|
"priority":0,
|
||||||
|
"events":[],
|
||||||
|
|
||||||
|
"npmDependencies":["discord.js"],
|
||||||
|
"requiredPlugins":[],
|
||||||
|
"incompatiblePlugins":[],
|
||||||
|
|
||||||
|
"details":{
|
||||||
|
"author":"DJj123dj",
|
||||||
|
"shortDescription":"A simple template for an Open Ticket v4 plugin!",
|
||||||
|
"longDescription":"A simple example of an Open Ticket v4 plugin!",
|
||||||
|
"imageUrl":"",
|
||||||
|
"projectUrl":"",
|
||||||
|
"tags":["template","example","default"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const api = require("../core/api/api.js")
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
const {client,config,events,utils,actions} = api
|
|
||||||
|
|
||||||
//this code will run when the bot starts!
|
|
||||||
|
|
||||||
//in this example, we will say "hello" in the console when someone opens a ticket!
|
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
events.onTicketOpen((user,channel,guild,date,ticketdata) => {
|
|
||||||
console.log("hello, someone opened a ticket!")
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET ADD USER SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:add-ticket-user"))
|
||||||
|
openticket.actions.get("openticket:add-ticket-user").workers.add([
|
||||||
|
new api.ODWorker("openticket:add-ticket-user",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason,data} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to add user to ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketUserAdd").emit([ticket,user,data,channel,reason])
|
||||||
|
|
||||||
|
//update ticket
|
||||||
|
ticket.get("openticket:participants").value.push({type:"user",id:data.id})
|
||||||
|
ticket.get("openticket:participants").refreshDatabase()
|
||||||
|
ticket.get("openticket:busy").value = true
|
||||||
|
|
||||||
|
//update channel permissions
|
||||||
|
try{
|
||||||
|
await channel.permissionOverwrites.create(data,{
|
||||||
|
ViewChannel:true,
|
||||||
|
SendMessages:true,
|
||||||
|
AddReactions:true,
|
||||||
|
AttachFiles:true,
|
||||||
|
SendPolls:true,
|
||||||
|
ReadMessageHistory:true
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
openticket.log("Failed to add channel permission overwrites on add-ticket-user","error")
|
||||||
|
}
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket user adding!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"messageid",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value,hidden:true}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reply with new message
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:add-message").build(source,{guild,channel,user,ticket,reason,data})).message)
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
await openticket.events.get("afterTicketUserAdded").emit([ticket,user,data,channel,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason,data} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.adding.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"add",reason,additionalData:data}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.adding.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"add",reason,additionalData:data}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,data} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" added "+data.displayName+" to a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:add-ticket-user").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,276 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET CLAIMING SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:claim-ticket"))
|
||||||
|
openticket.actions.get("openticket:claim-ticket").workers.add([
|
||||||
|
new api.ODWorker("openticket:claim-ticket",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to claim ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketClaim").emit([ticket,user,channel,reason])
|
||||||
|
|
||||||
|
//update ticket
|
||||||
|
ticket.get("openticket:claimed").value = true
|
||||||
|
ticket.get("openticket:claimed-by").value = user.id
|
||||||
|
ticket.get("openticket:claimed-on").value = new Date().getTime()
|
||||||
|
ticket.get("openticket:busy").value = true
|
||||||
|
|
||||||
|
//update stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:tickets-claimed",1,"increase")
|
||||||
|
openticket.stats.get("openticket:user").setStat("openticket:tickets-claimed",user.id,1,"increase")
|
||||||
|
|
||||||
|
//update category
|
||||||
|
const rawClaimCategory = ticket.option.get("openticket:channel-categories-claimed").value.find((c) => c.user == user.id)
|
||||||
|
const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
|
||||||
|
if (claimCategory){
|
||||||
|
try {
|
||||||
|
channel.setParent(claimCategory,{lockPermissions:false})
|
||||||
|
ticket.get("openticket:category-mode").value = "claimed"
|
||||||
|
ticket.get("openticket:category").value = claimCategory
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to move ticket to 'claimed category'!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"categoryid",value:claimCategory}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket claiming!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"messageid",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reply with new message
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:claim-message").build(source,{guild,channel,user,ticket,reason})).message)
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
await openticket.events.get("afterTicketClaimed").emit([ticket,user,channel,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.claiming.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"claim",reason,additionalData:null}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.claiming.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"claim",reason,additionalData:null}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" claimed a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:claim-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const registerVerifyBars = async () => {
|
||||||
|
//CLAIM TICKET TICKET MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:claim-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:claim-ticket-ticket-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.claim
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:claim-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when already claimed
|
||||||
|
if (ticket.get("openticket:claimed").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.claim"),layout:"simple"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start claiming ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//claim with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:claim-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//claim without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
await openticket.actions.get("openticket:claim-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:claim-ticket-ticket-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//CLAIM TICKET UNCLAIM MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:claim-ticket-unclaim-message",openticket.builders.messages.getSafe("openticket:verifybar-unclaim-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:claim-ticket-unclaim-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.claim
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:claim-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when already claimed
|
||||||
|
if (ticket.get("openticket:claimed").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.claim"),layout:"simple"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start claiming ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//claim with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:claim-ticket-reason").build("unclaim-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//claim without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
await openticket.actions.get("openticket:claim-ticket").run("unclaim-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:claim-message").build("unclaim-message",{guild,channel,user,ticket,reason:null}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:claim-ticket-unclaim-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-unclaim-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const {verifybarMessage} = params
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
|
||||||
|
const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:unclaim-message").build("other",{guild,channel,user,ticket,reason}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//CLEAR TICKETS SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:clear-tickets"))
|
||||||
|
openticket.actions.get("openticket:clear-tickets").workers.add([
|
||||||
|
new api.ODWorker("openticket:clear-tickets",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,filter,list} = params
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketsClear").emit([list,user,channel,filter])
|
||||||
|
const nameList: string[] = []
|
||||||
|
for (const ticket of list){
|
||||||
|
const ticketChannel = await openticket.tickets.getTicketChannel(ticket)
|
||||||
|
if (!ticketChannel) return
|
||||||
|
nameList.push("#"+ticketChannel.name)
|
||||||
|
await openticket.actions.get("openticket:delete-ticket").run("clear",{guild,channel:ticketChannel,user,ticket,reason:"Cleared Ticket",sendMessage:true,withoutTranscript:false})
|
||||||
|
}
|
||||||
|
instance.list = nameList
|
||||||
|
await openticket.events.get("afterTicketsCleared").emit([list,user,channel,filter])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,filter,list} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.deleting.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:clear-logs").build(source,{guild,channel,user,filter,list:instance.list ?? []}))
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,user,filter,list} = params
|
||||||
|
openticket.log(user.displayName+" cleared "+list.length+" tickets!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"method",value:source},
|
||||||
|
{key:"filter",value:filter}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,328 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET CLOSING SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:close-ticket"))
|
||||||
|
openticket.actions.get("openticket:close-ticket").workers.add([
|
||||||
|
new api.ODWorker("openticket:close-ticket",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to close ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketClose").emit([ticket,user,channel,reason])
|
||||||
|
|
||||||
|
//update ticket
|
||||||
|
ticket.get("openticket:closed").value = true
|
||||||
|
if (source == "autoclose") ticket.get("openticket:autoclosed").value = true
|
||||||
|
ticket.get("openticket:open").value = false
|
||||||
|
ticket.get("openticket:closed-by").value = user.id
|
||||||
|
ticket.get("openticket:closed-on").value = new Date().getTime()
|
||||||
|
ticket.get("openticket:busy").value = true
|
||||||
|
|
||||||
|
//update stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:tickets-closed",1,"increase")
|
||||||
|
openticket.stats.get("openticket:user").setStat("openticket:tickets-closed",user.id,1,"increase")
|
||||||
|
|
||||||
|
//update category
|
||||||
|
const closeCategory = ticket.option.get("openticket:channel-category-closed").value
|
||||||
|
if (closeCategory !== ""){
|
||||||
|
try {
|
||||||
|
channel.setParent(closeCategory,{lockPermissions:false})
|
||||||
|
ticket.get("openticket:category-mode").value = "closed"
|
||||||
|
ticket.get("openticket:category").value = closeCategory
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to move ticket to 'closed category'!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"categoryid",value:closeCategory}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update permissions (non-staff => readonly)
|
||||||
|
const permissions: discord.OverwriteResolvable[] = [{
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:guild.roles.everyone.id,
|
||||||
|
allow:[],
|
||||||
|
deny:["ViewChannel","SendMessages","ReadMessageHistory"]
|
||||||
|
}]
|
||||||
|
const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
|
||||||
|
const optionAdmins = ticket.option.get("openticket:admins").value
|
||||||
|
const readonlyAdmins = ticket.option.get("openticket:admins-readonly").value
|
||||||
|
|
||||||
|
globalAdmins.forEach((admin) => {
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
optionAdmins.forEach((admin) => {
|
||||||
|
if (globalAdmins.includes(admin)) return
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
readonlyAdmins.forEach((admin) => {
|
||||||
|
if (globalAdmins.includes(admin)) return
|
||||||
|
if (optionAdmins.includes(admin)) return
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","ReadMessageHistory"],
|
||||||
|
deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
ticket.get("openticket:participants").value.forEach((participant) => {
|
||||||
|
//all participants that aren't roles/admins => readonly
|
||||||
|
if (participant.type == "user"){
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Member,
|
||||||
|
id:user.id,
|
||||||
|
allow:["ViewChannel","ReadMessageHistory"],
|
||||||
|
deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
channel.permissionOverwrites.set(permissions)
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket closing!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"messageid",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reply with new message
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:close-message").build(source,{guild,channel,user,ticket,reason})).message)
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
await openticket.events.get("afterTicketClosed").emit([ticket,user,channel,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.closing.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"close",reason,additionalData:null}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.closing.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"close",reason,additionalData:null}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" closed a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:close-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const registerVerifyBars = async () => {
|
||||||
|
//CLOSE TICKET TICKET MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:close-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:close-ticket-ticket-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.close
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:close-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when already closed
|
||||||
|
if (ticket.get("openticket:closed").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start closing ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//close with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:close-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//close without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
await openticket.actions.get("openticket:close-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:close-ticket-ticket-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//CLOSE TICKET REOPEN MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:close-ticket-reopen-message",openticket.builders.messages.getSafe("openticket:verifybar-reopen-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:close-ticket-reopen-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.close
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:close-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when already closed
|
||||||
|
if (ticket.get("openticket:closed").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start closing ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//close with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:close-ticket-reason").build("reopen-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//close without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
await openticket.actions.get("openticket:close-ticket").run("reopen-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:close-message").build("reopen-message",{guild,channel,user,ticket,reason:null}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:close-ticket-reopen-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-reopen-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const {verifybarMessage} = params
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
|
||||||
|
const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,229 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET CREATION SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:create-ticket"))
|
||||||
|
openticket.actions.get("openticket:create-ticket").workers.add([
|
||||||
|
new api.ODWorker("openticket:create-ticket",3,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,user,answers,option} = params
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketCreate").emit([user])
|
||||||
|
await openticket.events.get("onTicketChannelCreation").emit([option,user])
|
||||||
|
|
||||||
|
//get channel properties
|
||||||
|
const channelPrefix = option.get("openticket:channel-prefix").value
|
||||||
|
const channelCategory = option.get("openticket:channel-category").value
|
||||||
|
const channelBackupCategory = option.get("openticket:channel-category-backup").value
|
||||||
|
const channelDescription = option.get("openticket:channel-description").value
|
||||||
|
const channelSuffix = openticket.options.suffix.getSuffixFromOption(option,user)
|
||||||
|
const channelName = channelPrefix+channelSuffix
|
||||||
|
|
||||||
|
//handle category
|
||||||
|
let category: string|null = null
|
||||||
|
let categoryMode: "backup"|"normal"|null = null
|
||||||
|
if (channelCategory != ""){
|
||||||
|
//category enabled
|
||||||
|
const normalCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelCategory)
|
||||||
|
if (!normalCategory){
|
||||||
|
//default category was not found
|
||||||
|
openticket.log("Ticket Creation Error: Unable to find category! #1","error",[
|
||||||
|
{key:"categoryid",value:channelCategory},
|
||||||
|
{key:"backup",value:"false"}
|
||||||
|
])
|
||||||
|
}else{
|
||||||
|
//default category was found
|
||||||
|
if (normalCategory.children.cache.size >= 50 && channelBackupCategory != ""){
|
||||||
|
//use backup category
|
||||||
|
const backupCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelBackupCategory)
|
||||||
|
if (!backupCategory){
|
||||||
|
//default category was not found
|
||||||
|
openticket.log("Ticket Creation Error: Unable to find category! #2","error",[
|
||||||
|
{key:"categoryid",value:channelBackupCategory},
|
||||||
|
{key:"backup",value:"true"}
|
||||||
|
])
|
||||||
|
}else{
|
||||||
|
category = backupCategory.id
|
||||||
|
categoryMode = "backup"
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//use default category
|
||||||
|
category = normalCategory.id
|
||||||
|
categoryMode = "normal"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//handle permissions
|
||||||
|
const permissions: discord.OverwriteResolvable[] = [{
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:guild.roles.everyone.id,
|
||||||
|
allow:[],
|
||||||
|
deny:["ViewChannel","SendMessages","ReadMessageHistory"]
|
||||||
|
}]
|
||||||
|
const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
|
||||||
|
const optionAdmins = option.get("openticket:admins").value
|
||||||
|
const readonlyAdmins = option.get("openticket:admins-readonly").value
|
||||||
|
|
||||||
|
globalAdmins.forEach((admin) => {
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
optionAdmins.forEach((admin) => {
|
||||||
|
if (globalAdmins.includes(admin)) return
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
readonlyAdmins.forEach((admin) => {
|
||||||
|
if (globalAdmins.includes(admin)) return
|
||||||
|
if (optionAdmins.includes(admin)) return
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","ReadMessageHistory"],
|
||||||
|
deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Member,
|
||||||
|
id:user.id,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
|
||||||
|
//create channel
|
||||||
|
const channel = await guild.channels.create({
|
||||||
|
type:discord.ChannelType.GuildText,
|
||||||
|
name:channelName,
|
||||||
|
nsfw:false,
|
||||||
|
topic:channelDescription,
|
||||||
|
parent:category,
|
||||||
|
reason:"Ticket Created By "+user.displayName,
|
||||||
|
permissionOverwrites:permissions
|
||||||
|
})
|
||||||
|
|
||||||
|
await openticket.events.get("afterTicketChannelCreated").emit([option,channel,user])
|
||||||
|
|
||||||
|
//create participants
|
||||||
|
const participants: {type:"role"|"user",id:string}[] = []
|
||||||
|
permissions.forEach((permission,index) => {
|
||||||
|
if (index == 0) return //don't include @everyone
|
||||||
|
const type = (permission.type == discord.OverwriteType.Role) ? "role" : "user"
|
||||||
|
const id = permission.id as string
|
||||||
|
participants.push({type,id})
|
||||||
|
})
|
||||||
|
|
||||||
|
//create ticket
|
||||||
|
const ticket = new api.ODTicket(channel.id,option,[
|
||||||
|
new api.ODTicketData("openticket:busy",false),
|
||||||
|
new api.ODTicketData("openticket:ticket-message",null),
|
||||||
|
new api.ODTicketData("openticket:participants",participants),
|
||||||
|
new api.ODTicketData("openticket:channel-suffix",channelSuffix),
|
||||||
|
|
||||||
|
new api.ODTicketData("openticket:open",true),
|
||||||
|
new api.ODTicketData("openticket:opened-by",user.id),
|
||||||
|
new api.ODTicketData("openticket:opened-on",new Date().getTime()),
|
||||||
|
new api.ODTicketData("openticket:closed",false),
|
||||||
|
new api.ODTicketData("openticket:closed-by",null),
|
||||||
|
new api.ODTicketData("openticket:closed-on",null),
|
||||||
|
new api.ODTicketData("openticket:claimed",false),
|
||||||
|
new api.ODTicketData("openticket:claimed-by",null),
|
||||||
|
new api.ODTicketData("openticket:claimed-on",null),
|
||||||
|
new api.ODTicketData("openticket:pinned",false),
|
||||||
|
new api.ODTicketData("openticket:pinned-by",null),
|
||||||
|
new api.ODTicketData("openticket:pinned-on",null),
|
||||||
|
new api.ODTicketData("openticket:for-deletion",false),
|
||||||
|
|
||||||
|
new api.ODTicketData("openticket:category",category),
|
||||||
|
new api.ODTicketData("openticket:category-mode",categoryMode),
|
||||||
|
|
||||||
|
new api.ODTicketData("openticket:autoclose-enabled",option.get("openticket:autoclose-enable-hours").value),
|
||||||
|
new api.ODTicketData("openticket:autoclose-hours",(option.get("openticket:autoclose-enable-hours").value ? option.get("openticket:autoclose-hours").value : 0)),
|
||||||
|
new api.ODTicketData("openticket:autoclosed",false),
|
||||||
|
new api.ODTicketData("openticket:autodelete-enabled",option.get("openticket:autodelete-enable-days").value),
|
||||||
|
new api.ODTicketData("openticket:autodelete-days",(option.get("openticket:autodelete-enable-days").value ? option.get("openticket:autodelete-days").value : 0)),
|
||||||
|
|
||||||
|
new api.ODTicketData("openticket:answers",answers)
|
||||||
|
])
|
||||||
|
|
||||||
|
//manage stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:tickets-created",1,"increase")
|
||||||
|
openticket.stats.get("openticket:user").setStat("openticket:tickets-created",user.id,1,"increase")
|
||||||
|
|
||||||
|
//manage bot permissions
|
||||||
|
await openticket.events.get("onTicketPermissionsCreated").emit([option,openticket.permissions,channel,user])
|
||||||
|
await (await import("../data/framework/permissionLoader.ts")).addTicketPermissions(ticket)
|
||||||
|
await openticket.events.get("afterTicketPermissionsCreated").emit([option,openticket.permissions,channel,user])
|
||||||
|
|
||||||
|
//export channel & ticket
|
||||||
|
instance.channel = channel
|
||||||
|
instance.ticket = ticket
|
||||||
|
openticket.tickets.add(ticket)
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:send-ticket-message",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,user,answers,option} = params
|
||||||
|
const {ticket,channel} = instance
|
||||||
|
|
||||||
|
if (!ticket || !channel) return openticket.log("Ticket Creation Error: Unable to send ticket message. Previous worker failed!","error")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketMainMessageCreated").emit([ticket,channel,user])
|
||||||
|
//check if ticket message is enabled
|
||||||
|
if (!option.get("openticket:ticket-message-enabled").value) return
|
||||||
|
try {
|
||||||
|
const msg = await channel.send((await openticket.builders.messages.getSafe("openticket:ticket-message").build(source,{guild,channel,user,ticket})).message)
|
||||||
|
|
||||||
|
ticket.get("openticket:ticket-message").value = msg.id
|
||||||
|
|
||||||
|
//manage stats
|
||||||
|
openticket.stats.get("openticket:ticket").setStat("openticket:messages-sent",ticket.id.value,1,"increase")
|
||||||
|
|
||||||
|
await openticket.events.get("afterTicketMainMessageCreated").emit([ticket,msg,channel,user])
|
||||||
|
}catch(err){
|
||||||
|
process.emit("uncaughtException",err)
|
||||||
|
//something went wrong while sending the ticket message
|
||||||
|
channel.send((await openticket.builders.messages.getSafe("openticket:error").build("other",{guild,channel,user,error:"Ticket Message: Creation Error!\n=> Ticket Is Still Created Succesfully",layout:"advanced"})).message)
|
||||||
|
}
|
||||||
|
await openticket.events.get("afterTicketCreated").emit([ticket,user,channel])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,user,answers,option} = params
|
||||||
|
const {ticket,channel} = instance
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.creation.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-created-logs").build(source,{guild,channel,user,ticket}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.creation.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-created-dm").build(source,{guild,channel,user,ticket}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,user,answers,option} = params
|
||||||
|
const {ticket,channel} = instance
|
||||||
|
|
||||||
|
if (!ticket || !channel) return openticket.log("Ticket Creation Error: Unable to create logs. Previous worker failed!","error")
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" created a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"method",value:source},
|
||||||
|
{key:"option",value:option.id.value}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET CREATION SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:create-ticket-permissions"))
|
||||||
|
openticket.actions.get("openticket:create-ticket-permissions").workers.add([
|
||||||
|
new api.ODWorker("openticket:check-blacklist",4,(instance,params,source,cancel) => {
|
||||||
|
if (!params.option.get("openticket:allow-blacklisted-users").value && openticket.blacklist.exists(params.user.id)){
|
||||||
|
instance.valid = false
|
||||||
|
instance.reason = "blacklist"
|
||||||
|
openticket.log(params.user.displayName+" tried to create a ticket but is blacklisted!","info",[
|
||||||
|
{key:"user",value:params.user.username},
|
||||||
|
{key:"userid",value:params.user.id,hidden:true},
|
||||||
|
{key:"option",value:params.option.id.value}
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:check-cooldown",3,(instance,params,source,cancel) => {
|
||||||
|
const cooldown = openticket.cooldowns.get("openticket:option-cooldown_"+params.option.id.value)
|
||||||
|
if (cooldown && cooldown instanceof api.ODTimeoutCooldown && cooldown.use(params.user.id)){
|
||||||
|
instance.valid = false
|
||||||
|
instance.reason = "cooldown"
|
||||||
|
const remaining = cooldown.remaining(params.user.id) ?? 0
|
||||||
|
instance.cooldownUntil = new Date(new Date().getTime() + remaining)
|
||||||
|
|
||||||
|
openticket.log(params.user.displayName+" tried to create a ticket but is on cooldown!","info",[
|
||||||
|
{key:"user",value:params.user.username},
|
||||||
|
{key:"userid",value:params.user.id,hidden:true},
|
||||||
|
{key:"option",value:params.option.id.value},
|
||||||
|
{key:"remaining",value:(remaining/1000).toString()+"sec"}
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:check-global-limits",2,(instance,params,source,cancel) => {
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
if (!generalConfig.data.system.limits.enabled) return
|
||||||
|
|
||||||
|
const allTickets = openticket.tickets.getAll()
|
||||||
|
const globalTicketCount = allTickets.length
|
||||||
|
const userTickets = openticket.tickets.getFiltered((ticket) => ticket.exists("openticket:opened-by") && (ticket.get("openticket:opened-by").value == params.user.id))
|
||||||
|
const userTicketCount = userTickets.length
|
||||||
|
|
||||||
|
if (globalTicketCount >= generalConfig.data.system.limits.globalMaximum){
|
||||||
|
instance.valid = false
|
||||||
|
instance.reason = "global-limit"
|
||||||
|
openticket.log(params.user.displayName+" tried to create a ticket but reached the limit!","info",[
|
||||||
|
{key:"user",value:params.user.username},
|
||||||
|
{key:"userid",value:params.user.id,hidden:true},
|
||||||
|
{key:"option",value:params.option.id.value},
|
||||||
|
{key:"limit",value:"global"}
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}else if (userTicketCount >= generalConfig.data.system.limits.userMaximum){
|
||||||
|
instance.valid = false
|
||||||
|
instance.reason = "global-user-limit"
|
||||||
|
openticket.log(params.user.displayName+" tried to create a ticket, but reached the limit!","info",[
|
||||||
|
{key:"user",value:params.user.username},
|
||||||
|
{key:"userid",value:params.user.id,hidden:true},
|
||||||
|
{key:"option",value:params.option.id.value},
|
||||||
|
{key:"limit",value:"global-user"}
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:check-option-limits",1,(instance,params,source,cancel) => {
|
||||||
|
if (!params.option.exists("openticket:limits-enabled") || !params.option.get("openticket:limits-enabled").value) return
|
||||||
|
|
||||||
|
const allTickets = openticket.tickets.getFiltered((ticket) => ticket.option.id.value == params.option.id.value)
|
||||||
|
const globalTicketCount = allTickets.length
|
||||||
|
const userTickets = openticket.tickets.getFiltered((ticket) => ticket.option.id.value == params.option.id.value && ticket.exists("openticket:opened-by") && (ticket.get("openticket:opened-by").value == params.user.id))
|
||||||
|
const userTicketCount = userTickets.length
|
||||||
|
|
||||||
|
if (globalTicketCount >= params.option.get("openticket:limits-maximum-global").value){
|
||||||
|
instance.valid = false
|
||||||
|
instance.reason = "option-limit"
|
||||||
|
openticket.log(params.user.displayName+" tried to create a ticket, but reached the limit!","info",[
|
||||||
|
{key:"user",value:params.user.username},
|
||||||
|
{key:"userid",value:params.user.id,hidden:true},
|
||||||
|
{key:"option",value:params.option.id.value},
|
||||||
|
{key:"limit",value:"option"}
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}else if (userTicketCount >= params.option.get("openticket:limits-maximum-user").value){
|
||||||
|
instance.valid = false
|
||||||
|
instance.reason = "option-user-limit"
|
||||||
|
openticket.log(params.user.displayName+" tried to create a ticket, but reached the limit!","info",[
|
||||||
|
{key:"user",value:params.user.username},
|
||||||
|
{key:"userid",value:params.user.id,hidden:true},
|
||||||
|
{key:"option",value:params.option.id.value},
|
||||||
|
{key:"limit",value:"option-user"}
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:valid",0,(instance,params,source,cancel) => {
|
||||||
|
instance.valid = true
|
||||||
|
instance.reason = null
|
||||||
|
cancel()
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TRANSCRIPT CREATION SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const transcriptConfig = openticket.configs.get("openticket:transcripts")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:create-transcript"))
|
||||||
|
openticket.actions.get("openticket:create-transcript").workers.add([
|
||||||
|
new api.ODWorker("openticket:select-compiler",4,async (instance,params,source,cancel) => {
|
||||||
|
const {channel,user,ticket} = params
|
||||||
|
if (channel.type != discord.ChannelType.GuildText) return cancel()
|
||||||
|
if (!transcriptConfig.data.general.enabled) return cancel()
|
||||||
|
|
||||||
|
await openticket.events.get("onTranscriptCreate").emit([openticket.transcripts,ticket,channel,user])
|
||||||
|
|
||||||
|
instance.errorReason = null
|
||||||
|
const participants = await openticket.tickets.getAllTicketParticipants(params.ticket)
|
||||||
|
if (!participants){
|
||||||
|
instance.pendingMessage = null
|
||||||
|
instance.errorReason = "Unable to fetch ticket channel participants!"
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript) => Unable to fetch ticket channel participants!")
|
||||||
|
}
|
||||||
|
instance.participants = participants
|
||||||
|
|
||||||
|
//select transcript compiler
|
||||||
|
if (transcriptConfig.data.general.mode == "text") instance.compiler = openticket.transcripts.get("openticket:text-compiler")
|
||||||
|
else if (transcriptConfig.data.general.mode == "html") instance.compiler = openticket.transcripts.get("openticket:html-compiler")
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:init-transcript",3,async (instance,params,source,cancel) => {
|
||||||
|
const {channel,user,ticket} = params
|
||||||
|
if (channel.type != discord.ChannelType.GuildText) return cancel()
|
||||||
|
if (!transcriptConfig.data.general.enabled) return cancel()
|
||||||
|
|
||||||
|
//run transcript compiler init()
|
||||||
|
await openticket.events.get("onTranscriptInit").emit([openticket.transcripts,ticket,channel,user])
|
||||||
|
if (instance.compiler.init){
|
||||||
|
try{
|
||||||
|
const result = await instance.compiler.init(ticket,channel,user)
|
||||||
|
if (result.success && result.pendingMessage && transcriptConfig.data.general.enableChannel){
|
||||||
|
//send init message to channel
|
||||||
|
const post = openticket.posts.get("openticket:transcripts")
|
||||||
|
if (post){
|
||||||
|
instance.pendingMessage = await post.send(result.pendingMessage)
|
||||||
|
}
|
||||||
|
}else if (!result.success){
|
||||||
|
instance.pendingMessage = null
|
||||||
|
instance.errorReason = result.errorReason
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript) => Known Init Error => "+result.errorReason)
|
||||||
|
}else instance.pendingMessage = null
|
||||||
|
}catch(err){
|
||||||
|
instance.success = false
|
||||||
|
cancel()
|
||||||
|
process.emit("uncaughtException",err)
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript) => Failed transcript compiler init()! (see error above)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await openticket.events.get("afterTranscriptInitiated").emit([openticket.transcripts,ticket,channel,user])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:compile-transcript",2,async (instance,params,source,cancel) => {
|
||||||
|
const {channel,user,ticket} = params
|
||||||
|
if (channel.type != discord.ChannelType.GuildText) return cancel()
|
||||||
|
if (!instance.compiler){
|
||||||
|
instance.success = false
|
||||||
|
cancel()
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript):ODWorker(ot:compile-transcript) => Instance is missing transcript compiler!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//run transcript compiler compile()
|
||||||
|
await openticket.events.get("onTranscriptCompile").emit([openticket.transcripts,ticket,channel,user])
|
||||||
|
if (instance.compiler.compile){
|
||||||
|
try{
|
||||||
|
const result = await instance.compiler.compile(ticket,channel,user)
|
||||||
|
if (!result.success){
|
||||||
|
instance.errorReason = result.errorReason
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript) => Known Compiler Error => "+result.errorReason)
|
||||||
|
}else{
|
||||||
|
instance.result = result
|
||||||
|
instance.success = true
|
||||||
|
}
|
||||||
|
}catch(err){
|
||||||
|
instance.success = false
|
||||||
|
cancel()
|
||||||
|
process.emit("uncaughtException",err)
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript) => Failed transcript compiler compile()! (see error above)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await openticket.events.get("afterTranscriptCompiled").emit([openticket.transcripts,ticket,channel,user])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:ready-transcript",1,async (instance,params,source,cancel) => {
|
||||||
|
if (!instance.result){
|
||||||
|
instance.success = false
|
||||||
|
cancel()
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript):ODWorker(ot:ready-transcript) => Instance is missing transcript result!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//run transcript compiler ready()
|
||||||
|
utilities.runAsync(async () => {
|
||||||
|
await openticket.events.get("onTranscriptReady").emit([openticket.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
|
||||||
|
if (instance.compiler.ready){
|
||||||
|
try{
|
||||||
|
const {channelMessage,creatorDmMessage,participantDmMessage,activeAdminDmMessage,everyAdminDmMessage} = await instance.compiler.ready(instance.result)
|
||||||
|
|
||||||
|
//send channel message
|
||||||
|
if (transcriptConfig.data.general.enableChannel && channelMessage){
|
||||||
|
if (instance.pendingMessage && instance.pendingMessage.message && instance.pendingMessage.success){
|
||||||
|
//edit "pending" message to be the "ready" message
|
||||||
|
instance.pendingMessage.message.edit(channelMessage.message)
|
||||||
|
}else{
|
||||||
|
//send ready message to channel
|
||||||
|
const post = openticket.posts.get("openticket:transcripts")
|
||||||
|
if (post) await post.send(channelMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//send dm mesages
|
||||||
|
if (instance.participants){
|
||||||
|
for (const p of instance.participants){
|
||||||
|
if (p.role == "creator" && transcriptConfig.data.general.enableCreatorDM && creatorDmMessage){
|
||||||
|
//send creator dm message
|
||||||
|
await openticket.client.sendUserDm(p.user,creatorDmMessage)
|
||||||
|
}else if (p.role == "participant" && transcriptConfig.data.general.enableParticipantDM && participantDmMessage){
|
||||||
|
//send participant dm message
|
||||||
|
await openticket.client.sendUserDm(p.user,participantDmMessage)
|
||||||
|
}else if (p.role == "admin" && transcriptConfig.data.general.enableActiveAdminDM && instance.result.success && instance.result.messages && instance.result.messages.some((msg) => msg.author.id == p.user.id) && activeAdminDmMessage){
|
||||||
|
//send active admin dm message
|
||||||
|
await openticket.client.sendUserDm(p.user,activeAdminDmMessage)
|
||||||
|
}else if (p.role == "admin" && transcriptConfig.data.general.enableEveryAdminDM && everyAdminDmMessage){
|
||||||
|
//send every admin dm message
|
||||||
|
await openticket.client.sendUserDm(p.user,everyAdminDmMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(err){
|
||||||
|
instance.success = false
|
||||||
|
cancel()
|
||||||
|
process.emit("uncaughtException",err)
|
||||||
|
throw new api.ODSystemError("ODAction(ot:create-transcript) => Failed transcript compiler ready()! (see error above)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await openticket.events.get("afterTranscriptReady").emit([openticket.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
|
||||||
|
})
|
||||||
|
|
||||||
|
//update stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:transcripts-created",1,"increase")
|
||||||
|
await openticket.events.get("afterTranscriptCreated").emit([openticket.transcripts,instance.result.ticket,instance.result.channel,instance.result.user])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {user,channel,ticket} = params
|
||||||
|
openticket.log(user.displayName+" created a transcript!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"option",value:ticket.option.id.value},
|
||||||
|
{key:"method",value:source,hidden:true},
|
||||||
|
{key:"compiler",value:instance.compiler.id.value},
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,463 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET DELETION SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:delete-ticket"))
|
||||||
|
openticket.actions.get("openticket:delete-ticket").workers.add([
|
||||||
|
new api.ODWorker("openticket:delete-ticket",3,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to delete ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketDelete").emit([ticket,user,channel,reason])
|
||||||
|
|
||||||
|
//update ticket
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
ticket.get("openticket:busy").value = true
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket deletion!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"messageid",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:delete-message").build(source,{guild,channel,user,ticket,reason})).message)
|
||||||
|
|
||||||
|
//create transcript
|
||||||
|
if (!params.withoutTranscript){
|
||||||
|
const transcriptRes = await openticket.actions.get("openticket:create-transcript").run(source,{guild,channel,user,ticket})
|
||||||
|
if (typeof transcriptRes.success == "boolean" && !transcriptRes.success && transcriptRes.compiler){
|
||||||
|
const {compiler} = transcriptRes
|
||||||
|
await channel.send((await openticket.builders.messages.getSafe("openticket:transcript-error").build(source,{guild,channel,user,ticket,compiler,reason:transcriptRes.errorReason ?? null})).message)
|
||||||
|
|
||||||
|
//undo deletion
|
||||||
|
ticket.get("openticket:for-deletion").value = false
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
openticket.log("Canceled ticket deletion because of transcript system malfunction!","warning",[
|
||||||
|
{key:"compiler",value:compiler.id.value},
|
||||||
|
{key:"reason",value:transcriptRes.errorReason ?? "/"},
|
||||||
|
])
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:tickets-deleted",1,"increase")
|
||||||
|
openticket.stats.get("openticket:user").setStat("openticket:tickets-deleted",user.id,1,"increase")
|
||||||
|
|
||||||
|
//delete ticket from manager
|
||||||
|
openticket.tickets.remove(ticket.id)
|
||||||
|
|
||||||
|
//delete permissions from manager
|
||||||
|
await (await import("../data/framework/permissionLoader.ts")).removeTicketPermissions(ticket)
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",2,async (instance,params,source,cancel) => {
|
||||||
|
//logs before channel deletion => channel might still be used in log embeds
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.deleting.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"delete",reason,additionalData:null}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.deleting.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"delete",reason,additionalData:null}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-channel",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
//delete channel & events
|
||||||
|
await openticket.events.get("onTicketChannelDeletion").emit([ticket,channel,user])
|
||||||
|
await channel.delete("Ticket Deleted")
|
||||||
|
await openticket.events.get("afterTicketChannelDeleted").emit([ticket,user])
|
||||||
|
|
||||||
|
//delete permissions from manager
|
||||||
|
await (await import("../data/framework/permissionLoader.ts")).removeTicketPermissions(ticket)
|
||||||
|
|
||||||
|
await openticket.events.get("afterTicketDeleted").emit([ticket,user,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" deleted a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source},
|
||||||
|
{key:"transcript",value:(!params.withoutTranscript).toString()},
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:delete-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
params.ticket.get("openticket:for-deletion").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const registerVerifyBars = async () => {
|
||||||
|
//DELETE TICKET TICKET MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-ticket-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.delete
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start deleting ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//delete with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//delete without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
//don't await DELETE action => else it will update the message after the channel has been deleted
|
||||||
|
openticket.actions.get("openticket:delete-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true,withoutTranscript:(params.data == "no-transcript")})
|
||||||
|
//update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-ticket-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//DELETE TICKET CLOSE MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-close-message",openticket.builders.messages.getSafe("openticket:verifybar-close-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-close-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.delete
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start deleting ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//delete with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("close-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//delete without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
//don't await DELETE action => else it will update the message after the channel has been deleted
|
||||||
|
openticket.actions.get("openticket:delete-ticket").run("close-message",{guild,channel,user,ticket,reason:null,sendMessage:false,withoutTranscript:(params.data == "no-transcript")})
|
||||||
|
//update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("close-message",{guild,channel,user,ticket,reason:null}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-close-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-close-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const {verifybarMessage} = params
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
|
||||||
|
const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:close-message").build("other",{guild,channel,user,ticket,reason}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//DELETE TICKET REOPEN MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-reopen-message",openticket.builders.messages.getSafe("openticket:verifybar-reopen-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-reopen-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.delete
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start deleting ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//delete with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("reopen-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//delete without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
//don't await DELETE action => else it will update the message after the channel has been deleted
|
||||||
|
openticket.actions.get("openticket:delete-ticket").run("reopen-message",{guild,channel,user,ticket,reason:null,sendMessage:false,withoutTranscript:(params.data == "no-transcript")})
|
||||||
|
//update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("reopen-message",{guild,channel,user,ticket,reason:null}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-reopen-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-reopen-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const {verifybarMessage} = params
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
|
||||||
|
const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:reopen-message").build("other",{guild,channel,user,ticket,reason}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//DELETE TICKET AUTOCLOSE MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:delete-ticket-autoclose-message",openticket.builders.messages.getSafe("openticket:verifybar-autoclose-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-autoclose-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.delete
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start deleting ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//delete with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:delete-ticket-reason").build("autoclose-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//delete without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
//don't await DELETE action => else it will update the message after the channel has been deleted
|
||||||
|
openticket.actions.get("openticket:delete-ticket").run("autoclose-message",{guild,channel,user,ticket,reason:null,sendMessage:false,withoutTranscript:(params.data == "no-transcript")})
|
||||||
|
//update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("autoclose-message",{guild,channel,user,ticket,reason:null}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:delete-ticket-autoclose-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-autoclose-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const {verifybarMessage} = params
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:autoclose-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TRANSCRIPT ERROR SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerButtonResponders = async () => {
|
||||||
|
//TRANSCRIPT ERROR RETRY
|
||||||
|
openticket.responders.buttons.add(new api.ODButtonResponder("openticket:transcript-error-retry",/^od:transcript-error-retry_([^_]+)/))
|
||||||
|
openticket.responders.buttons.get("openticket:transcript-error-retry").workers.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.delete
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const originalSource = instance.interaction.customId.split("_")[1]
|
||||||
|
if (originalSource != "slash" && originalSource != "text" && originalSource != "ticket-message" && originalSource != "reopen-message" && originalSource != "close-message" && originalSource != "other") return
|
||||||
|
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start deleting ticket (without reason)
|
||||||
|
await instance.defer("update",false)
|
||||||
|
//don't await DELETE action => else it will update the message after the channel has been deleted
|
||||||
|
openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason:"Transcript Error (Retried)",sendMessage:false,withoutTranscript:false})
|
||||||
|
//update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason:"Transcript Error (Retried)"}))
|
||||||
|
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",-1,async (instance,params,source,cancel) => {
|
||||||
|
const {user,channel} = instance
|
||||||
|
if (channel.isDMBased()) return
|
||||||
|
openticket.log(user.displayName+" retried deleting a ticket with transcript!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//TRANSCRIPT ERROR CONTINUE
|
||||||
|
openticket.responders.buttons.add(new api.ODButtonResponder("openticket:transcript-error-continue",/^od:transcript-error-continue_([^_]+)/))
|
||||||
|
openticket.responders.buttons.get("openticket:transcript-error-continue").workers.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.delete
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:delete-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const originalSource = instance.interaction.customId.split("_")[1]
|
||||||
|
if (originalSource != "slash" && originalSource != "text" && originalSource != "ticket-message" && originalSource != "reopen-message" && originalSource != "close-message" && originalSource != "other") return
|
||||||
|
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start deleting ticket (without reason)
|
||||||
|
await instance.defer("update",false)
|
||||||
|
//don't await DELETE action => else it will update the message after the channel has been deleted
|
||||||
|
openticket.actions.get("openticket:delete-ticket").run(originalSource,{guild,channel,user,ticket,reason:"Transcript Error (Continued)",sendMessage:false,withoutTranscript:true})
|
||||||
|
//update ticket (for ticket message) => no-await doesn't wait for the action to set this variable
|
||||||
|
ticket.get("openticket:for-deletion").value = true
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:delete-message").build("other",{guild,channel,user,ticket,reason:"Transcript Error (Continued)"}))
|
||||||
|
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",-1,async (instance,params,source,cancel) => {
|
||||||
|
const {user,channel} = instance
|
||||||
|
if (channel.isDMBased()) return
|
||||||
|
openticket.log(user.displayName+" continued deleting a ticket without transcript!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//VERIFYBAR SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
|
||||||
|
export const registerButtonResponders = async () => {
|
||||||
|
//VERIFYBAR SUCCESS
|
||||||
|
openticket.responders.buttons.add(new api.ODButtonResponder("openticket:verifybar-success",/^od:verifybar-success_([^_]+)/))
|
||||||
|
openticket.responders.buttons.get("openticket:verifybar-success").workers.add(
|
||||||
|
new api.ODWorker("openticket:handle-verifybar",0,async (instance,params,source,cancel) => {
|
||||||
|
const id = instance.interaction.customId.split("_")[1]
|
||||||
|
const customData = instance.interaction.customId.split("_")[2] as string|undefined
|
||||||
|
|
||||||
|
const verifybar = openticket.verifybars.get(id)
|
||||||
|
if (!verifybar) return
|
||||||
|
if (verifybar.success) await verifybar.success.executeWorkers(instance,"verifybar",{data:customData ?? null,verifybarMessage:instance.message})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
//VERIFYBAR FAILURE
|
||||||
|
openticket.responders.buttons.add(new api.ODButtonResponder("openticket:verifybar-failure",/^od:verifybar-failure_([^_]+)/))
|
||||||
|
openticket.responders.buttons.get("openticket:verifybar-failure").workers.add(
|
||||||
|
new api.ODWorker("openticket:handle-verifybar",0,async (instance,params,source,cancel) => {
|
||||||
|
const id = instance.interaction.customId.split("_")[1]
|
||||||
|
const customData = instance.interaction.customId.split("_")[2] as string|undefined
|
||||||
|
|
||||||
|
const verifybar = openticket.verifybars.get(id)
|
||||||
|
if (!verifybar) return
|
||||||
|
if (verifybar.failure) await verifybar.failure.executeWorkers(instance,"verifybar",{data:customData ?? null,verifybarMessage:instance.message})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET MOVING SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:move-ticket"))
|
||||||
|
openticket.actions.get("openticket:move-ticket").workers.add([
|
||||||
|
new api.ODWorker("openticket:move-ticket",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason,data} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to move ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketMove").emit([ticket,user,channel,reason])
|
||||||
|
ticket.option = data
|
||||||
|
|
||||||
|
//update stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:tickets-moved",1,"increase")
|
||||||
|
openticket.stats.get("openticket:user").setStat("openticket:tickets-moved",user.id,1,"increase")
|
||||||
|
|
||||||
|
//get new channel properties
|
||||||
|
const channelPrefix = ticket.option.get("openticket:channel-prefix").value
|
||||||
|
const channelSuffix = ticket.get("openticket:channel-suffix").value
|
||||||
|
const channelCategory = ticket.option.get("openticket:channel-category").value
|
||||||
|
const channelBackupCategory = ticket.option.get("openticket:channel-category-backup").value
|
||||||
|
const rawClaimCategory = ticket.option.get("openticket:channel-categories-claimed").value.find((c) => c.user == user.id)
|
||||||
|
const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
|
||||||
|
const closeCategory = ticket.option.get("openticket:channel-category-closed").value
|
||||||
|
const channelDescription = ticket.option.get("openticket:channel-description").value
|
||||||
|
const channelName = channelPrefix+channelSuffix
|
||||||
|
|
||||||
|
//handle category
|
||||||
|
let category: string|null = null
|
||||||
|
let categoryMode: "backup"|"normal"|"closed"|"claimed"|null = null
|
||||||
|
if (claimCategory){
|
||||||
|
//use claim category
|
||||||
|
category = claimCategory
|
||||||
|
categoryMode = "claimed"
|
||||||
|
}else if (closeCategory != "" && ticket.get("openticket:closed").value){
|
||||||
|
//use close category
|
||||||
|
category = closeCategory
|
||||||
|
categoryMode = "closed"
|
||||||
|
}else if (channelCategory != ""){
|
||||||
|
//category enabled
|
||||||
|
const normalCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelCategory)
|
||||||
|
if (!normalCategory){
|
||||||
|
//default category was not found
|
||||||
|
openticket.log("Ticket Move Error: Unable to find category! #1","error",[
|
||||||
|
{key:"categoryid",value:channelCategory},
|
||||||
|
{key:"backup",value:"false"}
|
||||||
|
])
|
||||||
|
}else{
|
||||||
|
//default category was found
|
||||||
|
if (normalCategory.children.cache.size >= 50 && channelBackupCategory != ""){
|
||||||
|
//use backup category
|
||||||
|
const backupCategory = await openticket.client.fetchGuildCategoryChannel(guild,channelBackupCategory)
|
||||||
|
if (!backupCategory){
|
||||||
|
//default category was not found
|
||||||
|
openticket.log("Ticket Move Error: Unable to find category! #2","error",[
|
||||||
|
{key:"categoryid",value:channelBackupCategory},
|
||||||
|
{key:"backup",value:"true"}
|
||||||
|
])
|
||||||
|
}else{
|
||||||
|
category = backupCategory.id
|
||||||
|
categoryMode = "backup"
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//use default category
|
||||||
|
category = normalCategory.id
|
||||||
|
categoryMode = "normal"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
//only move category when not the same.
|
||||||
|
if (channel.parentId != category) await utilities.timedAwait(channel.setParent(category,{lockPermissions:false}),2500,(err) => {
|
||||||
|
openticket.log("Failed to change channel category on ticket move","error")
|
||||||
|
})
|
||||||
|
ticket.get("openticket:category-mode").value = categoryMode
|
||||||
|
ticket.get("openticket:category").value = category
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to move ticket to 'moved category'!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"categoryid",value:category ?? "/"}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
|
||||||
|
//handle permissions
|
||||||
|
const permissions: discord.OverwriteResolvable[] = [{
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:guild.roles.everyone.id,
|
||||||
|
allow:[],
|
||||||
|
deny:["ViewChannel","SendMessages","ReadMessageHistory"]
|
||||||
|
}]
|
||||||
|
const globalAdmins = openticket.configs.get("openticket:general").data.globalAdmins
|
||||||
|
const optionAdmins = ticket.option.get("openticket:admins").value
|
||||||
|
const readonlyAdmins = ticket.option.get("openticket:admins-readonly").value
|
||||||
|
|
||||||
|
globalAdmins.forEach((admin) => {
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
optionAdmins.forEach((admin) => {
|
||||||
|
if (globalAdmins.includes(admin)) return
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory","ManageMessages"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
readonlyAdmins.forEach((admin) => {
|
||||||
|
if (globalAdmins.includes(admin)) return
|
||||||
|
if (optionAdmins.includes(admin)) return
|
||||||
|
permissions.push({
|
||||||
|
type:discord.OverwriteType.Role,
|
||||||
|
id:admin,
|
||||||
|
allow:["ViewChannel","ReadMessageHistory"],
|
||||||
|
deny:["SendMessages","AddReactions","AttachFiles","SendPolls"]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//transfer all old user-participants over to the new ticket (creator & participants)
|
||||||
|
ticket.get("openticket:participants").value.forEach((p) => {
|
||||||
|
if (p.type == "user") permissions.push({
|
||||||
|
type:discord.OverwriteType.Member,
|
||||||
|
id:p.id,
|
||||||
|
allow:["ViewChannel","SendMessages","AddReactions","AttachFiles","SendPolls","ReadMessageHistory"],
|
||||||
|
deny:[]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
try{
|
||||||
|
await channel.permissionOverwrites.set(permissions)
|
||||||
|
}catch{
|
||||||
|
openticket.log("Failed to reset channel permissions on ticket move!","error")
|
||||||
|
}
|
||||||
|
|
||||||
|
//handle participants
|
||||||
|
const participants: {type:"role"|"user",id:string}[] = []
|
||||||
|
permissions.forEach((permission,index) => {
|
||||||
|
if (index == 0) return //don't include @everyone
|
||||||
|
const type = (permission.type == discord.OverwriteType.Role) ? "role" : "user"
|
||||||
|
const id = permission.id as string
|
||||||
|
participants.push({type,id})
|
||||||
|
})
|
||||||
|
ticket.get("openticket:participants").value = participants
|
||||||
|
ticket.get("openticket:participants").refreshDatabase()
|
||||||
|
|
||||||
|
//rename channel (and give error when crashed)
|
||||||
|
const originalName = channel.name
|
||||||
|
try{
|
||||||
|
await utilities.timedAwait(channel.setName(channelName),2500,(err) => {
|
||||||
|
openticket.log("Failed to rename channel on ticket move","error")
|
||||||
|
})
|
||||||
|
}catch(err){
|
||||||
|
await channel.send((await openticket.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-move",{guild,channel,user,originalName,newName:channelName})).message)
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
if (channel.type == discord.ChannelType.GuildText) channel.setTopic(channelDescription)
|
||||||
|
}catch{}
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket renaming!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"messageid",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reply with new message
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:move-message").build(source,{guild,channel,user,ticket,reason,data})).message)
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
await openticket.events.get("afterTicketMoved").emit([ticket,user,channel,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason,data} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.moving.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"move",reason,additionalData:data}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.moving.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"move",reason,additionalData:data}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" moved a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:move-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,274 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET PINNING SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:pin-ticket"))
|
||||||
|
openticket.actions.get("openticket:pin-ticket").workers.add([
|
||||||
|
new api.ODWorker("openticket:pin-ticket",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to pin ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketPin").emit([ticket,user,channel,reason])
|
||||||
|
|
||||||
|
//update ticket
|
||||||
|
ticket.get("openticket:pinned").value = true
|
||||||
|
ticket.get("openticket:pinned-by").value = user.id
|
||||||
|
ticket.get("openticket:pinned-on").value = new Date().getTime()
|
||||||
|
ticket.get("openticket:busy").value = true
|
||||||
|
|
||||||
|
//update stats
|
||||||
|
openticket.stats.get("openticket:global").setStat("openticket:tickets-pinned",1,"increase")
|
||||||
|
openticket.stats.get("openticket:user").setStat("openticket:tickets-pinned",user.id,1,"increase")
|
||||||
|
|
||||||
|
//move to top of category
|
||||||
|
if (channel.parent){
|
||||||
|
await channel.setPosition(0,{reason:"Ticket Pinned!"})
|
||||||
|
}
|
||||||
|
|
||||||
|
//rename channel (and give error when crashed)
|
||||||
|
const originalName = channel.name
|
||||||
|
const newName = "📌"+channel.name
|
||||||
|
try{
|
||||||
|
await utilities.timedAwait(channel.setName(newName),2500,(err) => {
|
||||||
|
openticket.log("Failed to rename channel on ticket pin","error")
|
||||||
|
})
|
||||||
|
}catch(err){
|
||||||
|
await channel.send((await openticket.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-pin",{guild,channel,user,originalName,newName})).message)
|
||||||
|
}
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket pinning!","error",[
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"message",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reply with new message
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:pin-message").build(source,{guild,channel,user,ticket,reason})).message)
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
await openticket.events.get("afterTicketPinned").emit([ticket,user,channel,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.pinning.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.pinning.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" pinned a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
export const registerVerifyBars = async () => {
|
||||||
|
//PIN TICKET TICKET MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:pin-ticket-ticket-message",openticket.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:pin-ticket-ticket-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.pin
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when already pinned
|
||||||
|
if (ticket.get("openticket:pinned").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start pinning ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//pin with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:pin-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//pin without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
await openticket.actions.get("openticket:pin-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:pin-ticket-ticket-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
|
//PIN TICKET UNPIN MESSAGE
|
||||||
|
openticket.verifybars.add(new api.ODVerifyBar("openticket:pin-ticket-unpin-message",openticket.builders.messages.getSafe("openticket:verifybar-unpin-message"),!generalConfig.data.system.disableVerifyBars))
|
||||||
|
openticket.verifybars.get("openticket:pin-ticket-unpin-message").success.add([
|
||||||
|
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||||
|
const permissionMode = generalConfig.data.system.permissions.pin
|
||||||
|
|
||||||
|
if (permissionMode == "none"){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else if (permissionMode == "everyone") return
|
||||||
|
else if (permissionMode == "admin"){
|
||||||
|
if (!openticket.permissions.hasPermissions("support",await openticket.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}else{
|
||||||
|
if (!instance.guild || !instance.member){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const role = await openticket.client.fetchGuildRole(instance.guild,permissionMode)
|
||||||
|
if (!role){
|
||||||
|
//error
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
if (!role.members.has(instance.member.id)){
|
||||||
|
//no permissions
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||||
|
return cancel()
|
||||||
|
}else return
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when already pinned
|
||||||
|
if (ticket.get("openticket:pinned").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:openticket.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
//return when busy
|
||||||
|
if (ticket.get("openticket:busy").value){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
//start pinning ticket
|
||||||
|
if (params.data == "reason"){
|
||||||
|
//pin with reason
|
||||||
|
instance.modal(await openticket.builders.modals.getSafe("openticket:pin-ticket-reason").build("unpin-message",{guild,channel,user,ticket}))
|
||||||
|
}else{
|
||||||
|
//pin without reason
|
||||||
|
await instance.defer("update",false)
|
||||||
|
await openticket.actions.get("openticket:pin-ticket").run("unpin-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:pin-message").build("unpin-message",{guild,channel,user,ticket,reason:null}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.verifybars.get("openticket:pin-ticket-unpin-message").failure.add([
|
||||||
|
new api.ODWorker("openticket:back-to-unpin-message",0,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user} = instance
|
||||||
|
const {verifybarMessage} = params
|
||||||
|
if (!guild){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
const ticket = openticket.tickets.get(channel.id)
|
||||||
|
if (!ticket || channel.isDMBased()){
|
||||||
|
instance.reply(await openticket.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||||
|
return cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
|
||||||
|
const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
|
||||||
|
|
||||||
|
await instance.update(await openticket.builders.messages.getSafe("openticket:unpin-message").build("other",{guild,channel,user,ticket,reason}))
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:pin-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//REACTION ROLE SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:reaction-role"))
|
||||||
|
openticket.actions.get("openticket:reaction-role").workers.add([
|
||||||
|
new api.ODWorker("openticket:reaction-role",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,user,option,overwriteMode} = params
|
||||||
|
const role = openticket.roles.get(option.id)
|
||||||
|
if (!role) throw new api.ODSystemError("ODAction(ot:reaction-role) => Unknown reaction role (ODRole)")
|
||||||
|
instance.role = role
|
||||||
|
const mode = (overwriteMode) ? overwriteMode : role.get("openticket:mode").value
|
||||||
|
|
||||||
|
await openticket.events.get("onRoleUpdate").emit([user,role])
|
||||||
|
|
||||||
|
//get guild member
|
||||||
|
const member = await openticket.client.fetchGuildMember(guild,user.id)
|
||||||
|
if (!member) throw new api.ODSystemError("ODAction(ot:reaction-role) => User isn't a member of the server!")
|
||||||
|
|
||||||
|
//get all roles
|
||||||
|
const roleIds = role.get("openticket:roles").value
|
||||||
|
const roles: discord.Role[] = []
|
||||||
|
for (const id of roleIds){
|
||||||
|
const r = await openticket.client.fetchGuildRole(guild,id)
|
||||||
|
if (r) roles.push(r)
|
||||||
|
else openticket.log("Unable to find role in server!","warning",[
|
||||||
|
{key:"roleid",value:id}
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
//update roles of user
|
||||||
|
const result: api.OTRoleUpdateResult[] = []
|
||||||
|
for (const r of roles){
|
||||||
|
try{
|
||||||
|
if (r.members.has(user.id) && (mode == "add&remove" || mode == "remove")){
|
||||||
|
//user has role (remove)
|
||||||
|
await member.roles.remove(r)
|
||||||
|
result.push({role:r,action:"removed"})
|
||||||
|
}else if (!r.members.has(user.id) && (mode == "add&remove" || mode == "add")){
|
||||||
|
//user doesn't have role (add)
|
||||||
|
await member.roles.add(r)
|
||||||
|
result.push({role:r,action:"added"})
|
||||||
|
}else{
|
||||||
|
//don't do anything
|
||||||
|
result.push({role:r,action:null})
|
||||||
|
}
|
||||||
|
}catch{
|
||||||
|
result.push({role:r,action:null})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//get roles to remove on add
|
||||||
|
if (result.find((r) => r.action == "added")){
|
||||||
|
//get all remove roles
|
||||||
|
const removeRoleIds = role.get("openticket:remove-roles-on-add").value
|
||||||
|
const removeRoles: discord.Role[] = []
|
||||||
|
for (const id of removeRoleIds){
|
||||||
|
const r = await openticket.client.fetchGuildRole(guild,id)
|
||||||
|
if (r) removeRoles.push(r)
|
||||||
|
else openticket.log("Unable to find role in server!","warning",[
|
||||||
|
{key:"roleid",value:id}
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
//remove roles from user
|
||||||
|
for (const r of removeRoles){
|
||||||
|
try{
|
||||||
|
if (r.members.has(user.id)){
|
||||||
|
//user has role (remove)
|
||||||
|
await member.roles.remove(r)
|
||||||
|
result.push({role:r,action:"removed"})
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update instance & finish event
|
||||||
|
instance.result = result
|
||||||
|
await openticket.events.get("afterRolesUpdated").emit([user,role])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,user,option} = params
|
||||||
|
openticket.log(user.displayName+" updated his roles!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"method",value:source},
|
||||||
|
{key:"option",value:option.id.value}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
///////////////////////////////////////
|
||||||
|
//TICKET REMOVE USER SYSTEM
|
||||||
|
///////////////////////////////////////
|
||||||
|
import {openticket, api, utilities} from "../index"
|
||||||
|
import * as discord from "discord.js"
|
||||||
|
|
||||||
|
const generalConfig = openticket.configs.get("openticket:general")
|
||||||
|
|
||||||
|
export const registerActions = async () => {
|
||||||
|
openticket.actions.add(new api.ODAction("openticket:remove-ticket-user"))
|
||||||
|
openticket.actions.get("openticket:remove-ticket-user").workers.add([
|
||||||
|
new api.ODWorker("openticket:remove-ticket-user",2,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason,data} = params
|
||||||
|
if (channel.isThread()) throw new api.ODSystemError("Unable to remove user from ticket! Open Ticket doesn't support threads!")
|
||||||
|
|
||||||
|
await openticket.events.get("onTicketUserRemove").emit([ticket,user,data,channel,reason])
|
||||||
|
|
||||||
|
//update ticket
|
||||||
|
const index = ticket.get("openticket:participants").value.findIndex((p) => p.type == "user" && p.id == data.id)
|
||||||
|
if (index < 0) return cancel()
|
||||||
|
ticket.get("openticket:participants").value.splice(index,1)
|
||||||
|
ticket.get("openticket:participants").refreshDatabase()
|
||||||
|
ticket.get("openticket:busy").value = true
|
||||||
|
|
||||||
|
//update channel permissions
|
||||||
|
try{
|
||||||
|
await channel.permissionOverwrites.delete(data)
|
||||||
|
}catch{
|
||||||
|
openticket.log("Failed to remove channel permission overwrites on remove-ticket-user","error")
|
||||||
|
}
|
||||||
|
|
||||||
|
//update ticket message
|
||||||
|
const ticketMessage = await openticket.tickets.getTicketMessage(ticket)
|
||||||
|
if (ticketMessage){
|
||||||
|
try{
|
||||||
|
ticketMessage.edit((await openticket.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||||
|
}catch(e){
|
||||||
|
openticket.log("Unable to edit ticket message on ticket user removal!","error",[
|
||||||
|
{key:"channel",value:channel.id},
|
||||||
|
{key:"message",value:ticketMessage.id},
|
||||||
|
{key:"option",value:ticket.option.id.value}
|
||||||
|
])
|
||||||
|
openticket.debugfile.writeErrorMessage(new api.ODError(e,"uncaughtException"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//reply with new message
|
||||||
|
if (params.sendMessage) await channel.send((await openticket.builders.messages.getSafe("openticket:remove-message").build(source,{guild,channel,user,ticket,reason,data})).message)
|
||||||
|
ticket.get("openticket:busy").value = false
|
||||||
|
await openticket.events.get("afterTicketUserRemoved").emit([ticket,user,data,channel,reason])
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,reason,data} = params
|
||||||
|
|
||||||
|
//to logs
|
||||||
|
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.removing.logs){
|
||||||
|
const logChannel = openticket.posts.get("openticket:logs")
|
||||||
|
if (logChannel) logChannel.send(await openticket.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"remove",reason,additionalData:data}))
|
||||||
|
}
|
||||||
|
|
||||||
|
//to dm
|
||||||
|
if (generalConfig.data.system.messages.removing.dm) await openticket.client.sendUserDm(user,await openticket.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"remove",reason,additionalData:data}))
|
||||||
|
}),
|
||||||
|
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||||
|
const {guild,channel,user,ticket,data} = params
|
||||||
|
|
||||||
|
openticket.log(user.displayName+" removed "+data.displayName+" from a ticket!","info",[
|
||||||
|
{key:"user",value:user.username},
|
||||||
|
{key:"userid",value:user.id,hidden:true},
|
||||||
|
{key:"channel",value:"#"+channel.name},
|
||||||
|
{key:"channelid",value:channel.id,hidden:true},
|
||||||
|
{key:"reason",value:params.reason ?? "/"},
|
||||||
|
{key:"method",value:source}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
])
|
||||||
|
openticket.actions.get("openticket:remove-ticket-user").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||||
|
//set busy to false in case of crash or cancel
|
||||||
|
params.ticket.get("openticket:busy").value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user