Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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,3 @@
|
|||||||
|
# comming soon
|
||||||
|
For now on, you can create a ticket in our server:
|
||||||
|
https://discord.dj-dj.be
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve Open Ticket
|
||||||
|
title: "[BUG] your bug"
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Device:**
|
||||||
|
- Device: [e.g. Macbook pro, raspberry pi, HP Probook]
|
||||||
|
- OS: [e.g. MacOS, Ubuntu, Windows,...]
|
||||||
|
- Node.js version:
|
||||||
|
- Open Ticket Version:
|
||||||
|
|
||||||
|
**Files:**
|
||||||
|
Please include the `openticketdebug.txt` file in your report!
|
||||||
|
This is a file that we can see what happend!
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
name: Plugin
|
||||||
|
about: Show your open ticket plugins here!
|
||||||
|
title: "[PLUGIN] your plugin"
|
||||||
|
labels: plugin
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Plugin Name:**
|
||||||
|
What's the name of your plugin?
|
||||||
|
|
||||||
|
**Description:**
|
||||||
|
Tell a little bit about what the plugin does!
|
||||||
|
Also tell how to use the plugin, like if there is additional setup needed!
|
||||||
|
|
||||||
|
**NPM libraries:**
|
||||||
|
List all the libraries needed for this plugin to work!
|
||||||
|
*The default open ticket libraries are not required!*
|
||||||
|
|
||||||
|
**Author:**
|
||||||
|
- github account [e.g. DJj123dj]
|
||||||
|
- discord account [e.g. Wumpus#1234]
|
||||||
|
|
||||||
|
**Compatible versions:**
|
||||||
|
[e.g. from v2.2.1 until v3.0.1]
|
||||||
|
|
||||||
|
**File:**
|
||||||
|
Please attach the plugin file to this issue!
|
||||||
+15
-7
@@ -1,14 +1,22 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
devConfig.json
|
devconfig.json
|
||||||
devConfig1.json
|
devconfig1.json
|
||||||
devConfig2.json
|
devconfig2.json
|
||||||
devConfig3.json
|
devconfig3.json
|
||||||
devConfig4.json
|
devconfig4.json
|
||||||
devConfig5.json
|
devconfig5.json
|
||||||
.DS_Store
|
.DS_Store
|
||||||
openticketdebug.txt
|
openticketdebug.txt
|
||||||
developerChangelog.md
|
developerChangelog.md
|
||||||
storage/dynamicDB/
|
storage/dynamicDB/
|
||||||
|
storage/slashcmdEnabled.txt
|
||||||
|
storage/database.json
|
||||||
|
storage/tsdatabase.json
|
||||||
storage/.DS_Store
|
storage/.DS_Store
|
||||||
.vscode/
|
.vscode/
|
||||||
|
livestatus.json
|
||||||
|
test.js
|
||||||
|
devtsconfig.json
|
||||||
|
plugins/*
|
||||||
|
!plugins/example.plugin.js
|
||||||
@@ -1,87 +1,66 @@
|
|||||||
## We need translators!
|
<img src="https://www.dj-dj.be/wp-content/uploads/2023/02/open-ticket-cropped.png" alt="Open Ticket" width="600px">
|
||||||
If you know a language that isn't already in open ticket and you can write json,
|
|
||||||
then is this the job for you!
|
|
||||||
|
|
||||||
make a ticket in our server to start!
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.2.2) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
||||||
|
|
||||||
*if you translate, you will come in the credits*
|
### Open Ticket
|
||||||
|
Open Ticket is of the most customisable discord ticket bots of all time!
|
||||||
|
You have more than +100 options to customise in the config! This includes html transcripts, unlimited tickets, custom embeds & more!
|
||||||
|
We also have a great support service, we can solve every question you have about open ticket! We even provide free 24/7 hosting if you want!
|
||||||
|
|
||||||
# open-ticket
|
Take a look at all the features and discover the possibilities!
|
||||||
[](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)
|
### [Documentation](https://docs.openticket.dj-dj.be/quick-start)
|
||||||
|
|
||||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
## Features
|
||||||
|
- **🎉 NEW! html transcripts!**
|
||||||
|
- 🔒 close, ❌ delete & ✅ re-open tickets
|
||||||
|
- 🇬🇧 translation in 12 different languages
|
||||||
|
- 📄 very advanced customisation
|
||||||
|
- 🆗 buttons or 🔽 dropdowns!
|
||||||
|
- 🆒 plugins
|
||||||
|
- ∞ unlimited tickets & unlimited messages
|
||||||
|
- ➕➖ add/remove users from a ticket
|
||||||
|
- /slash & text commands
|
||||||
|
|
||||||
<img src="logo.png" alt="Open Ticket logo" style="height: 200px; width:200px;"/>
|
<details>
|
||||||
|
<summary><b>Click here for even more features!</b></summary>
|
||||||
|
|
||||||
|
|
||||||
|
- very customisable
|
||||||
|
- close tickets with reason
|
||||||
|
- also includes reaction roles!
|
||||||
|
- discord interaction buttons
|
||||||
|
- discord.js 14
|
||||||
|
</details>
|
||||||
|
|
||||||
[](https://www.github.com/DJj123dj/open-ticket/wiki)
|
## preview
|
||||||
|
Images coming soon<br>
|
||||||
|
You can already see some images at our [documentation!](https://docs.openticket.dj-dj.be)
|
||||||
|
|
||||||
### Thanks to these people:
|
|
||||||
- DJ-Lite: for doing the administration
|
|
||||||
- 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
|
## credits
|
||||||
- discord interaction buttons
|
DJdj Development Team
|
||||||
- slash & text commands
|
|Main Developer|Developer|Support Team|Designer|
|
||||||
- close, delete & re-open tickets
|
|--------------|---------|-----------|---------|
|
||||||
- translation in 8 different languages
|
|DJj123dj |Sanke |DJ-Lite |vuur_draak|
|
||||||
- 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:*
|
Translators
|
||||||
- dashboard
|
|Language |Translator |
|
||||||
- view transcripts in dashboard
|
|--------------|-------------------------|
|
||||||
- share transcripts
|
|Dutch |DJj123dj#1706 |
|
||||||
- close with reason
|
|Romanian |Sanke#6086 |
|
||||||
- more translation
|
|French |Sanke#6086 |
|
||||||
|
|Spanish |Redactado#1673 & josuens14#5267|
|
||||||
|
|German |david.#8276 |
|
||||||
|
|Italian |Maurizio#0268 |
|
||||||
|
|Czech |t0miiis#3022 |
|
||||||
|
|Arabic |ChilledBroke#9986 & M4#5882|
|
||||||
|
|Danish |the_gamer#5095 |
|
||||||
|
|Portuguese |QuirAddon#9778 |
|
||||||
|
|Russian |Apexo#0723 |
|
||||||
|
|
||||||
## installation
|
## links
|
||||||
**You need `node.js 16` to run this project!**
|
current version: _v3.2.2_
|
||||||
|
</br>changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
||||||
|
</br>documentation: [click here](https://docs.openticket.dj-dj.be/quick-start)
|
||||||
|
|
||||||
### packages
|
© 2023 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.dj-dj.be) | [terms of service](https://www.dj-dj.be/terms)
|
||||||
- chalk => version `latest`
|
|
||||||
- discord.js => version `latest`
|
|
||||||
- express => version `latest`
|
|
||||||
- node-localstorage => version `latest`
|
|
||||||
- axios => version `latest`
|
|
||||||
|
|
||||||
You can install all of them by running `npm install`
|
|
||||||
|
|
||||||
## running
|
|
||||||
you can run `node index.js` but i would recommend you to use `npm start`
|
|
||||||
|
|
||||||
if there are any errors, you can open an **issue on github** or **contact me in our discord server**.
|
|
||||||
|
|
||||||
### 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.
|
|
||||||
You can also configure your own permissions
|
|
||||||
|
|
||||||
## information
|
|
||||||
|
|
||||||
_v2.5.0 stable_
|
|
||||||
|
|
||||||
changelog: [click here](https://www.github.com/DJj123dj/open-ticket/wiki/Changelog)
|
|
||||||
|
|
||||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.dj-dj.be) | [terms of service](https://www.dj-dj.be/terms)
|
|
||||||
|
|||||||
+9
-6
@@ -7,9 +7,12 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded add.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.add) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"add")) return
|
if (!msg.content.startsWith(config.prefix+"add")) return
|
||||||
var user = msg.mentions.users.first()
|
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 (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
|
||||||
@@ -27,13 +30,13 @@ module.exports = () => {
|
|||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
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.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.addEmbed(user)]})
|
msg.channel.send({embeds:[bot.embeds.commands.addEmbed(user,msg.author)]})
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
var loguser = msg.mentions.users.first()
|
||||||
log("command","someone used the 'add' command",[{key:"user",value:msg.author.tag}])
|
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}])
|
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)
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
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())
|
APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
@@ -41,7 +44,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
if (!DISABLE.commands.slash.add) client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "add") return
|
if (interaction.commandName != "add") return
|
||||||
const user = interaction.options.getUser("user")
|
const user = interaction.options.getUser("user")
|
||||||
@@ -59,13 +62,13 @@ module.exports = () => {
|
|||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
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.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
||||||
interaction.reply({embeds:[bot.embeds.commands.addEmbed(user)]})
|
interaction.reply({embeds:[bot.embeds.commands.addEmbed(user,interaction.user)]})
|
||||||
|
|
||||||
var loguser = user
|
var loguser = user
|
||||||
log("command","someone used the 'add' command",[{key:"user",value:interaction.user.tag}])
|
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}])
|
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)
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
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())
|
APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
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")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
bot.errorLog.log("debug","COMMANDS: loaded change.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.change) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"change")) return
|
||||||
|
|
||||||
|
if (!msg.guild) return
|
||||||
|
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(msg.author)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(async 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 newtype = msg.content.split(config.prefix+"change")[1].substring(1)
|
||||||
|
if (!newtype) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<type>`:\n`"+config.prefix+"change <type>`")]})
|
||||||
|
|
||||||
|
const newTicket = require("../core/utils/configParser").getTicketById(newtype)
|
||||||
|
const list = []
|
||||||
|
config.options.forEach((o) => list.push(o.id))
|
||||||
|
if (!newTicket) return bot.errorLog.invalidIdChooseFromList(list)
|
||||||
|
|
||||||
|
/**@type {String} */
|
||||||
|
var chName = msg.channel.name
|
||||||
|
const splitted = chName.split("-")
|
||||||
|
const prefix = splitted.shift()
|
||||||
|
const name = (splitted.length > 0) ? splitted.join("-") : prefix
|
||||||
|
|
||||||
|
if (newTicket.category){
|
||||||
|
const parent = await msg.guild.channels.fetch(newTicket.category,{cache:true})
|
||||||
|
if (parent && parent.type == discord.ChannelType.GuildCategory) msg.channel.setParent(parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.channel.setName(newTicket.channelprefix+name)
|
||||||
|
msg.channel.send({embeds:[bot.embeds.commands.changeEmbed(msg.author,newtype)]})
|
||||||
|
|
||||||
|
log("command","someone used the 'change' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","ticket type changed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newtype",value:newtype}])
|
||||||
|
APIEvents.onCommand("change",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.change) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "change") 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(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
|
||||||
|
|
||||||
|
var newtype = interaction.options.getString("type",true)
|
||||||
|
if (!newtype) return interaction.reply({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<type>`:\n`"+config.prefix+"change <type>`")]})
|
||||||
|
|
||||||
|
const newTicket = require("../core/utils/configParser").getTicketById(newtype,true)
|
||||||
|
const list = []
|
||||||
|
config.options.forEach((o) => list.push(o.id))
|
||||||
|
if (!newTicket) return bot.errorLog.invalidIdChooseFromList(list)
|
||||||
|
|
||||||
|
/**@type {String} */
|
||||||
|
var chName = interaction.channel.name
|
||||||
|
const splitted = chName.split("-")
|
||||||
|
const prefix = splitted.shift()
|
||||||
|
const name = (splitted.length > 0) ? splitted.join("-") : prefix
|
||||||
|
|
||||||
|
if (newTicket.category){
|
||||||
|
const parent = await interaction.guild.channels.fetch(newTicket.category,{cache:true})
|
||||||
|
if (parent && parent.type == discord.ChannelType.GuildCategory) interaction.channel.setParent(parent)
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.channel.setName(newTicket.channelprefix+name)
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.changeEmbed(interaction.user,newtype)]})
|
||||||
|
|
||||||
|
log("command","someone used the 'change' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","ticket type changed",[{key:"user",value:interaction.user.tag},{key:"ticket",value:name},{key:"newtype",value:newtype}])
|
||||||
|
APIEvents.onCommand("change",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
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")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
bot.errorLog.log("debug","COMMANDS: loaded claim.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.claim) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"claim")) return
|
||||||
|
var user = msg.mentions.users.first()
|
||||||
|
|
||||||
|
const claimingUser = user ? user : msg.author
|
||||||
|
|
||||||
|
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.claimEmbed(claimingUser,msg.author)]})
|
||||||
|
msg.channel.send({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||||
|
|
||||||
|
var loguser = claimingUser
|
||||||
|
log("command","someone used the 'claim' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","user claimed to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"claimed_user",value:claimingUser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
|
//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())
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.claim) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "claim") return
|
||||||
|
const user = interaction.options.getUser("user",false) ? interaction.options.getUser("user",true) : interaction.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.reply({embeds:[bot.embeds.commands.claimEmbed(user,interaction.user)]})
|
||||||
|
interaction.reply({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||||
|
|
||||||
|
var loguser = user
|
||||||
|
log("command","someone used the 'claim' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","user claimed to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"claimed_user",value:loguser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
|
//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())
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
+25
-6
@@ -7,11 +7,22 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded close.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.close) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"close")) return
|
if (!msg.content.startsWith(config.prefix+"close")) return
|
||||||
|
|
||||||
|
const args = msg.content.substring((config.prefix+"close").length).split(" ")
|
||||||
|
args.shift()
|
||||||
|
/**@type {String|false} */
|
||||||
|
var tempreason = args.join(" ")
|
||||||
|
if (!tempreason || tempreason == " " || tempreason == " "){
|
||||||
|
tempreason = false
|
||||||
|
}
|
||||||
|
const reason = tempreason
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
@@ -19,7 +30,10 @@ module.exports = () => {
|
|||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
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]})
|
if (hiddendata.data.find(h => h.key == "pendingdelete")) return msg.channel.send({embeds:[bot.errorLog.warning("Warning!","You can't close a ticket while it's being deleted!")]})
|
||||||
|
|
||||||
|
const descriptionReason = reason ? "**"+l.messages.reason+":** "+reason : false
|
||||||
|
msg.channel.send({embeds:[bot.embeds.commands.closeEmbed(msg.author,descriptionReason)],components:[bot.buttons.close.closeCommandRow]})
|
||||||
|
|
||||||
var name = msg.channel.name
|
var name = msg.channel.name
|
||||||
var prefix = ""
|
var prefix = ""
|
||||||
@@ -30,7 +44,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"close",false,true)
|
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"close",reason,true)
|
||||||
|
|
||||||
log("command","someone used the 'close' command",[{key:"user",value:msg.author.tag}])
|
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())
|
APIEvents.onCommand("close",true,msg.author,msg.channel,msg.guild,new Date())
|
||||||
@@ -40,19 +54,24 @@ module.exports = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
if (!DISABLE.commands.slash.close) client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "close") return
|
if (interaction.commandName != "close") return
|
||||||
|
|
||||||
//interaction.deferReply()
|
//interaction.deferReply()
|
||||||
|
|
||||||
|
const reason = interaction.options.getString("reason") ? interaction.options.getString("reason") : false
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
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 hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
if (hiddendata.data.find(h => h.key == "pendingdelete")) return interaction.reply({embeds:[bot.errorLog.warning("Warning!","You can't close a ticket while it's being deleted!")]})
|
||||||
|
|
||||||
|
const descriptionReason = reason ? "**"+l.messages.reason+":** "+reason : false
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user,descriptionReason)],components:[bot.buttons.close.closeCommandRow]})
|
||||||
|
|
||||||
var name = interaction.channel.name
|
var name = interaction.channel.name
|
||||||
var prefix = ""
|
var prefix = ""
|
||||||
@@ -63,7 +82,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
||||||
|
|
||||||
log("command","someone used the 'close' command",[{key:"user",value:interaction.user.tag}])
|
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())
|
APIEvents.onCommand("close",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|||||||
+8
-5
@@ -7,9 +7,12 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded delete.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.delete) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"delete")) return
|
if (!msg.content.startsWith(config.prefix+"delete")) return
|
||||||
|
|
||||||
if (!msg.guild) return
|
if (!msg.guild) return
|
||||||
@@ -35,7 +38,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"delete",false,true)
|
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"delete",false,true)
|
||||||
|
|
||||||
log("command","someone used the 'delete' command",[{key:"user",value:msg.author.tag}])
|
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())
|
APIEvents.onCommand("delete",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
@@ -44,7 +47,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
if (!DISABLE.commands.slash.delete) client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "delete") return
|
if (interaction.commandName != "delete") return
|
||||||
|
|
||||||
@@ -53,7 +56,7 @@ module.exports = () => {
|
|||||||
if (!interaction.guild) return
|
if (!interaction.guild) return
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
return interaction.reply({embeds:[bot.errorLog.noPermsDelete]})
|
return interaction.reply({embeds:[bot.errorLog.noPermsDelete(interaction.user)]})
|
||||||
}
|
}
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
@@ -73,7 +76,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
require("../core/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||||
|
|
||||||
log("command","someone used the 'delete' command",[{key:"user",value:interaction.user.tag}])
|
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())
|
APIEvents.onCommand("delete",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|||||||
+9
-6
@@ -6,21 +6,24 @@ const log = bot.errorLog.log
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
|
bot.errorLog.log("debug","COMMANDS: loaded help.js")
|
||||||
|
|
||||||
|
const msgName = config.system.showSlashcmdsInHelp ? "message" : "msg"
|
||||||
|
const prefix = config.system.showSlashcmdsInHelp ? "/" : config.prefix
|
||||||
|
|
||||||
const helpEmbed = new discord.EmbedBuilder()
|
const helpEmbed = new discord.EmbedBuilder()
|
||||||
.setColor(config.main_color)
|
.setColor(config.main_color)
|
||||||
.setTitle("❔ "+l.helpMenu.title)
|
.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
|
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+"_`")
|
helpEmbed.setDescription(header+"`"+prefix+msgName+" <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+"_\n\n`"+prefix+"change <newtype>` ➜ _Change ticket type._")
|
||||||
|
|
||||||
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
|
var otherprefix = prefix.endsWith(" ") ? prefix.substring(0,prefix.length-1) : prefix
|
||||||
|
|
||||||
client.on("messageCreate",msg => {
|
if (!DISABLE.commands.text.help) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix)) return
|
if (!msg.content.startsWith(config.prefix)) return
|
||||||
var args = msg.content.split(config.prefix)
|
var args = msg.content.split(config.prefix)
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
if (!DISABLE.commands.slash.help) client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "help") return
|
if (interaction.commandName != "help") return
|
||||||
|
|
||||||
|
|||||||
+9
-6
@@ -7,9 +7,12 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded remove.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.remove) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"remove")) return
|
if (!msg.content.startsWith(config.prefix+"remove")) return
|
||||||
var user = msg.mentions.users.first()
|
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 (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
|
||||||
@@ -27,21 +30,21 @@ module.exports = () => {
|
|||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.delete(user.id)
|
msg.channel.permissionOverwrites.delete(user.id)
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.removeEmbed(user)]})
|
msg.channel.send({embeds:[bot.embeds.commands.removeEmbed(user,msg.author)]})
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
var loguser = msg.mentions.users.first()
|
||||||
|
|
||||||
log("command","someone used the 'remove' command",[{key:"user",value:msg.author.tag}])
|
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}])
|
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)
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
APIEvents.onTicketRemove(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
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())
|
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 (!DISABLE.commands.slash.remove) client.on("interactionCreate",async (interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "remove") return
|
if (interaction.commandName != "remove") return
|
||||||
const user = interaction.options.getUser("user")
|
const user = interaction.options.getUser("user")
|
||||||
@@ -59,14 +62,14 @@ module.exports = () => {
|
|||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.delete(user.id)
|
interaction.channel.permissionOverwrites.delete(user.id)
|
||||||
interaction.reply({embeds:[bot.embeds.commands.removeEmbed(user)]})
|
interaction.reply({embeds:[bot.embeds.commands.removeEmbed(user,interaction.user)]})
|
||||||
|
|
||||||
var loguser = user
|
var loguser = user
|
||||||
|
|
||||||
log("command","someone used the 'remove' command",[{key:"user",value:interaction.user.tag}])
|
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}])
|
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)
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
APIEvents.onTicketRemove(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
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())
|
APIEvents.onCommand("remove",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
})
|
})
|
||||||
|
|||||||
+5
-2
@@ -7,9 +7,12 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded rename.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.rename) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"rename")) return
|
if (!msg.content.startsWith(config.prefix+"rename")) return
|
||||||
|
|
||||||
if (!msg.guild) return
|
if (!msg.guild) return
|
||||||
@@ -50,7 +53,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
if (!DISABLE.commands.slash.rename) client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "rename") return
|
if (interaction.commandName != "rename") return
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -7,9 +7,12 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate",msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded reopen.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.reopen) client.on("messageCreate",msg => {
|
||||||
if (!msg.content.startsWith(config.prefix+"reopen")) return
|
if (!msg.content.startsWith(config.prefix+"reopen")) return
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
@@ -18,9 +21,11 @@ module.exports = () => {
|
|||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
if (hiddendata.data.find(h => h.key == "pendingdelete")) return msg.channel.send({embeds:[bot.errorLog.warning("Warning!","You can't re-open a ticket while it's being deleted!")]})
|
||||||
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.reopenEmbed(msg.author)],components:[bot.buttons.close.openRowNormal]})
|
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)
|
require("../core/ticketActions/ticketReopener").reopenTicket(msg.guild,msg.channel,msg.author)
|
||||||
|
|
||||||
log("command","someone used the 'reopen' command",[{key:"user",value:msg.author.tag}])
|
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())
|
APIEvents.onCommand("reopen",true,msg.author,msg.channel,msg.guild,new Date())
|
||||||
@@ -28,7 +33,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
if (!DISABLE.commands.slash.reopen) client.on("interactionCreate",async (interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "reopen") return
|
if (interaction.commandName != "reopen") return
|
||||||
|
|
||||||
@@ -40,9 +45,11 @@ module.exports = () => {
|
|||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
if (hiddendata.data.find(h => h.key == "pendingdelete")) return interaction.reply({embeds:[bot.errorLog.warning("Warning!","You can't re-open a ticket while it's being deleted!")]})
|
||||||
|
|
||||||
await interaction.reply({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
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)
|
require("../core/ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||||
|
|
||||||
log("command","someone used the 'reopen' command",[{key:"user",value:interaction.user.tag}])
|
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())
|
APIEvents.onCommand("reopen",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|||||||
+7
-4
@@ -7,8 +7,11 @@ const l = bot.language
|
|||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
const permsChecker = require("../core/utils/permisssionChecker")
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
|
bot.errorLog.log("debug","COMMANDS: loaded ticket.js")
|
||||||
|
|
||||||
/**@type {String[]} */
|
/**@type {String[]} */
|
||||||
var msgIds = []
|
var msgIds = []
|
||||||
config.messages.forEach((msg) => {
|
config.messages.forEach((msg) => {
|
||||||
@@ -16,7 +19,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
client.on("messageCreate", msg => {
|
if (!DISABLE.commands.text.msg) client.on("messageCreate", msg => {
|
||||||
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
||||||
|
|
||||||
if (!msg.guild) return
|
if (!msg.guild) return
|
||||||
@@ -31,7 +34,7 @@ module.exports = () => {
|
|||||||
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||||
|
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
||||||
|
|
||||||
msg.channel.send({embeds:[embed],components:componentRows})
|
msg.channel.send({embeds:[embed],components:componentRows})
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
client.on("interactionCreate", (interaction) => {
|
if (!DISABLE.commands.slash.msg) client.on("interactionCreate", (interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return
|
if (!interaction.isChatInputCommand()) return
|
||||||
if (interaction.commandName != "message") return
|
if (interaction.commandName != "message") return
|
||||||
|
|
||||||
@@ -54,7 +57,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/ticketMessageEmbed").createEmbed(id)
|
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
||||||
|
|
||||||
interaction.reply({content:l.commands.ticketWarning})
|
interaction.reply({content:l.commands.ticketWarning})
|
||||||
interaction.channel.send({embeds:[embed],components:componentRows})
|
interaction.channel.send({embeds:[embed],components:componentRows})
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
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")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
bot.errorLog.log("debug","COMMANDS: loaded unclaim.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.unclaim) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"unclaim")) 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.unclaimEmbed(msg.author)]})
|
||||||
|
msg.channel.send({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||||
|
|
||||||
|
var loguser = msg.author
|
||||||
|
log("command","someone used the 'unclaim' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","user unclaimed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"unclaimed_user",value:msg.author.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
|
//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())
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.unclaim) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "unclaim") return
|
||||||
|
const user = interaction.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.reply({embeds:[bot.embeds.commands.unclaimEmbed(interaction.user)]})
|
||||||
|
interaction.reply({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
||||||
|
|
||||||
|
var loguser = user
|
||||||
|
log("command","someone used the 'unclaim' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","user unclaimed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"unclaimed_user",value:loguser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
||||||
|
//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())
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
+44
-12
@@ -6,7 +6,6 @@
|
|||||||
"prefix":"!ticket ",
|
"prefix":"!ticket ",
|
||||||
"languagefile":"english",
|
"languagefile":"english",
|
||||||
|
|
||||||
"credits":true,
|
|
||||||
"status":{
|
"status":{
|
||||||
"enabled":true,
|
"enabled":true,
|
||||||
"type":"PLAYING",
|
"type":"PLAYING",
|
||||||
@@ -19,14 +18,16 @@
|
|||||||
"enable_DM_Messages":true,
|
"enable_DM_Messages":true,
|
||||||
|
|
||||||
"has@everyoneaccess":false,
|
"has@everyoneaccess":false,
|
||||||
"member_role":"member role (doesn't have access to tickets)",
|
"member_role":"member role (this role doesn't have access to tickets)",
|
||||||
"closeMode":"adminonly|normal",
|
"closeMode":"adminonly or normal (select one of the 2)",
|
||||||
|
|
||||||
"enable_transcript":false,
|
"transcripts":"!!!! ALL SETTINGS FOR TRANSCRIPTS ARE LOCATED IN: transcriptconfig.json !!!!",
|
||||||
"enable_DM_transcript":false,
|
|
||||||
"transcript_channel":"channel id"
|
"showSlashcmdsInHelp":false,
|
||||||
|
"answerInEphemeralOnOpen":true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"SUPPORT":"Take look at our wiki: https://docs.openticket.dj-dj.be or join our discord server: https://discord.dj-dj.be if you need support!",
|
||||||
"options":[
|
"options":[
|
||||||
{
|
{
|
||||||
"id":"general",
|
"id":"general",
|
||||||
@@ -41,8 +42,22 @@
|
|||||||
"channelprefix":"question-",
|
"channelprefix":"question-",
|
||||||
"category":"category id",
|
"category":"category id",
|
||||||
"message":"You created a ticket!",
|
"message":"You created a ticket!",
|
||||||
"enableDMMessage":true,
|
"enableDmOnOpen":true,
|
||||||
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*"
|
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*",
|
||||||
|
|
||||||
|
"thumbnail":{
|
||||||
|
"enable":false,
|
||||||
|
"url":"https://www.example.com/catmemes/cat.png"
|
||||||
|
},
|
||||||
|
"image":{
|
||||||
|
"enable":false,
|
||||||
|
"url":"https://www.dj-dj.be/wp-content/uploads/2022/09/pfp-cropped.png"
|
||||||
|
},
|
||||||
|
|
||||||
|
"closedCategory":{
|
||||||
|
"enable":false,
|
||||||
|
"id":"category id"
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -67,7 +82,7 @@
|
|||||||
"color":"red",
|
"color":"red",
|
||||||
"roles":["discord role id"],
|
"roles":["discord role id"],
|
||||||
"mode":"add&remove|remove|add",
|
"mode":"add&remove|remove|add",
|
||||||
"enableDMMessage":true
|
"enableDmOnOpen":true
|
||||||
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -77,9 +92,10 @@
|
|||||||
"id":"1",
|
"id":"1",
|
||||||
"name":"Choose Your Ticket",
|
"name":"Choose Your Ticket",
|
||||||
"description":"You can click one of the buttons below!",
|
"description":"You can click one of the buttons below!",
|
||||||
|
"dropdown":false,
|
||||||
|
|
||||||
"enableFooter":false,
|
"enableFooter":false,
|
||||||
"footer":"Open Ticket v2.5.0 - I'm a footer!",
|
"footer":"Open Ticket v3.2.2 - I'm a footer!",
|
||||||
|
|
||||||
"enableThumbnail":false,
|
"enableThumbnail":false,
|
||||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||||
@@ -88,8 +104,24 @@
|
|||||||
"color":"#ffffff",
|
"color":"#ffffff",
|
||||||
|
|
||||||
"options":["general","apply"],
|
"options":["general","apply"],
|
||||||
"enableTicketExplaination":true,
|
|
||||||
"enableMaxTicketsWarning":true
|
"other":{
|
||||||
|
"enableTicketExplaination":true,
|
||||||
|
"enableMaxTicketsWarning":true,
|
||||||
|
|
||||||
|
"customDropdownPlaceholder":{
|
||||||
|
"enable":false,
|
||||||
|
"text":"Choose a ticket"
|
||||||
|
},
|
||||||
|
"customCategoryText":{
|
||||||
|
"enable":false,
|
||||||
|
"text":"choose a category:"
|
||||||
|
},
|
||||||
|
"embedTitleURL":{
|
||||||
|
"enable":false,
|
||||||
|
"url":"https://www.dj-dj.be/projects/open-ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+17
-4
@@ -1,10 +1,13 @@
|
|||||||
{
|
{
|
||||||
"version":"1.0.0",
|
"version":"1.0.0",
|
||||||
|
"enableAPIdebug":false,
|
||||||
|
"enableAPIconsolelogs":false,
|
||||||
|
|
||||||
|
"info":"If you turn these switches to true, then the feature will be turned OFF!",
|
||||||
"disclaimer":"DISABLE doesn't work yet! Below this message!",
|
"info2":"You can use this to disable some features you don't want!",
|
||||||
"disable":{
|
"disable":{
|
||||||
"messages":{
|
"messages":{
|
||||||
|
"DISCLAIMER":"the messages part doesn't work yet!",
|
||||||
"ticketCreated":false,
|
"ticketCreated":false,
|
||||||
"ticketClosed":false,
|
"ticketClosed":false,
|
||||||
"ticketDeleted":false,
|
"ticketDeleted":false,
|
||||||
@@ -24,7 +27,10 @@
|
|||||||
"new":false,
|
"new":false,
|
||||||
"add":false,
|
"add":false,
|
||||||
"remove":false,
|
"remove":false,
|
||||||
"rename":false
|
"rename":false,
|
||||||
|
"claim":false,
|
||||||
|
"unclaim":false,
|
||||||
|
"change":false
|
||||||
},
|
},
|
||||||
"slash":{
|
"slash":{
|
||||||
"help":false,
|
"help":false,
|
||||||
@@ -35,12 +41,19 @@
|
|||||||
"new":false,
|
"new":false,
|
||||||
"add":false,
|
"add":false,
|
||||||
"remove":false,
|
"remove":false,
|
||||||
"rename":false
|
"rename":false,
|
||||||
|
"claim":false,
|
||||||
|
"unclaim":false,
|
||||||
|
"change":false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"checkerjs":{
|
"checkerjs":{
|
||||||
"token":false,
|
"token":false,
|
||||||
"all":false
|
"all":false
|
||||||
|
},
|
||||||
|
"debug":{
|
||||||
|
"all":false,
|
||||||
|
"debuglogs":false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,8 @@
|
|||||||
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!!
|
/** FOR DEVELOPERS ONLY!!
|
||||||
* Don't change anything in this file, read the api documentation first!
|
* Don't change anything in this file before reading the documentation!
|
||||||
* look into "api docs.md" for the docs!
|
* visit the api documentation at https://docs.openticket.dj-dj.be
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//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.embeddedMode = false
|
||||||
exports.clientLocation = require("../../../index").client
|
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!
|
|
||||||
*/
|
|
||||||
+103
-10
@@ -4,7 +4,8 @@ const client = bot.client
|
|||||||
const config = bot.config
|
const config = bot.config
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
const l = bot.language
|
const l = bot.language
|
||||||
const storage = bot.storage
|
|
||||||
|
const configParser = require("../../utils/configParser")
|
||||||
|
|
||||||
|
|
||||||
//EVENT API:
|
//EVENT API:
|
||||||
@@ -16,6 +17,10 @@ const ticketReopenListeners = []
|
|||||||
const ticketAddListeners = []
|
const ticketAddListeners = []
|
||||||
const ticketRemoveListeners = []
|
const ticketRemoveListeners = []
|
||||||
|
|
||||||
|
const ticketClaimListeners = []
|
||||||
|
const ticketUnclaimListeners = []
|
||||||
|
const ticketChangeListeners = []
|
||||||
|
|
||||||
|
|
||||||
const transcriptCreationListeners = []
|
const transcriptCreationListeners = []
|
||||||
const commandListeners = []
|
const commandListeners = []
|
||||||
@@ -48,7 +53,7 @@ exports.onTicketOpen = (user,channel,guild,date,ticketdata) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
* @param {String} reason
|
* @param {String} reason
|
||||||
*/
|
*/
|
||||||
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
||||||
@@ -69,7 +74,7 @@ exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
*/
|
*/
|
||||||
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
||||||
//system
|
//system
|
||||||
@@ -89,7 +94,7 @@ exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
*/
|
*/
|
||||||
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
||||||
//system
|
//system
|
||||||
@@ -110,7 +115,7 @@ exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
*/
|
*/
|
||||||
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||||
//system
|
//system
|
||||||
@@ -131,7 +136,7 @@ exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
*/
|
*/
|
||||||
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||||
//system
|
//system
|
||||||
@@ -145,6 +150,66 @@ exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketClaim = (user,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","user claimed a ticket",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketClaimListeners.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:configParser.OTTicketOptions}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketUnclaim = (user,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","user unclaimed a ticket",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketUnclaimListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} newtype
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketChange = (newtype,user,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","user changed ticket type",[{key:"newtype",value:newtype},{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketChangeListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(newtype,user,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.Message[]} messages
|
* @param {discord.Message[]} messages
|
||||||
@@ -164,7 +229,7 @@ exports.onTranscriptCreation = (messages,channel,guild,date) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**@typedef {"help"|"message"|"close"|"delete"|"reopen"|"rename"|"add"|"remove"} OTCommandType */
|
/**@typedef {"help"|"message"|"close"|"delete"|"reopen"|"rename"|"add"|"remove"|"claim"|"unclaim"|"change"} OTCommandType */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -237,7 +302,7 @@ exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,7 +311,7 @@ exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
* @param {String} reason
|
* @param {String} reason
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -265,7 +330,17 @@ exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
|||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
* @param {discord.Guild} guild
|
* @param {discord.Guild} guild
|
||||||
* @param {Date} date
|
* @param {Date} date
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback TicketTypeChangeEvent
|
||||||
|
* @param {String} newtype
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -327,6 +402,21 @@ const onTicketRemove = (callback) => {
|
|||||||
ticketRemoveListeners.push(callback)
|
ticketRemoveListeners.push(callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**@param {TicketActionEvent} callback */
|
||||||
|
const onTicketClaim = (callback) => {
|
||||||
|
ticketClaimListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketActionEvent} callback */
|
||||||
|
const onTicketUnclaim = (callback) => {
|
||||||
|
ticketUnclaimListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketTypeChangeEvent} callback */
|
||||||
|
const onTicketChange = (callback) => {
|
||||||
|
ticketChangeListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
/**@param {TranscriptCreationEvent} callback */
|
/**@param {TranscriptCreationEvent} callback */
|
||||||
const onTranscriptCreation = (callback) => {
|
const onTranscriptCreation = (callback) => {
|
||||||
transcriptCreationListeners.push(callback)
|
transcriptCreationListeners.push(callback)
|
||||||
@@ -354,6 +444,9 @@ exports.events = {
|
|||||||
onTicketReopen,
|
onTicketReopen,
|
||||||
onTicketAdd,
|
onTicketAdd,
|
||||||
onTicketRemove,
|
onTicketRemove,
|
||||||
|
onTicketClaim,
|
||||||
|
onTicketUnclaim,
|
||||||
|
onTicketChange,
|
||||||
onTranscriptCreation,
|
onTranscriptCreation,
|
||||||
onCommand,
|
onCommand,
|
||||||
onReactionRole,
|
onReactionRole,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const log = bot.errorLog.log
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
const files = fs.readdirSync("./plugins")
|
const files = fs.readdirSync("./plugins")
|
||||||
|
const api = require("./api.json")
|
||||||
var totalcount = 0
|
var totalcount = 0
|
||||||
var successcount = 0
|
var successcount = 0
|
||||||
var failcount = 0
|
var failcount = 0
|
||||||
@@ -15,12 +15,23 @@ module.exports = () => {
|
|||||||
|
|
||||||
successcount++
|
successcount++
|
||||||
totalcount++
|
totalcount++
|
||||||
}catch{
|
}catch(err){
|
||||||
|
/**@type {Error} */
|
||||||
|
const theError = err
|
||||||
|
if (api.enableAPIdebug){
|
||||||
|
try {
|
||||||
|
const data = fs.readFileSync("./apiDebug.txt")
|
||||||
|
const newData = data ? data.toString() : ""
|
||||||
|
fs.writeFileSync("./apiDebug.txt",newData+"ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
||||||
|
}catch{
|
||||||
|
fs.writeFileSync("./apiDebug.txt","ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
failcount++
|
failcount++
|
||||||
totalcount++
|
totalcount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
log("info","loaded plugins",[{key:"success",value:successcount},{key:"error",value:failcount},{key:"total",value:totalcount}])
|
require("../startscreen").headerDataPlugins({total:totalcount,success:successcount,error:failcount})
|
||||||
}
|
}
|
||||||
+191
-46
@@ -1,6 +1,17 @@
|
|||||||
exports.checker = async () => {
|
exports.checker = async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
const config = require("../config.json")
|
|
||||||
|
if (process.argv.some((v) => v == "--nochecker")) return
|
||||||
|
if (process.argv.some((v) => v == "--devconfig")){
|
||||||
|
//console.log(chalk.blue("=> used dev config instead of normal config"))
|
||||||
|
try{
|
||||||
|
var tempconfig = require("../devconfig.json")
|
||||||
|
}catch(err){console.log(err);var tempconfig = require("../config.json")}
|
||||||
|
}else{
|
||||||
|
var tempconfig = require("../config.json")
|
||||||
|
}
|
||||||
|
|
||||||
|
const config = tempconfig
|
||||||
var errorList = []
|
var errorList = []
|
||||||
var isError = false
|
var isError = false
|
||||||
var warnList = []
|
var warnList = []
|
||||||
@@ -41,9 +52,10 @@ exports.checker = async () => {
|
|||||||
}
|
}
|
||||||
/**@param {String} value */
|
/**@param {String} value */
|
||||||
const checkToken = (value) => {
|
const checkToken = (value) => {
|
||||||
if (value.includes(" ") || value.length < 40){
|
if (value.length < 40){
|
||||||
createError("'auth_token' | your token is invalid")
|
createError("'auth_token' | your token is invalid")
|
||||||
}
|
}
|
||||||
|
if (value.includes(" ")) createError("'auth_token' | your token includes spaces!")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**@param {String} value @param {String} path */
|
/**@param {String} value @param {String} path */
|
||||||
@@ -73,6 +85,9 @@ exports.checker = async () => {
|
|||||||
|
|
||||||
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
|
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
|
||||||
const checkDiscordArray = (mode,arrayValue,path) => {
|
const checkDiscordArray = (mode,arrayValue,path) => {
|
||||||
|
if (!Array.isArray(arrayValue)){
|
||||||
|
return createError("'"+path+"' | this needs to be an Array!")
|
||||||
|
}
|
||||||
if (mode == "userid"){
|
if (mode == "userid"){
|
||||||
arrayValue.forEach((value,index) => {
|
arrayValue.forEach((value,index) => {
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
@@ -99,7 +114,7 @@ exports.checker = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**@param {String} value @param {"string"|"boolean"|"number"} type */
|
/**@param {String} value @param {"string"|"boolean"|"number"|"array"|"object"} type */
|
||||||
const checkType = (value,type,path) => {
|
const checkType = (value,type,path) => {
|
||||||
if (type == "boolean"){
|
if (type == "boolean"){
|
||||||
if (typeof value != "boolean"){
|
if (typeof value != "boolean"){
|
||||||
@@ -113,6 +128,14 @@ exports.checker = async () => {
|
|||||||
if (typeof value != "string"){
|
if (typeof value != "string"){
|
||||||
createError("'"+path+"' | invalid type, this must be a string!")
|
createError("'"+path+"' | invalid type, this must be a string!")
|
||||||
}
|
}
|
||||||
|
}else if (type == "array"){
|
||||||
|
if (!Array.isArray(value)){
|
||||||
|
createError("'"+path+"' | invalid type, this must be an array!")
|
||||||
|
}
|
||||||
|
}else if (type == "object"){
|
||||||
|
if (typeof value != "object"){
|
||||||
|
createError("'"+path+"' | invalid type, this must be an object!")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,8 +145,12 @@ exports.checker = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getButtonClass = require("./utils/getButton").rawButtonData
|
const configParser = require("./utils/configParser")
|
||||||
/**@param {getButtonClass} option */
|
/**
|
||||||
|
* @param {configParser.OTAllOptions} option
|
||||||
|
* @param {String} path
|
||||||
|
*/
|
||||||
|
|
||||||
const checkOption = (option,path) => {
|
const checkOption = (option,path) => {
|
||||||
|
|
||||||
//id
|
//id
|
||||||
@@ -178,6 +205,7 @@ exports.checker = async () => {
|
|||||||
checkButtonColor(option.color,path+"/color")
|
checkButtonColor(option.color,path+"/color")
|
||||||
|
|
||||||
//adminroles
|
//adminroles
|
||||||
|
checkType(option.adminroles,"array",path+"/adminroles")
|
||||||
checkDiscordArray("roleid",option.adminroles,path+"/adminroles")
|
checkDiscordArray("roleid",option.adminroles,path+"/adminroles")
|
||||||
|
|
||||||
//channelprefix
|
//channelprefix
|
||||||
@@ -195,12 +223,39 @@ exports.checker = async () => {
|
|||||||
//message
|
//message
|
||||||
checkType(option.message,"string",path+"/message")
|
checkType(option.message,"string",path+"/message")
|
||||||
|
|
||||||
//enableDMmessage
|
//enableDmOnOpen
|
||||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
||||||
|
|
||||||
//ticketmessage
|
//ticketmessage
|
||||||
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
||||||
|
|
||||||
|
//thumbnail
|
||||||
|
if (option.thumbnail){
|
||||||
|
checkType(option.thumbnail.enable,"boolean",path+"/thumbnail/enable")
|
||||||
|
checkType(option.thumbnail.url,"string",path+"/thumbnail/url")
|
||||||
|
}else{
|
||||||
|
createError("'"+path+"/thumbnail' | there is no thumbnail object!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//image
|
||||||
|
if (option.image){
|
||||||
|
checkType(option.image.enable,"boolean",path+"/image/enable")
|
||||||
|
checkType(option.image.url,"string",path+"/image/url")
|
||||||
|
}else{
|
||||||
|
createError("'"+path+"/image' | there is no image object!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//closedCategory
|
||||||
|
if (option.closedCategory){
|
||||||
|
checkType(option.closedCategory.enable,"boolean",path/"/closedCategory/enable")
|
||||||
|
checkType(option.closedCategory.id,"string",path/"/closedCategory/id")
|
||||||
|
if (option.closedCategory.enable){
|
||||||
|
checkDiscord("roleid",option.closedCategory.id,path+"/closedCategory/id")
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
createError("'"+path+"/closedCategory' | there is no closedCategory object!")
|
||||||
|
}
|
||||||
|
|
||||||
}else if (type == "website"){
|
}else if (type == "website"){
|
||||||
//url
|
//url
|
||||||
checkType(option.url,"string",path+"/url")
|
checkType(option.url,"string",path+"/url")
|
||||||
@@ -208,13 +263,13 @@ exports.checker = async () => {
|
|||||||
createWarn("'"+path+"/url' | a url can't contain spaces")
|
createWarn("'"+path+"/url' | a url can't contain spaces")
|
||||||
}
|
}
|
||||||
if (option.url.length < 1){
|
if (option.url.length < 1){
|
||||||
createError("'"+path+"/url' | you have no url in this button")
|
createError("'"+path+"/url' | there is no url!")
|
||||||
}
|
}
|
||||||
if (!option.url.startsWith("https://") && !option.url.startsWith("http://") && !option.url.startsWith("discord://")){
|
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!")
|
createWarn("'"+path+"/url' | your url doesn't start with https or http!")
|
||||||
}
|
}
|
||||||
if (option.url.startsWith("http://")){
|
if (option.url.startsWith("http://")){
|
||||||
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord maybe blocks this url!")
|
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord can block this url!")
|
||||||
}
|
}
|
||||||
}else if (type == "role"){
|
}else if (type == "role"){
|
||||||
//color
|
//color
|
||||||
@@ -230,13 +285,106 @@ exports.checker = async () => {
|
|||||||
createError("'"+path+"/mode' | mode must be one of these: add, remove, add&remove")
|
createError("'"+path+"/mode' | mode must be one of these: add, remove, add&remove")
|
||||||
}
|
}
|
||||||
|
|
||||||
//enableDMmessage
|
//enableDmOnOpen
|
||||||
checkType(option.enableDMMessage,"boolean",path+"/enableDMMessage")
|
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {configParser.OTConfigMessage} input
|
||||||
|
* @param {String} path
|
||||||
|
*/
|
||||||
const checkMessage = (input,path) => {
|
const checkMessage = (input,path) => {
|
||||||
|
//id
|
||||||
|
if (!input.id) createError("'"+path+"/id' | this embed doesn't have an id!")
|
||||||
|
if (input.id.length > 50) createError("'"+path+"/id' | the id can't be longer than 50")
|
||||||
|
if (input.id.includes(" ") || input.id.includes("\n")) createError("'"+path+"/id' | the id can't contain spaces!")
|
||||||
|
|
||||||
|
//name
|
||||||
|
if (input.name.length < 1){
|
||||||
|
createWarn("'"+path+"/name' | this embed has no name!")
|
||||||
|
}else if (input.name.length > 99) {
|
||||||
|
createError("'"+path+"/name' | the name can't be longer than 100")
|
||||||
|
}
|
||||||
|
|
||||||
|
//description
|
||||||
|
if (input.description.length < 0){
|
||||||
|
createWarn("'"+path+"/description' | this embed doesn't have a description!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//dropdown
|
||||||
|
checkType(input.dropdown,"boolean",path+"/dropdown")
|
||||||
|
|
||||||
|
//footer
|
||||||
|
checkType(input.enableFooter,"boolean",path+"/enableFooter")
|
||||||
|
if (input.enableFooter){
|
||||||
|
if (input.footer.length < 1) createError("'"+path+"/footer' | no footer!")
|
||||||
|
if (input.footer.length > 200) createError("'"+path+"/footer' | footer length can't be more than 200!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//thumbnail
|
||||||
|
checkType(input.enableThumbnail,"boolean",path+"/enableThumbnail")
|
||||||
|
if (input.enableThumbnail){
|
||||||
|
if (input.thumbnail.length < 1) createError("'"+path+"/thumbnail' | no thumbnail url!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//customColor
|
||||||
|
checkType(input.enableCustomColor,"boolean",path+"/enableCustomColor")
|
||||||
|
if (input.enableCustomColor){
|
||||||
|
if (input.color.length < 1) createError("'"+path+"/color' | no color!")
|
||||||
|
checkHexColor(input.color,path+"/color")
|
||||||
|
}
|
||||||
|
|
||||||
|
//OPTIONS!!!
|
||||||
|
var counter = 0
|
||||||
|
input.options.forEach((option) => {if (!configParser.optionExists(option)){counter++}})
|
||||||
|
|
||||||
|
if (counter == input.options.length){
|
||||||
|
createWarn("'"+path+"/options' | insert the option ids here!")
|
||||||
|
}else{
|
||||||
|
input.options.forEach((option,index) => {
|
||||||
|
if (!configParser.optionExists(option)){
|
||||||
|
createWarn("'"+path+"/options:"+index+"' | this option doesnt exist!")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//other
|
||||||
|
//ticket explaination & max tickets warning
|
||||||
|
if (typeof input.other != "object"){
|
||||||
|
createError("'"+path+"/other' | this object doesn't exist!")
|
||||||
|
}else{
|
||||||
|
checkType(input.other.enableTicketExplaination,"boolean",path+"/other/enableTicketExplaination")
|
||||||
|
checkType(input.other.enableMaxTicketsWarning,"boolean",path+"/other/enableMaxTicketsWarning")
|
||||||
|
|
||||||
|
//customDropdownPlaceholder
|
||||||
|
if (typeof input.other.customDropdownPlaceholder != "object"){
|
||||||
|
createError("'"+path+"/other/customDropdownPlaceholder' | this object doesn't exist!")
|
||||||
|
}else{
|
||||||
|
checkType(input.other.customDropdownPlaceholder.enable,"boolean",path+"/other/customDropdownPlaceholder/enable")
|
||||||
|
checkType(input.other.customDropdownPlaceholder.text,"string",path+"/other/customDropdownPlaceholder/text")
|
||||||
|
if (input.other.customDropdownPlaceholder.enable && input.other.customDropdownPlaceholder.text.length < 1){createError("'"+path+"/other/customDropdownPlaceholder/text' | there is no placeholder text!")}
|
||||||
|
}
|
||||||
|
|
||||||
|
//customCategoryText
|
||||||
|
if (typeof input.other.customCategoryText != "object"){
|
||||||
|
createError("'"+path+"/other/customCategoryText' | this object doesn't exist!")
|
||||||
|
}else{
|
||||||
|
checkType(input.other.customCategoryText.enable,"boolean",path+"/other/customCategoryText/enable")
|
||||||
|
checkType(input.other.customCategoryText.text,"string",path+"/other/customCategoryText/text")
|
||||||
|
if (input.other.customCategoryText.enable && input.other.customCategoryText.text.length < 1){createError("'"+path+"/other/customCategoryText/text' | there is no category text!")}
|
||||||
|
}
|
||||||
|
|
||||||
|
//embedTitleURL
|
||||||
|
if (typeof input.other.embedTitleURL != "object"){
|
||||||
|
createError("'"+path+"/other/embedTitleURL' | this object doesn't exist!")
|
||||||
|
}else{
|
||||||
|
checkType(input.other.embedTitleURL.enable,"boolean",path+"/other/embedTitleURL/enable")
|
||||||
|
checkType(input.other.embedTitleURL.url,"string",path+"/other/embedTitleURL/text")
|
||||||
|
if (input.other.embedTitleURL.enable && input.other.embedTitleURL.url.length < 1){createError("'"+path+"/other/embedTitleURL/url' | there is no url!")}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------|
|
//--------------------------|
|
||||||
@@ -245,7 +393,7 @@ exports.checker = async () => {
|
|||||||
//--------------------------|
|
//--------------------------|
|
||||||
//--------------------------|
|
//--------------------------|
|
||||||
|
|
||||||
var configArray = ["main_color","server_id","auth_token","main_adminroles","prefix","languagefile","credits","status","system","options","messages"]
|
var configArray = ["main_color","server_id","auth_token","main_adminroles","prefix","languagefile","status","system","options","messages"]
|
||||||
configArray.forEach((item) => {
|
configArray.forEach((item) => {
|
||||||
if (config[item] == undefined){
|
if (config[item] == undefined){
|
||||||
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
||||||
@@ -254,54 +402,66 @@ exports.checker = async () => {
|
|||||||
|
|
||||||
checkHexColor(config.main_color,"main_color")
|
checkHexColor(config.main_color,"main_color")
|
||||||
checkDiscord("serverid",config.server_id,"server_id")
|
checkDiscord("serverid",config.server_id,"server_id")
|
||||||
checkToken(config.auth_token)
|
|
||||||
|
if (!require("./api/api.json").disable.checkerjs.token) checkToken(config.auth_token)
|
||||||
|
|
||||||
|
checkType(config.main_adminroles,"array","/main_adminroles")
|
||||||
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
||||||
checkString(config.prefix,1,15,"prefix","prefix")
|
checkString(config.prefix,1,15,"prefix","prefix")
|
||||||
//languagefile
|
//languagefile
|
||||||
checkType(config.languagefile,"string","languagefile")
|
checkType(config.languagefile,"string","languagefile")
|
||||||
const lf = config.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")){
|
|
||||||
|
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian") && !lf.startsWith("czech") && !lf.startsWith("danish") && !lf.startsWith("russian")){
|
||||||
createError("'languagefile' | invalid language, more info in the wiki")
|
createError("'languagefile' | invalid language, more info in the wiki")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkType(config.credits,"boolean","credits")
|
|
||||||
//status:
|
//status:
|
||||||
checkType(config.status.enabled,"boolean","status/enabled")
|
checkType(config.status.enabled,"boolean","status/enabled")
|
||||||
if (config.status.enabled){
|
if (config.status.enabled){
|
||||||
if (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING"){
|
if (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING"){
|
||||||
createError("'status/type' | not a valid status type!")
|
createError("'status/type' | not a valid status type! (LISTENING,WATCHING,PLAYING)")
|
||||||
}
|
}
|
||||||
if (config.status.text.length < 1 || config.status.text.length > 40){
|
if (config.status.text.length < 1){
|
||||||
createError("'status/text' | text too long or short!")
|
createError("'status/text' | there is no status text!")
|
||||||
}
|
}
|
||||||
|
if (config.status.text.length > 50) createError("'status/text' | text too long!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//system:
|
//system:
|
||||||
|
//ticket channel
|
||||||
if (config.system.ticket_channel){
|
if (config.system.ticket_channel){
|
||||||
if (config.system.ticket_channel.length < 16 || config.system.ticket_channel.length > 20 || !/^\d+$/.test(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")
|
createError("'system/ticket_channel' | this channel id is invalid")
|
||||||
}
|
}
|
||||||
}else createWarn("'"+path+"' | you have no ticket channel selected!")
|
}else createWarn("'"+path+"' | you have no ticket channel selected!")
|
||||||
|
|
||||||
|
//max tickets
|
||||||
checkType(config.system.max_allowed_tickets,"number","system/max_allowed_tickets")
|
checkType(config.system.max_allowed_tickets,"number","system/max_allowed_tickets")
|
||||||
|
|
||||||
|
//enableDMmessages
|
||||||
checkType(config.system.enable_DM_Messages,"boolean","system/enable_DM_Messages")
|
checkType(config.system.enable_DM_Messages,"boolean","system/enable_DM_Messages")
|
||||||
|
|
||||||
|
//has@everyoneaccess
|
||||||
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
||||||
|
|
||||||
|
//member_role
|
||||||
|
checkType(config.system.member_role,"string","system/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"){
|
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")
|
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
||||||
}else{
|
}else{
|
||||||
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//closemode
|
||||||
checkType(config.system.closeMode,"string","system/closeMode")
|
checkType(config.system.closeMode,"string","system/closeMode")
|
||||||
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
||||||
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
||||||
}
|
}
|
||||||
|
|
||||||
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
checkType(config.system.showSlashcmdsInHelp,"boolean","system/showSlashcmdsInHelp")
|
||||||
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
checkType(config.system.answerInEphemeralOnOpen,"boolean","system/answerInEphemeralOnOpen")
|
||||||
if (config.system.enable_transcript){
|
|
||||||
checkDiscord("channelid",config.system.transcript_channel,"system/transcript_channel")
|
|
||||||
}
|
|
||||||
|
|
||||||
//options
|
//options
|
||||||
|
|
||||||
@@ -309,29 +469,11 @@ exports.checker = async () => {
|
|||||||
checkOption(option,"options/"+index)
|
checkOption(option,"options/"+index)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//messages
|
||||||
//discord check
|
config.messages.forEach((message,index) => {
|
||||||
/**
|
checkMessage(message,"messages/"+index)
|
||||||
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
|
//the end
|
||||||
if (errorList.length > 0 || warnList.length > 0){
|
if (errorList.length > 0 || warnList.length > 0){
|
||||||
@@ -341,6 +483,9 @@ exports.checker = async () => {
|
|||||||
const splitw = w.split("'")
|
const splitw = w.split("'")
|
||||||
if (splitw.length > 1){
|
if (splitw.length > 1){
|
||||||
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
|
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
|
||||||
|
if (splitw[3]){splitstring = splitstring+chalk.yellow(splitw[3])}
|
||||||
|
if (splitw[4]){splitstring = splitstring+chalk.yellow(splitw[4])}
|
||||||
|
if (splitw[5]){splitstring = splitstring+chalk.yellow(splitw[5])}
|
||||||
}else {var splitstring = chalk.yellow(splitw[0])}
|
}else {var splitstring = chalk.yellow(splitw[0])}
|
||||||
console.log(splitstring)
|
console.log(splitstring)
|
||||||
})
|
})
|
||||||
@@ -363,4 +508,4 @@ exports.checker = async () => {
|
|||||||
console.log("=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
const fs = require("fs")
|
||||||
|
const location = "./storage/database.json"
|
||||||
|
|
||||||
|
|
||||||
|
/**@returns {[{category:String, key:String, value:String}]}*/
|
||||||
|
function getData(){
|
||||||
|
if (fs.existsSync(location)){
|
||||||
|
return JSON.parse(fs.readFileSync(location).toString())
|
||||||
|
}else{
|
||||||
|
fs.writeFileSync(location,"[]")
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**@param {[{category:String, key:String, value:String}]} data*/
|
||||||
|
function setData(data){
|
||||||
|
fs.writeFileSync(location,JSON.stringify(data,null,"\t"))
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.set = (category,key,value) => {
|
||||||
|
const currentData = getData()
|
||||||
|
const exists = currentData.find((d) => (d.category == category) && (d.key == key)) ? true : false
|
||||||
|
var newData = []
|
||||||
|
if (exists){
|
||||||
|
currentData.forEach((d,i) => {
|
||||||
|
if (d.category == category && d.key == key){
|
||||||
|
newData.push({category,key,value})
|
||||||
|
}else{
|
||||||
|
newData.push(d)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
currentData.push({category,key,value})
|
||||||
|
newData = currentData
|
||||||
|
}
|
||||||
|
|
||||||
|
setData(newData)
|
||||||
|
return exists
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} key
|
||||||
|
* @returns {String|false}
|
||||||
|
*/
|
||||||
|
exports.get = (category,key) => {
|
||||||
|
const currentData = getData()
|
||||||
|
const tempresult = currentData.find((d) => (d.category == category) && (d.key == key))
|
||||||
|
const result = tempresult ? tempresult.value : false
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} key
|
||||||
|
* @param {String} value
|
||||||
|
*/
|
||||||
|
exports.delete = (category,key) => {
|
||||||
|
const currentData = getData()
|
||||||
|
const exists = currentData.find((d) => (d.category == category) && (d.key == key)) ? true : false
|
||||||
|
var newData = []
|
||||||
|
if (exists){
|
||||||
|
currentData.forEach((d,i) => {
|
||||||
|
if (!(d.category == category && d.key == key)){
|
||||||
|
newData.push(d)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
newData = currentData
|
||||||
|
}
|
||||||
|
|
||||||
|
setData(newData)
|
||||||
|
return exists
|
||||||
|
}
|
||||||
@@ -36,4 +36,8 @@ exports.get = (category,id) => {
|
|||||||
exports.delete = (category,id) => {
|
exports.delete = (category,id) => {
|
||||||
ls.removeItem(category+"--"+id)
|
ls.removeItem(category+"--"+id)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.set("category","key","value")
|
||||||
|
this.get("category","key",)
|
||||||
|
this.delete("category","key")
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
//Do not change this without knowing what you are doing!!
|
|
||||||
const databaseFile = "local"
|
|
||||||
//Do not change this without knowing what you are doing!!
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var db = require("./dynamicfiles/local")
|
var db = require("./dynamicfiles/database")
|
||||||
}catch{
|
}catch(err){
|
||||||
|
console.log(err)
|
||||||
console.log("I couldn't find the database file! (location: ./core/dynamicdatabase/storage.js:2)")
|
console.log("I couldn't find the database file! (location: ./core/dynamicdatabase/storage.js:2)")
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-4
@@ -10,15 +10,23 @@ const loadChalk = async () => {
|
|||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
const c = discord.Colors
|
const c = discord.Colors
|
||||||
|
|
||||||
exports.noPermsMessage = new embed()
|
/**@param {discord.User} user*/
|
||||||
|
exports.noPermsMessage = (user) => {
|
||||||
|
return new embed()
|
||||||
.setColor(c.Red)
|
.setColor(c.Red)
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
.setTitle(":x: "+l.errors.noPermsTitle)
|
||||||
.setDescription(l.errors.noPermsDescription)
|
.setDescription(l.errors.noPermsDescription)
|
||||||
|
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
||||||
|
}
|
||||||
|
|
||||||
exports.noPermsDelete = new embed()
|
/**@param {discord.User} user*/
|
||||||
|
exports.noPermsDelete = (user) => {
|
||||||
|
return new embed()
|
||||||
.setColor(c.Red)
|
.setColor(c.Red)
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
.setTitle(":x: "+l.errors.noPermsTitle)
|
||||||
.setDescription(l.errors.noPermsDelete)
|
.setDescription(l.errors.noPermsDelete)
|
||||||
|
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
||||||
|
}
|
||||||
|
|
||||||
/**@param {String} message */
|
/**@param {String} message */
|
||||||
exports.invalidArgsMessage = (message) => {
|
exports.invalidArgsMessage = (message) => {
|
||||||
@@ -85,15 +93,29 @@ exports.custom = (title,message,emoji,color) => {
|
|||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.clearDebugFile = () => {
|
||||||
|
const fs = require("fs")
|
||||||
|
if (!fs.existsSync("./openticketdebug.txt")) return
|
||||||
|
const content = fs.readFileSync("./openticketdebug.txt").toString().split("\n")
|
||||||
|
if (content.length < 5000) return
|
||||||
|
for (let i = 0; i < 4000; i++) {
|
||||||
|
content.shift()
|
||||||
|
}
|
||||||
|
|
||||||
|
const newContent = "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="+content.join("\n")
|
||||||
|
fs.writeFileSync("./openticketdebug.txt",newContent)
|
||||||
|
}
|
||||||
|
|
||||||
const normalLog = (debugString) => {
|
const normalLog = (debugString) => {
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
|
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
|
||||||
|
this.clearDebugFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {"system"|"command"|"info"|"api"} type
|
* @param {"system"|"command"|"info"|"api"|"debug"} type
|
||||||
* @param {String} message
|
* @param {String} message
|
||||||
* @param {[{key:String,value:String}]} params
|
* @param {[{key:String,value:String}]} params
|
||||||
*/
|
*/
|
||||||
@@ -117,10 +139,13 @@ exports.log = async (type,message,params) => {
|
|||||||
}else if (ptype == "system"){
|
}else if (ptype == "system"){
|
||||||
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
||||||
}else if (ptype == "api"){
|
}else if (ptype == "api"){
|
||||||
if (require("./api/modules/base").enableApiLogs == true){
|
if (require("./api/api.json").enableAPIconsolelogs == true){
|
||||||
console.log(chalk.red("[api v"+require("./api/api.json").version+"] ")+message+" "+chalk.yellow(parameters))
|
console.log(chalk.red("[api v"+require("./api/api.json").version+"] ")+message+" "+chalk.yellow(parameters))
|
||||||
}
|
}
|
||||||
ptype = "api v"+require("./api/api.json").version
|
ptype = "api v"+require("./api/api.json").version
|
||||||
|
}else if (ptype == "debug"){
|
||||||
|
if (!process.argv.some((v) => v == "--debug")) return
|
||||||
|
console.log(chalk.redBright("[DEBUG] ")+message+" "+chalk.yellow(parameters))
|
||||||
}
|
}
|
||||||
|
|
||||||
const cd = new Date()
|
const cd = new Date()
|
||||||
|
|||||||
@@ -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 = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
const mc = config.main_color
|
const mc = config.main_color
|
||||||
@@ -26,16 +25,26 @@ exports.closeCommandRow = new arb()
|
|||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new button()
|
new button()
|
||||||
.setCustomId("OTsendTranscript")
|
.setCustomId("OTreopenTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setStyle(bs.Secondary)
|
.setStyle(bs.Success)
|
||||||
.setLabel(l.buttons.sendTranscript)
|
.setLabel(l.buttons.reopen)
|
||||||
.setEmoji("📄")
|
.setEmoji("✔")
|
||||||
|
)
|
||||||
|
|
||||||
|
exports.closeCommandRowDisabled = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicket1")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle(bs.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new button()
|
new button()
|
||||||
.setCustomId("OTreopenTicket")
|
.setCustomId("OTreopenTicket")
|
||||||
.setDisabled(false)
|
.setDisabled(true)
|
||||||
.setStyle(bs.Success)
|
.setStyle(bs.Success)
|
||||||
.setLabel(l.buttons.reopen)
|
.setLabel(l.buttons.reopen)
|
||||||
.setEmoji("✔")
|
.setEmoji("✔")
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
const mc = config.main_color
|
const mc = config.main_color
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
const mc = config.main_color
|
const mc = config.main_color
|
||||||
@@ -15,6 +15,14 @@ const arb = discord.ActionRowBuilder
|
|||||||
const bs = discord.ButtonStyle
|
const bs = discord.ButtonStyle
|
||||||
|
|
||||||
exports.closeVerifyBar = new arb()
|
exports.closeVerifyBar = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicketReason")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Primary)
|
||||||
|
.setEmoji("💬")
|
||||||
|
.setLabel(l.buttons.closeWithReason)
|
||||||
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new button()
|
new button()
|
||||||
.setCustomId("OTcloseTicketTrue")
|
.setCustomId("OTcloseTicketTrue")
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
const mc = config.main_color
|
const mc = config.main_color
|
||||||
@@ -13,37 +12,45 @@ const mc = config.main_color
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.User} addedUser
|
* @param {discord.User} addedUser
|
||||||
|
* @param {discord.User} adder
|
||||||
* @returns {discord.EmbedBuilder}
|
* @returns {discord.EmbedBuilder}
|
||||||
*/
|
*/
|
||||||
exports.addEmbed = (addedUser) => {
|
exports.addEmbed = (addedUser,adder) => {
|
||||||
return new embed()
|
return new embed()
|
||||||
.setTitle("⬆️ "+l.commands.userAddedTitle.replace("{0}",addedUser.username))
|
.setTitle("⬆️ "+l.commands.userAddedTitle.replace("{0}",addedUser.username))
|
||||||
.setColor(mc)
|
.setColor(mc)
|
||||||
.setFooter({text:addedUser.tag,iconURL:addedUser.displayAvatarURL()})
|
.setFooter({text:adder.tag,iconURL:adder.displayAvatarURL()})
|
||||||
|
.setThumbnail(addedUser.displayAvatarURL({extension:"png"}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.User} removedUser
|
* @param {discord.User} removedUser
|
||||||
|
* @param {discord.User} remover
|
||||||
* @returns {discord.EmbedBuilder}
|
* @returns {discord.EmbedBuilder}
|
||||||
*/
|
*/
|
||||||
exports.removeEmbed = (removedUser) => {
|
exports.removeEmbed = (removedUser,remover) => {
|
||||||
return new embed()
|
return new embed()
|
||||||
.setTitle("⬇️ "+l.commands.userRemovedTitle.replace("{0}",removedUser.username))
|
.setTitle("⬇️ "+l.commands.userRemovedTitle.replace("{0}",removedUser.username))
|
||||||
.setColor(mc)
|
.setColor(mc)
|
||||||
.setFooter({text:removedUser.tag,iconURL:removedUser.displayAvatarURL()})
|
.setFooter({text:remover.tag,iconURL:remover.displayAvatarURL()})
|
||||||
|
.setThumbnail(removedUser.displayAvatarURL({extension:"png"}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.User} closer
|
* @param {discord.User} closer
|
||||||
|
* @param {String} description
|
||||||
* @returns {discord.EmbedBuilder}
|
* @returns {discord.EmbedBuilder}
|
||||||
*/
|
*/
|
||||||
exports.closeEmbed = (closer) => {
|
exports.closeEmbed = (closer,description) => {
|
||||||
return new embed()
|
const embd = new embed()
|
||||||
.setTitle("🔒 "+l.commands.closeTitle)
|
.setTitle("🔒 "+l.commands.closeTitle)
|
||||||
.setColor(mc)
|
.setColor(mc)
|
||||||
.setFooter({text:closer.tag,iconURL:closer.displayAvatarURL()})
|
.setFooter({text:closer.tag,iconURL:closer.displayAvatarURL()})
|
||||||
|
|
||||||
|
if (description) embd.setDescription(description)
|
||||||
|
return embd
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,23 +92,38 @@ exports.renameEmbed = (renamer,newname) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Boolean} done
|
* @param {discord.User} claimer
|
||||||
* @param {discord.TextChannel} channel
|
* @param {discord.User} user
|
||||||
* @param {discord.User} author
|
|
||||||
* @returns {discord.EmbedBuilder}
|
* @returns {discord.EmbedBuilder}
|
||||||
*/
|
*/
|
||||||
exports.sendTranscriptEmbed = (done,channel,author) => {
|
exports.claimEmbed = (claimer,user) => {
|
||||||
if (done){
|
return new embed()
|
||||||
return new embed()
|
.setTitle("📌 "+l.commands.claimTitle.replace("{0}",claimer.username))
|
||||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
.setColor(mc)
|
||||||
.setColor(mc)
|
.setFooter({text:user.tag,iconURL:user.displayAvatarURL()})
|
||||||
.setDescription("Ticket: "+channel.name)
|
}
|
||||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
|
||||||
}else{
|
/**
|
||||||
return new embed()
|
*
|
||||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
* @param {discord.User} unclaimer
|
||||||
.setColor(mc)
|
* @returns {discord.EmbedBuilder}
|
||||||
.setDescription("Loading...")
|
*/
|
||||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
exports.unclaimEmbed = (unclaimer) => {
|
||||||
}
|
return new embed()
|
||||||
|
.setTitle("🆓 "+l.commands.unclaimTitle)
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:unclaimer.tag,iconURL:unclaimer.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} changer
|
||||||
|
* @param {String} newtype
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.changeEmbed = (changer,newtype) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("🔄 "+l.commands.changeTitle.replace("{0}",newtype))
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:changer.tag,iconURL:changer.displayAvatarURL()})
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../../getoptions")
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
@@ -23,7 +22,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTcloseTicketTrue") return
|
if (interaction.customId != "OTcloseTicketTrue") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
|
|
||||||
if (closeTicketButtonChecker == true) return
|
if (closeTicketButtonChecker == true) return
|
||||||
closeTicketButtonChecker = true
|
closeTicketButtonChecker = true
|
||||||
@@ -33,7 +34,7 @@ module.exports = () => {
|
|||||||
if (config.system.closeMode == "adminonly"){
|
if (config.system.closeMode == "adminonly"){
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
||||||
permissionChecker.sendChannelNoPerms(interaction.channel)
|
permissionChecker.sendChannelNoPerms(interaction.channel,interaction.user)
|
||||||
}
|
}
|
||||||
interaction.message.edit({components:[firstcomponents]})
|
interaction.message.edit({components:[firstcomponents]})
|
||||||
closeTicketButtonChecker = false
|
closeTicketButtonChecker = false
|
||||||
@@ -56,7 +57,7 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
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)
|
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
||||||
closeTicketButtonChecker = false
|
closeTicketButtonChecker = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
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 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
|
||||||
|
|
||||||
|
const modal = discord.ModalBuilder
|
||||||
|
const tis = discord.TextInputStyle
|
||||||
|
const tib = discord.TextInputBuilder
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
//theModal
|
||||||
|
const reasonModal = new modal()
|
||||||
|
.setTitle(l.buttons.closeWithReason)
|
||||||
|
.setCustomId("OTCloseReasonModal")
|
||||||
|
|
||||||
|
const reasonInput = new arb()
|
||||||
|
.addComponents([
|
||||||
|
new tib()
|
||||||
|
.setCustomId('OTreasonInput')
|
||||||
|
.setLabel(l.messages.modalreason)
|
||||||
|
.setStyle(tis.Short)
|
||||||
|
.setMaxLength(100)
|
||||||
|
.setRequired(true)
|
||||||
|
.setValue("")
|
||||||
|
.setPlaceholder("reason")
|
||||||
|
])
|
||||||
|
|
||||||
|
reasonModal.addComponents(reasonInput)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//CLOSE WITH REASON
|
||||||
|
var closeTicketButtonChecker = false
|
||||||
|
|
||||||
|
client.on("interactionCreate",async interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTcloseTicketReason") return
|
||||||
|
|
||||||
|
if (closeTicketButtonChecker == true) return interaction.deferUpdate()
|
||||||
|
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.user)
|
||||||
|
}
|
||||||
|
interaction.message.edit({components:[firstcomponents]})
|
||||||
|
closeTicketButtonChecker = false
|
||||||
|
return interaction.deferUpdate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||||
|
await interaction.showModal(reasonModal)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
client.on("interactionCreate",async (interaction) => {
|
||||||
|
if (interaction.type != discord.InteractionType.ModalSubmit) return
|
||||||
|
if (interaction.customId != "OTCloseReasonModal") return
|
||||||
|
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
||||||
|
|
||||||
|
const reason = interaction.fields.getTextInputValue("OTreasonInput")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",reason,true)
|
||||||
|
closeTicketButtonChecker = false
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../../getoptions")
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
@@ -32,7 +31,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
||||||
permissionChecker.sendChannelNoDelete(interaction.channel)
|
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
||||||
}
|
}
|
||||||
await interaction.message.edit({components:[firstcomponents]})
|
await interaction.message.edit({components:[firstcomponents]})
|
||||||
deleteTicketButtonChecker = false
|
deleteTicketButtonChecker = false
|
||||||
@@ -51,9 +50,9 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
await interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
await interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||||
await require("../../../ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
await interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||||
|
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||||
deleteTicketButtonChecker = false
|
deleteTicketButtonChecker = false
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -70,10 +69,9 @@ module.exports = () => {
|
|||||||
|
|
||||||
const firstcomponents = bot.buttons.close.closeCommandRow
|
const firstcomponents = bot.buttons.close.closeCommandRow
|
||||||
|
|
||||||
console.log("closed with NO TRANSCRIPT")
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
||||||
permissionChecker.sendChannelNoDelete(interaction.channel)
|
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
||||||
}
|
}
|
||||||
await interaction.message.edit({components:[firstcomponents]})
|
await interaction.message.edit({components:[firstcomponents]})
|
||||||
deleteTicketButtonChecker1 = false
|
deleteTicketButtonChecker1 = false
|
||||||
@@ -92,8 +90,10 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
await interaction.message.edit({components:[bot.buttons.close.closeCommandRowDisabled]})
|
||||||
await require("../../../ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"deletenotranscript",false,true)
|
await interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||||
|
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||||
deleteTicketButtonChecker1 = false
|
deleteTicketButtonChecker1 = false
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../../getoptions")
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
const permissionChecker = require("../../../utils/permisssionChecker")
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
@@ -24,6 +23,6 @@ module.exports = () => {
|
|||||||
|
|
||||||
interaction.deferUpdate()
|
interaction.deferUpdate()
|
||||||
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
||||||
require("../../../ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
require("../../../ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
require("./firstmsg")()
|
require("./firstmsg")()
|
||||||
require("./sendTranscript")()
|
|
||||||
require("./verifyBars")()
|
require("./verifyBars")()
|
||||||
|
|
||||||
//accepted
|
//accepted
|
||||||
require("./accepted/closing")()
|
require("./accepted/closing")()
|
||||||
require("./accepted/reopening")()
|
require("./accepted/reopening")()
|
||||||
require("./accepted/deleting")()
|
require("./accepted/deleting")()
|
||||||
|
require("./accepted/closingReason")()
|
||||||
}
|
}
|
||||||
@@ -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{}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,6 @@ const config = bot.config
|
|||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("../../getoptions")
|
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
const hiddendata = bot.hiddenData
|
const hiddendata = bot.hiddenData
|
||||||
const embed = discord.EmbedBuilder
|
const embed = discord.EmbedBuilder
|
||||||
@@ -21,7 +20,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTcloseTicket") return
|
if (interaction.customId != "OTcloseTicket") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -29,7 +30,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTcloseTicketFalse") return
|
if (interaction.customId != "OTcloseTicketFalse") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -38,7 +41,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicket") return
|
if (interaction.customId != "OTdeleteTicket") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -46,7 +51,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicketFalse") return
|
if (interaction.customId != "OTdeleteTicketFalse") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -55,7 +62,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicket1") return
|
if (interaction.customId != "OTdeleteTicket1") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -63,7 +72,9 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicketFalse1") return
|
if (interaction.customId != "OTdeleteTicketFalse1") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
+7
-12
@@ -1,30 +1,25 @@
|
|||||||
const index = require("../index")
|
const index = require("../index")
|
||||||
|
|
||||||
if (index.developerMode){
|
if (index.developerConfig){
|
||||||
var config = require("../devConfig.json")
|
var config = require("../devconfig.json")
|
||||||
}else{var config = require("../config.json")}
|
}else{var config = require("../config.json")}
|
||||||
|
|
||||||
|
|
||||||
var localLanguage = require("../language/english.json")
|
var localLanguage = require("../language/english.json")
|
||||||
if (config.languagefile.startsWith("custom")) localLanguage = require("../language/custom.json")
|
const fs = require("fs")
|
||||||
else if (config.languagefile.startsWith("dutch")) localLanguage = require("../language/dutch.json")
|
const lfexists = fs.existsSync("./language/"+config.languagefile+".json")
|
||||||
else if (config.languagefile.startsWith("english")) localLanguage = require("../language/english.json")
|
if (lfexists) localLanguage = require("../language/"+config.languagefile+".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 errorLog = async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
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!")
|
require("./startscreen").headerDataLanguage("Something went wrong when loading the language!",true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const successLog = async (language) => {
|
const successLog = async (language) => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
console.log(chalk.green("loaded language "+language+"..."))
|
require("./startscreen").headerDataLanguage("sucessfully loaded language "+language,false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localLanguage){
|
if (!localLanguage){
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
██████╗ ██████╗ ███████╗███╗ ██╗ ████████╗██╗ ██████╗██╗ ██╗███████╗████████╗
|
||||||
|
██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ╚══██╔══╝██║██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝
|
||||||
|
██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║██║ █████╔╝ █████╗ ██║
|
||||||
|
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██║
|
||||||
|
╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ██║╚██████╗██║ ██╗███████╗ ██║
|
||||||
|
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝
|
||||||
+56
-49
@@ -12,64 +12,71 @@ module.exports = async () => {
|
|||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",(interaction) => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton() && !interaction.isStringSelectMenu()) return
|
||||||
if (!interaction.customId.startsWith("newR")) return
|
if (interaction.isButton() && !interaction.customId.startsWith("newR")) return
|
||||||
|
if (interaction.isStringSelectMenu() && !(interaction.customId == "OTdropdownMenu")) 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)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const optionidRaw = interaction.isStringSelectMenu() ? interaction.values[0] : interaction.customId
|
||||||
|
if (!optionidRaw.includes("newR")) return
|
||||||
|
const optionid = optionidRaw.split("newR")[1]
|
||||||
|
if (!optionid){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.roleDoesntExist)]})
|
||||||
|
return
|
||||||
|
}else{
|
||||||
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
|
}
|
||||||
|
|
||||||
|
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.add(role)
|
||||||
|
|
||||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value: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)
|
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||||
APIEvents.onReactionRole("add","add",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
APIEvents.onReactionRole("add","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
})
|
}else {
|
||||||
|
|
||||||
}else if (mode == "remove"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(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}])
|
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)
|
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||||
APIEvents.onReactionRole("remove","remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
APIEvents.onReactionRole("remove","add&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)]})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}catch{
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrong)]})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
const discord = require("discord.js")
|
||||||
|
const bot = require("../../index")
|
||||||
|
const client = require("../../index").client
|
||||||
|
const config = bot.config
|
||||||
|
const configParser = require("../utils/configParser")
|
||||||
|
|
||||||
|
const act = discord.ApplicationCommandType
|
||||||
|
const acot = discord.ApplicationCommandOptionType
|
||||||
|
|
||||||
|
module.exports = async () => {
|
||||||
|
const sid = config.server_id
|
||||||
|
|
||||||
|
const ids = configParser.getTicketValuesArray("id")
|
||||||
|
/**@type {[{name:String,value:String}]} */
|
||||||
|
var choices = []
|
||||||
|
ids.forEach((id) => {
|
||||||
|
const option = configParser.getTicketById(id)
|
||||||
|
if (option){
|
||||||
|
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})
|
||||||
|
})
|
||||||
|
|
||||||
|
//slashtranslation
|
||||||
|
const ST = require("../../language/slashcmds/slash.json").data
|
||||||
|
|
||||||
|
//create a ticket (/new or /ticket)
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"ticket",
|
||||||
|
description:"Create a ticket!",
|
||||||
|
descriptionLocalizations:ST.newticket,
|
||||||
|
defaultPermission:true,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.String,
|
||||||
|
name:"type",
|
||||||
|
description:"The type of ticket.",
|
||||||
|
required:true,
|
||||||
|
choices:choices
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid)
|
||||||
|
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"new",
|
||||||
|
description:"Create a ticket!",
|
||||||
|
defaultPermission:true,
|
||||||
|
type:act.ChatInput,
|
||||||
|
descriptionLocalizations:ST.newticket,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.String,
|
||||||
|
name:"type",
|
||||||
|
description:"The type of ticket.",
|
||||||
|
required:true,
|
||||||
|
choices:choices
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid)
|
||||||
|
|
||||||
|
//msg
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"message",
|
||||||
|
description:"Create a ticket message.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.message,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.String,
|
||||||
|
name:"id",
|
||||||
|
description:"The message id.",
|
||||||
|
required:true,
|
||||||
|
choices:msgchoices,
|
||||||
|
max_length:30
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid)
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ const discord = require("discord.js")
|
|||||||
const bot = require("../../index")
|
const bot = require("../../index")
|
||||||
const client = require("../../index").client
|
const client = require("../../index").client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getoptions = require("../getoptions")
|
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
const chalk = (await import("chalk")).default
|
const chalk = (await import("chalk")).default
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const discord = require("discord.js")
|
|||||||
const bot = require("../../index")
|
const bot = require("../../index")
|
||||||
const client = require("../../index").client
|
const client = require("../../index").client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getoptions = require("../getoptions")
|
const configParser = require("../utils/configParser")
|
||||||
|
|
||||||
const act = discord.ApplicationCommandType
|
const act = discord.ApplicationCommandType
|
||||||
const acot = discord.ApplicationCommandOptionType
|
const acot = discord.ApplicationCommandOptionType
|
||||||
@@ -11,12 +11,12 @@ module.exports = async () => {
|
|||||||
const chalk = (await import("chalk")).default
|
const chalk = (await import("chalk")).default
|
||||||
const sid = config.server_id
|
const sid = config.server_id
|
||||||
|
|
||||||
const ids = getoptions.getTicketValues("id")
|
const ids = configParser.getTicketValuesArray("id")
|
||||||
/**@type {[{name:String,value:String}]} */
|
/**@type {[{name:String,value:String}]} */
|
||||||
var choices = []
|
var choices = []
|
||||||
ids.forEach((id) => {
|
ids.forEach((id) => {
|
||||||
const option = getoptions.getOptionsById(id)
|
const option = configParser.getTicketById(id)
|
||||||
if (option.type == "ticket"){
|
if (option){
|
||||||
choices.push({name:option.name,value:option.id})
|
choices.push({name:option.name,value:option.id})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -32,18 +32,24 @@ module.exports = async () => {
|
|||||||
//process.stdout.write("[status] there are "+chalk.blue("0 out of 10")+" commands ready! (this can take up to 40 seconds)")
|
//process.stdout.write("[status] there are "+chalk.blue("0 out of 10")+" commands ready! (this can take up to 40 seconds)")
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
process.stdout.cursorTo(0)
|
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)")
|
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 13")+" commands ready! (this can take up to 40 seconds)")
|
||||||
if (readystats >= 10){
|
if (readystats >= 13){
|
||||||
|
const fs = require("fs")
|
||||||
|
fs.writeFileSync("./storage/slashcmdEnabled.txt","true")
|
||||||
console.log(chalk.green("\nready!"))
|
console.log(chalk.green("\nready!"))
|
||||||
console.log(chalk.bgBlue("you can now start the bot with 'npm start'!"))
|
console.log(chalk.blue("you can now start the bot with "+chalk.bgBlue("'npm start'")+"!"))
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
},100)
|
},100)
|
||||||
|
|
||||||
|
//slashtranslation
|
||||||
|
const ST = require("../../language/slashcmds/slash.json").data
|
||||||
|
|
||||||
//create a ticket (/new or /ticket)
|
//create a ticket (/new or /ticket)
|
||||||
client.application.commands.create({
|
client.application.commands.create({
|
||||||
name:"ticket",
|
name:"ticket",
|
||||||
description:"Create a ticket!",
|
description:"Create a ticket!",
|
||||||
|
descriptionLocalizations:ST.newticket,
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:act.ChatInput,
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
@@ -53,7 +59,6 @@ module.exports = async () => {
|
|||||||
description:"The type of ticket.",
|
description:"The type of ticket.",
|
||||||
required:true,
|
required:true,
|
||||||
choices:choices
|
choices:choices
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
@@ -65,6 +70,7 @@ module.exports = async () => {
|
|||||||
description:"Create a ticket!",
|
description:"Create a ticket!",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:act.ChatInput,
|
type:act.ChatInput,
|
||||||
|
descriptionLocalizations:ST.newticket,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
type:acot.String,
|
type:acot.String,
|
||||||
@@ -82,8 +88,9 @@ module.exports = async () => {
|
|||||||
//help
|
//help
|
||||||
client.application.commands.create({
|
client.application.commands.create({
|
||||||
name:"help",
|
name:"help",
|
||||||
description:"The help menu",
|
description:"View the available commands.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.help,
|
||||||
type:act.ChatInput
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
@@ -95,7 +102,15 @@ module.exports = async () => {
|
|||||||
name:"close",
|
name:"close",
|
||||||
description:"Close the current ticket.",
|
description:"Close the current ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
type:act.ChatInput
|
descriptionLocalizations:ST.close,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[{
|
||||||
|
name:"reason",
|
||||||
|
type:discord.ApplicationCommandOptionType.String,
|
||||||
|
required:false,
|
||||||
|
description:"The reason to close this ticket.",
|
||||||
|
maxLength:100
|
||||||
|
}]
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
})
|
})
|
||||||
@@ -105,6 +120,7 @@ module.exports = async () => {
|
|||||||
name:"delete",
|
name:"delete",
|
||||||
description:"Delete the current ticket.",
|
description:"Delete the current ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.delete,
|
||||||
type:act.ChatInput
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
@@ -115,6 +131,7 @@ module.exports = async () => {
|
|||||||
name:"message",
|
name:"message",
|
||||||
description:"Create a ticket message.",
|
description:"Create a ticket message.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.message,
|
||||||
type:act.ChatInput,
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
@@ -136,6 +153,7 @@ module.exports = async () => {
|
|||||||
name:"add",
|
name:"add",
|
||||||
description:"Add people to this ticket.",
|
description:"Add people to this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.add,
|
||||||
type:act.ChatInput,
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
@@ -154,6 +172,7 @@ module.exports = async () => {
|
|||||||
name:"remove",
|
name:"remove",
|
||||||
description:"Remove people from this ticket.",
|
description:"Remove people from this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.remove,
|
||||||
type:act.ChatInput,
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
@@ -172,6 +191,7 @@ module.exports = async () => {
|
|||||||
name:"rename",
|
name:"rename",
|
||||||
description:"Rename this ticket.",
|
description:"Rename this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.rename,
|
||||||
type:act.ChatInput,
|
type:act.ChatInput,
|
||||||
options:[
|
options:[
|
||||||
{
|
{
|
||||||
@@ -190,9 +210,58 @@ module.exports = async () => {
|
|||||||
name:"reopen",
|
name:"reopen",
|
||||||
description:"Reopen this ticket.",
|
description:"Reopen this ticket.",
|
||||||
defaultPermission:true,
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.reopen,
|
||||||
type:act.ChatInput
|
type:act.ChatInput
|
||||||
},sid).then(() => {
|
},sid).then(() => {
|
||||||
readystats++
|
readystats++
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//claim
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"claim",
|
||||||
|
description:"Claim this ticket / claim it for someone else.",
|
||||||
|
defaultPermission:true,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
name:"user",
|
||||||
|
type:acot.User,
|
||||||
|
required:false,
|
||||||
|
description:"The user to claim for."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//unclaim
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"unclaim",
|
||||||
|
description:"Unclaim this ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
type:act.ChatInput
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//category
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"change",
|
||||||
|
description:"Change ticket type.",
|
||||||
|
defaultPermission:true,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.String,
|
||||||
|
name:"type",
|
||||||
|
description:"The new ticket type.",
|
||||||
|
required:true,
|
||||||
|
choices:choices
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
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 logo = require("fs").readFileSync("./core/logo.txt").toString()
|
||||||
|
|
||||||
|
/**@param {import('chalk').ChalkInstance} chalk */
|
||||||
|
const showFlags = async (chalk) => {
|
||||||
|
var isFlag = false
|
||||||
|
if (process.argv.some((v) => v == "--devconfig")) console.log(chalk.blue("[FLAGS] => used dev config instead of normal config")); isFlag = true
|
||||||
|
if (process.argv.some((v) => v == "--nochecker")) console.log(chalk.blue("[FLAGS] => disabled checker.js")); isFlag = true
|
||||||
|
if (process.argv.some((v) => v == "--tsoffline")) console.log(chalk.blue("[FLAGS] => offline check for html transcripts disabled!")); isFlag = true
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log(chalk.blue("[FLAGS] => enabled DEBUG mode")); isFlag = true
|
||||||
|
|
||||||
|
if (!isFlag) console.log(chalk.blue("no flags!"))
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.run = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
console.log(chalk.hex("f8ba00")(logo))
|
||||||
|
const version = require("../package.json").version
|
||||||
|
var headertext = "v"+version+" - Support: https://discord.dj-dj.be - Language: "+config.languagefile
|
||||||
|
const spaceamount = (84-headertext.length)/2
|
||||||
|
var i = 0
|
||||||
|
while (i < spaceamount){
|
||||||
|
headertext = " "+headertext
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
console.log(chalk.bold(headertext+"\n"))
|
||||||
|
console.log(chalk.bold(chalk.underline("FLAGS:")))
|
||||||
|
showFlags(chalk)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {import('chalk').ChalkInstance} chalk
|
||||||
|
* @param {{type:String,text:String,enabled:Boolean}} status
|
||||||
|
* @param {Boolean} updatingslash
|
||||||
|
* @param {Boolean} slashmode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
exports.headerDataReady = (chalk,status,updatingslash,slashmode) => {
|
||||||
|
console.log("\n"+chalk.bold(chalk.underline("STARTUP INFO:")))
|
||||||
|
if (status.enabled) console.log(chalk.hex("f8ba00")("status: ")+chalk.bold(status.type.toLowerCase())+" "+status.text)
|
||||||
|
if (slashmode){
|
||||||
|
console.log("\n\n"+chalk.red(chalk.underline("STARTING IN SLASH CMD CONFIGURATION MODE!")))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(chalk.hex("f8ba00")("updating slash cmds: ")+chalk.bold(slashmode))
|
||||||
|
}
|
||||||
|
|
||||||
|
var languageMSG = ""
|
||||||
|
var languageErr = false
|
||||||
|
/**
|
||||||
|
* @param {String} message
|
||||||
|
* @param {Boolean} err
|
||||||
|
*/
|
||||||
|
exports.headerDataLanguage = async (message,err) => {
|
||||||
|
languageMSG = message
|
||||||
|
languageErr = err
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{total:Number,error:Number,success:Number}} plugins
|
||||||
|
*/
|
||||||
|
exports.headerDataPlugins = async (plugins) => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
const lmsg = languageErr ? chalk.red(languageMSG) : languageMSG
|
||||||
|
console.log(chalk.hex("f8ba00")("language: ")+lmsg)
|
||||||
|
console.log(chalk.hex("f8ba00")("plugins loaded: ")+chalk.bold(plugins.total+" total ")+"("+plugins.success+"✅ "+plugins.error+"❌)")
|
||||||
|
|
||||||
|
console.log("\n"+chalk.bold(chalk.underline("LOGS:")))
|
||||||
|
}
|
||||||
@@ -1,36 +1,13 @@
|
|||||||
const discord = require('discord.js')
|
const discord = require('discord.js')
|
||||||
const bot = require('../index')
|
const bot = require('../../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
const l = bot.language
|
const l = bot.language
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
const permsChecker = require("./utils/permisssionChecker")
|
const permsChecker = require("../utils/permisssionChecker")
|
||||||
|
|
||||||
exports.runThis = () => {
|
const pendingDelete = []
|
||||||
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]})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -45,14 +22,13 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
|
|||||||
const guild = channel.guild
|
const guild = channel.guild
|
||||||
const user = member.user
|
const user = member.user
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
const channelmessages = await channel.messages.fetch()
|
|
||||||
|
|
||||||
const newReason = reason ? reason : "none"
|
const newReason = reason ? reason : l.messages.none
|
||||||
|
|
||||||
//start code
|
//start code
|
||||||
|
|
||||||
//remove ot bot from transcript
|
//FIX CHANNEL COULD BE CLOSED AFTER DELETE:
|
||||||
channelmessages.sweep((msgSweep) => {return msgSweep.author.id == client.user.id})
|
if (pendingDelete.includes(channel.id)) return false
|
||||||
|
|
||||||
/**@type {String}*/
|
/**@type {String}*/
|
||||||
const channelname = channel.name
|
const channelname = channel.name
|
||||||
@@ -73,7 +49,7 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
|
|||||||
var enableTranscript = true
|
var enableTranscript = true
|
||||||
var deleteRequired = false
|
var deleteRequired = false
|
||||||
|
|
||||||
if (mode == "delete"){
|
if (mode == "delete" || mode == "deletenotranscript"){
|
||||||
//delete
|
//delete
|
||||||
//check perms
|
//check perms
|
||||||
if (!guild) return
|
if (!guild) return
|
||||||
@@ -88,29 +64,30 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
|
|||||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||||
}
|
}
|
||||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||||
|
pendingDelete.push(channel.id)
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||||
|
|
||||||
//getID & send DM & send api event
|
//getID & send DM & send api event
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
await channel.messages.fetchPinned().then(async msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value.value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value.value
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||||
|
|
||||||
require("./api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
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
|
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||||
|
|
||||||
|
const sphd = bot.hiddenData.removeHiddenData(firstmsg.embeds[0].description)
|
||||||
|
sphd.hiddenData.data.push({key:"pendingdelete",value:"true"})
|
||||||
|
const newEmbed = new discord.EmbedBuilder(firstmsg.embeds[0].data)
|
||||||
|
newEmbed.setDescription(sphd.description + bot.hiddenData.writeHiddenData(sphd.hiddenData.type,sphd.hiddenData.data))
|
||||||
|
await firstmsg.edit({embeds:[newEmbed]})
|
||||||
|
|
||||||
if (!id) return false
|
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"){
|
}else if (mode == "close"){
|
||||||
@@ -157,16 +134,37 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//ticketinfo error
|
||||||
|
const ticketInfoError = bot.errorLog.serverError("Unable to detect ticket information.\n*(First message that this bot sends)*\n\n__**Possible reasons:**__\n- you unpinned the first message\n- the first message is deleted\n- it has been unpinned & repinned after another message has been pinned.\n\n__**Possible solutions:**__\n- unpin all messages in this channel & repin the first message that this bot sent.\nIf this doesn't work, just delete the ticket manually!")
|
||||||
|
|
||||||
//add ticket adminroles
|
//add ticket adminroles
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
await channel.messages.fetchPinned().then(msglist => {
|
||||||
var firstmsg = msglist.last()
|
var firstmsg = msglist.last()
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||||
|
var firstmsg = msglist.find((m => m.author.id == client.user.id))
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id){
|
||||||
|
return channel.send({embeds:[ticketInfoError]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (firstmsg.embeds.length < 1 || !firstmsg.embeds[0].description.includes("OTDATA")) return channel.send({embeds:[ticketInfoError]})
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||||
|
|
||||||
if (!ticketData) return
|
if (!ticketData) return
|
||||||
|
|
||||||
|
if (ticketData.closedCategory.enable){
|
||||||
|
/**@type {discord.CategoryChannel} */
|
||||||
|
const category = guild.channels.cache.find(c => c.id == ticketData.closedCategory.id && c.type == discord.ChannelType.GuildCategory)
|
||||||
|
try {
|
||||||
|
channel.setParent(category)
|
||||||
|
}catch{
|
||||||
|
bot.errorLog.log("system","failed to move channel to new category!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {String[]}
|
* @type {String[]}
|
||||||
*/
|
*/
|
||||||
@@ -203,14 +201,6 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
|
|||||||
.setLabel(l.buttons.delete)
|
.setLabel(l.buttons.delete)
|
||||||
.setEmoji("✖️")
|
.setEmoji("✖️")
|
||||||
)
|
)
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTsendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new discord.ButtonBuilder()
|
new discord.ButtonBuilder()
|
||||||
.setCustomId("OTreopenTicket")
|
.setCustomId("OTreopenTicket")
|
||||||
@@ -236,111 +226,59 @@ exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) =>
|
|||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||||
|
|
||||||
require("./api/modules/events").onTicketClose(user,channel,guild,new Date(),{name:channel.name,status:"closed",ticketOptions:ticketData},newReason)
|
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
|
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||||
|
|
||||||
if (!id) return false
|
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
|
* @param {discord.TextChannel} channel
|
||||||
if (!nomessage){
|
* @param {Number} limit
|
||||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
* @returns
|
||||||
}
|
*/
|
||||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
const getmessages = async (channel,limit) => {
|
||||||
|
const final = []
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
var lastId = ""
|
||||||
|
|
||||||
//getID & send DM & send api event
|
while (true) {
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
const options = {limit:100}
|
||||||
var firstmsg = msglist.last()
|
if (lastId) options.before = lastId
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
const messages = await channel.messages.fetch(options)
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
messages.forEach(msg => {final.push(msg)})
|
||||||
const ticketData = require("./getoptions").getOptionsById("OTnewT"+ticketId)
|
lastId = messages.last().id
|
||||||
|
|
||||||
require("./api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
if (messages.size != 100 || final >= limit) {
|
||||||
|
break
|
||||||
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")}
|
}
|
||||||
})
|
return final
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (enableTranscript == true && mode != "deletenotranscript"){
|
const transcriptHandler = async () => {
|
||||||
|
if (!bot.tsconfig.sendTranscripts.enableChannel && !bot.tsconfig.sendTranscripts.enableDM) return false
|
||||||
|
|
||||||
const transcriptReason = (mode == "close") ? "**reason:** "+newReason : "**reason:** none"
|
const APIEvents = require("../api/modules/events")
|
||||||
|
const messages = await getmessages(channel,5000)
|
||||||
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
await require("../transcriptSystem/manager")(messages,guild,channel,user,reason)
|
||||||
var fileattachment = await require("./transcript").createTranscript(channelmessages,channel)
|
APIEvents.onTranscriptCreation(messages,channel,guild,new Date())
|
||||||
|
|
||||||
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]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
const deleteHandler = async () => {
|
||||||
if (deleteRequired){
|
if (deleteRequired){
|
||||||
//const timer = () => {return new Promise((resolve,reject) => {
|
pendingDelete.shift()
|
||||||
// setTimeout(() => {resolve(true)},7000)
|
|
||||||
//})}
|
|
||||||
//await timer()
|
|
||||||
|
|
||||||
setTimeout(async () => {
|
|
||||||
await channel.delete()
|
await channel.delete()
|
||||||
},6000)
|
}
|
||||||
}
|
}
|
||||||
|
if (mode == "delete" || mode == "deletenotranscript") await transcriptHandler()
|
||||||
|
deleteHandler()
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,36 @@
|
|||||||
const discord = require('discord.js')
|
const discord = require('discord.js')
|
||||||
const bot = require('../index')
|
const bot = require('../../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const l = bot.language
|
const l = bot.language
|
||||||
const log = bot.errorLog.log
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
const getconfigoptions = require("./getoptions")
|
const configParser = require("../utils/configParser")
|
||||||
const storage = bot.storage
|
const storage = bot.storage
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
|
//dropdown placeholder
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isStringSelectMenu()) return
|
||||||
|
if (interaction.customId != "OTdropdownMenu") return
|
||||||
|
if (interaction.values.includes("OTChooseTicket")){
|
||||||
|
interaction.deferUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
var closeButton = bot.buttons.firstmsg.firstmsgRowNormal
|
var closeButton = bot.buttons.firstmsg.firstmsgRowNormal
|
||||||
|
|
||||||
//ticket button click / create ticket
|
//ticket button click / create ticket
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",async (interaction) => {
|
||||||
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
||||||
var customId = "OTnewT"+interaction.options.getString("type")
|
var customId = "OTnewT"+interaction.options.getString("type")
|
||||||
}else if (interaction.isButton()){
|
}else if (interaction.isButton()){
|
||||||
var customId = interaction.customId
|
var customId = interaction.customId
|
||||||
|
}else if (interaction.isStringSelectMenu() && (interaction.customId == "OTdropdownMenu")){
|
||||||
|
var customId = interaction.values[0]
|
||||||
|
|
||||||
}else return
|
}else return
|
||||||
|
|
||||||
if (interaction.isButton()){
|
if (interaction.isButton()){
|
||||||
@@ -30,29 +44,27 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (getconfigoptions.getTicketValues("id").includes(customId)){
|
if (configParser.getTicketValuesArray("id").includes(customId)){
|
||||||
|
|
||||||
//ticketoptions from config
|
//ticketoptions from config
|
||||||
const currentTicketOptions = getconfigoptions.getOptionsById(customId)
|
const currentTicketOptions = configParser.getTicketById(customId)
|
||||||
|
|
||||||
if (currentTicketOptions == false || currentTicketOptions.type != "ticket") return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
if (currentTicketOptions == false) return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
||||||
|
|
||||||
if (interaction.isButton()){
|
if (interaction.isButton()){
|
||||||
interaction.deferUpdate()
|
try {
|
||||||
|
if (config.system.answerInEphemeralOnOpen) interaction.deferReply({ephemeral:true})
|
||||||
|
} catch{}
|
||||||
}else if (interaction.isChatInputCommand()){
|
}else if (interaction.isChatInputCommand()){
|
||||||
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
interaction.deferReply({ephemeral:config.system.answerInEphemeralOnOpen})
|
||||||
|
}else if (interaction.isStringSelectMenu()){
|
||||||
|
try {
|
||||||
|
interaction.deferUpdate()
|
||||||
|
} catch{}
|
||||||
}
|
}
|
||||||
|
|
||||||
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){
|
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
|
//update storage
|
||||||
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
||||||
var ticketNumber = interaction.member.user.username
|
var ticketNumber = interaction.member.user.username
|
||||||
@@ -136,12 +148,13 @@ module.exports = () => {
|
|||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
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 {
|
try {
|
||||||
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
||||||
if (!userrole) return
|
if (userrole){
|
||||||
permissionsArray.push({
|
permissionsArray.push({
|
||||||
id:userrole,
|
id:userrole,
|
||||||
type:"role",
|
type:"role",
|
||||||
deny:[pfb.ViewChannel]
|
deny:[pfb.ViewChannel]
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}catch{
|
}catch{
|
||||||
log("system","invalid role! At 'config.json => system/member_role")
|
log("system","invalid role! At 'config.json => system/member_role")
|
||||||
}
|
}
|
||||||
@@ -170,6 +183,9 @@ module.exports = () => {
|
|||||||
}else{
|
}else{
|
||||||
ticketEmbed.setDescription(hiddendata)
|
ticketEmbed.setDescription(hiddendata)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentTicketOptions.thumbnail.enable) ticketEmbed.setThumbnail(currentTicketOptions.thumbnail.url)
|
||||||
|
if (currentTicketOptions.image.enable) ticketEmbed.setImage(currentTicketOptions.image.url)
|
||||||
|
|
||||||
ticketChannel.send({
|
ticketChannel.send({
|
||||||
content:"<@"+interaction.member.id+"> @here",
|
content:"<@"+interaction.member.id+"> @here",
|
||||||
@@ -181,7 +197,25 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
log("system","created new ticket",[{key:"ticket",value:ticketName},{key:"user",value:interaction.user.tag}])
|
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})
|
require("../api/modules/events").onTicketOpen(interaction.user,ticketChannel,interaction.guild,new Date(),{name:ticketName,status:"open",ticketOptions:currentTicketOptions})
|
||||||
|
|
||||||
|
const channelbutton = new discord.ActionRowBuilder()
|
||||||
|
.addComponents([
|
||||||
|
new discord.ButtonBuilder()
|
||||||
|
.setStyle(discord.ButtonStyle.Link)
|
||||||
|
.setDisabled(false)
|
||||||
|
.setEmoji("🎫")
|
||||||
|
.setLabel("go to ticket")
|
||||||
|
.setURL(ticketChannel.url)
|
||||||
|
])
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (currentTicketOptions.enableDmOnOpen) interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)],components:[channelbutton]})
|
||||||
|
}
|
||||||
|
catch{log("system","failed to send DM")}
|
||||||
|
|
||||||
|
if ((interaction.isButton() && config.system.answerInEphemeralOnOpen) || interaction.isChatInputCommand()) interaction.editReply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)],components:[channelbutton]})
|
||||||
|
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
Executable
+52
@@ -0,0 +1,52 @@
|
|||||||
|
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
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
|
||||||
|
const bot = require("../../../index")
|
||||||
|
const tsconfig = bot.tsconfig
|
||||||
|
const tsembeds = require("../embeds")
|
||||||
|
const tsdb = require("../tsdb")
|
||||||
|
|
||||||
|
const otversion = require("../../../package.json").version
|
||||||
|
const version = require("../info.json").version
|
||||||
|
|
||||||
|
/**@typedef {{style:{enableCustomBackground:Boolean, backgroundModus:"color"|"image", backgroundData:String, titleColor:String}, bot:{name:String, id:Number, pfp:String}, ticket:{creatorname:String, creatorid:Number, closedtime:Number, openedtime:Number}}} OThtsDataOption */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {discord.Channel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.Message[]} messagesInv
|
||||||
|
* @param {OThtsDataOption} data
|
||||||
|
*/
|
||||||
|
exports.compile = (guild,channel,user,messagesInv,data) => {
|
||||||
|
const messages = messagesInv.reverse()
|
||||||
|
var invisibleMessages = 0
|
||||||
|
|
||||||
|
const rawfiles = messages.filter((m) => Array.from(m.attachments).length > 0)
|
||||||
|
var fileAmount = 0
|
||||||
|
rawfiles.forEach((msg) => {
|
||||||
|
fileAmount = fileAmount + Array.from(msg.attachments).length
|
||||||
|
})
|
||||||
|
|
||||||
|
const messagesArray = []
|
||||||
|
messages.forEach((msg) => {
|
||||||
|
if (msg.content || msg.embeds.length > 0 || msg.attachments.toJSON().length > 0){
|
||||||
|
|
||||||
|
const embedArray = []
|
||||||
|
const fileArray = []
|
||||||
|
|
||||||
|
msg.attachments.forEach((file) => {
|
||||||
|
fileArray.push({
|
||||||
|
name:file.name,
|
||||||
|
type:file.contentType,
|
||||||
|
size:file.size.toString()+" bytes",
|
||||||
|
url:file.url
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
msg.embeds.forEach((embed) => {
|
||||||
|
if (embed.description){
|
||||||
|
var desc = bot.hiddenData.removeHiddenData(embed.description).description
|
||||||
|
}else{var desc = false}
|
||||||
|
|
||||||
|
embedArray.push({
|
||||||
|
title:embed.title || false,
|
||||||
|
description:desc,
|
||||||
|
authorimg:((embed.author && embed.author.iconURL) ? embed.author.iconURL : false),
|
||||||
|
authortext:(embed.author ? embed.author.name : false),
|
||||||
|
footerimg:((embed.footer && embed.footer.iconURL) ? embed.footer.iconURL : false),
|
||||||
|
footertext:(embed.footer ? embed.footer.text : false),
|
||||||
|
color:embed.hexColor,
|
||||||
|
image:((embed.image && embed.image.url) ? embed.image.url : false),
|
||||||
|
thumbnail:((embed.thumbnail && embed.thumbnail.url) ? embed.thumbnail.url : false),
|
||||||
|
url:(embed.url ? embed.url : false)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
messagesArray.push({
|
||||||
|
author:{
|
||||||
|
name:msg.author.tag,
|
||||||
|
id:Number(msg.author.id),
|
||||||
|
color:msg.member.displayHexColor || "#ffffff",
|
||||||
|
pfp:msg.author.displayAvatarURL()
|
||||||
|
},
|
||||||
|
content:msg.content || "",
|
||||||
|
timestamp:msg.createdTimestamp,
|
||||||
|
embeds:embedArray,
|
||||||
|
files:fileArray
|
||||||
|
})
|
||||||
|
}else {invisibleMessages++}
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = {
|
||||||
|
version,otversion,
|
||||||
|
style:{
|
||||||
|
backgroundData:data.style.backgroundData || "",
|
||||||
|
backgroundModus:data.style.backgroundModus || "",
|
||||||
|
enableCustomBackground:data.style.enableCustomBackground || false,
|
||||||
|
titleColor:data.style.titleColor || "#F8BA00"
|
||||||
|
},
|
||||||
|
bot:{
|
||||||
|
name:data.bot.name || "Open Ticket",
|
||||||
|
id:Number(data.bot.id) || 0,
|
||||||
|
pfp:data.bot.pfp || "dj-dj.be/wp-content/uploads/2022/07/profielfoto-blauw-wit.png?size=128"
|
||||||
|
},
|
||||||
|
ticket:{
|
||||||
|
name:channel.name,
|
||||||
|
id:Number(channel.id),
|
||||||
|
|
||||||
|
guildname:guild.name,
|
||||||
|
guildid:Number(guild.id),
|
||||||
|
|
||||||
|
creatorname:data.ticket.creatorname,
|
||||||
|
creatorid:Number(data.ticket.creatorid),
|
||||||
|
closedbyname:user.tag,
|
||||||
|
closedbyid:Number(user.id),
|
||||||
|
|
||||||
|
closedtime:data.ticket.closedtime,
|
||||||
|
openedtime:data.ticket.openedtime,
|
||||||
|
|
||||||
|
messages:Array.from(messages).length-invisibleMessages,
|
||||||
|
files:fileAmount
|
||||||
|
},
|
||||||
|
messages:messagesArray
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
const axios = require("axios").default
|
||||||
|
const discord = require('discord.js')
|
||||||
|
|
||||||
|
const bot = require("../../../index")
|
||||||
|
const tsconfig = bot.tsconfig
|
||||||
|
const tsembeds = require("../embeds")
|
||||||
|
const tsdb = require("../tsdb")
|
||||||
|
|
||||||
|
/**@typedef {{status:"success"|"error", id:String, time:Number, estimated:{lastdump: Number, processtime:Number}, transcriptstatus:{value:2, data:{fetchedmsgs:true, uploaded:true, inqueue:true, processed:false, waiting:false, available:false}}}} OTuploadResponse */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Object} json
|
||||||
|
* @returns {Promise<OTuploadResponse|false>}
|
||||||
|
*/
|
||||||
|
exports.upload = async (json) => {
|
||||||
|
return new Promise(async (resolve,reject) => {
|
||||||
|
const data = encodeURIComponent(JSON.stringify(json))
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await axios.get("https://api.transcripts.dj-dj.be/upload?auth=openticketTRANSCRIPT1234&version=1.0.0&data="+data)
|
||||||
|
if (res.status != 200) resolve(false)
|
||||||
|
|
||||||
|
resolve(res.data)
|
||||||
|
}catch{
|
||||||
|
console.log("failed transcript upload!")
|
||||||
|
resolve(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"version":"1.0.0",
|
||||||
|
"otversion":"3.2.2",
|
||||||
|
"style":{
|
||||||
|
"enableCustomBackground":false,
|
||||||
|
"backgroundModus":"color OR image",
|
||||||
|
"backgroundData":"#ffffff OR https://www.example.com/image.png",
|
||||||
|
"titleColor":"#ffffff"
|
||||||
|
},
|
||||||
|
"bot":{
|
||||||
|
"name":"DJdj Support Bot",
|
||||||
|
"id":12345678910,
|
||||||
|
"pfp":"https://www.example.com/image.png"
|
||||||
|
},
|
||||||
|
"ticket":{
|
||||||
|
"name":"support-DJj123dj",
|
||||||
|
"id":12345678910,
|
||||||
|
|
||||||
|
"guildname":"DJdj Development",
|
||||||
|
"guildid":12345678910,
|
||||||
|
|
||||||
|
"creatorname":"DJj123dj#1706",
|
||||||
|
"creatorid":12345678910,
|
||||||
|
"closedbyname":"DJj123dj#1706",
|
||||||
|
"closedbyid":12345678910,
|
||||||
|
|
||||||
|
"closedtime":12345678910,
|
||||||
|
"openedtime":12345678910,
|
||||||
|
|
||||||
|
"messages":1,
|
||||||
|
"files":1
|
||||||
|
},
|
||||||
|
"messages":[
|
||||||
|
{
|
||||||
|
"author":{
|
||||||
|
"name":"DJj123dj#1706",
|
||||||
|
"id":12345678910,
|
||||||
|
"color":"#ffffff",
|
||||||
|
"pfp":"https://www.example.com/image.png"
|
||||||
|
},
|
||||||
|
"content":"string or FALSE",
|
||||||
|
"timestamp":12345678910,
|
||||||
|
"embeds":[
|
||||||
|
{
|
||||||
|
"title":"string or FALSE",
|
||||||
|
"description":"string or FALSE",
|
||||||
|
"authorimg":"https://www.example.com/image.png or FALSE",
|
||||||
|
"authortext":"string or FALSE",
|
||||||
|
"footerimg":"https://www.example.com/image.png or FALSE",
|
||||||
|
"footertext":"string or FALSE",
|
||||||
|
"color":"#ffffff",
|
||||||
|
"image":"https://www.example.com/image.png or FALSE",
|
||||||
|
"thumbnail":"https://www.example.com/image.png or FALSE",
|
||||||
|
"url":"https://www.example.com/image.png or FALSE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"files":[
|
||||||
|
{
|
||||||
|
"name":"image.png",
|
||||||
|
"type":"PNG",
|
||||||
|
"size":"1MB",
|
||||||
|
"url":"https://www.example.com/image.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
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 tsconfig = bot.tsconfig
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @param {String} id
|
||||||
|
* @param {Number} rawprocesstime milliseconds
|
||||||
|
* @param {discord.User} user
|
||||||
|
*/
|
||||||
|
exports.beingprocessed = (name,id,rawprocesstime,user) => {
|
||||||
|
|
||||||
|
const newtime = rawprocesstime
|
||||||
|
|
||||||
|
const processtime = "<t:"+newtime.getTime().toString().substring(0,newtime.getTime().toString().length-3)+":R>"
|
||||||
|
|
||||||
|
const embed = new discord.EmbedBuilder()
|
||||||
|
.setTitle("🧾 "+l.transcripts.title)
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setAuthor({name:user.tag,iconURL:user.displayAvatarURL()})
|
||||||
|
.setFooter({text:name})
|
||||||
|
|
||||||
|
.setDescription("`"+l.transcripts.processed+"...`\n"+l.transcripts.wait+"\n\n"+l.transcripts.estimated+": "+processtime)
|
||||||
|
|
||||||
|
return embed
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @param {String} id
|
||||||
|
* @param {String} url
|
||||||
|
* @param {discord.User} user
|
||||||
|
*/
|
||||||
|
exports.tsready = (name,id,url,user) => {
|
||||||
|
const embed = new discord.EmbedBuilder()
|
||||||
|
.setTitle("🧾 "+l.transcripts.title)
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setAuthor({name:user.tag,iconURL:user.displayAvatarURL()})
|
||||||
|
.setFooter({text:name})
|
||||||
|
|
||||||
|
if (url){
|
||||||
|
embed.setURL(url)
|
||||||
|
embed.setDescription("\n["+l.transcripts.available+"]("+url+")\n")
|
||||||
|
}else{
|
||||||
|
embed.setDescription("\n"+l.transcripts.available+"\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
return embed
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @param {String} id
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {undefined|String} err
|
||||||
|
*/
|
||||||
|
exports.tserror = (name,id,user,err) => {
|
||||||
|
const embed = new discord.EmbedBuilder()
|
||||||
|
.setTitle("❌ "+l.transcripts.title)
|
||||||
|
.setColor(discord.Colors.Red)
|
||||||
|
.setAuthor({name:user.tag,iconURL:user.displayAvatarURL()})
|
||||||
|
.setFooter({text:name})
|
||||||
|
|
||||||
|
const errDesc = (typeof err == "string") ? "\n"+err : ""
|
||||||
|
|
||||||
|
embed.setDescription("Something went wrong while creating the HTML transcript.\n\n[possible reasons](https://docs.openticket.dj-dj.be/the-system/transcripts/transcript-errors)"+errDesc)
|
||||||
|
|
||||||
|
return embed
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"version":"1.0.0"
|
||||||
|
}
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
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 tsconfig = bot.tsconfig
|
||||||
|
const tsembeds = require("./embeds")
|
||||||
|
const tsdb = require("./tsdb")
|
||||||
|
|
||||||
|
|
||||||
|
const checkAvailability = async () => {
|
||||||
|
if (process.argv.some((v) => v == "--tsoffline")) return true
|
||||||
|
const axios = require("axios").default
|
||||||
|
const res = await axios.get("https://transcripts.dj-dj.be/status.txt")
|
||||||
|
if (!res || !(res.status == 200) || !res.data) return false
|
||||||
|
|
||||||
|
if ((res.data == "online") || (res.data == "1") || (res.data == "true")) return true
|
||||||
|
else return false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.Message[]} messages
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {String|false} reason
|
||||||
|
*/
|
||||||
|
module.exports = async (messages,guild,channel,user,reason) => {
|
||||||
|
require("../api/modules/events").onTranscriptCreation(messages,channel,guild,new Date())
|
||||||
|
const msglist = await channel.messages.fetchPinned()
|
||||||
|
|
||||||
|
const chName = channel.name
|
||||||
|
const chId = channel.id
|
||||||
|
|
||||||
|
/**@param {discord.Collection<string, discord.Message<true>>} msglist*/
|
||||||
|
const asyncmanager = async (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
|
||||||
|
const opentime = new Date(Number(hiddendata.data.find(d => d.key == "createdms").value))
|
||||||
|
|
||||||
|
const ticketopener = client.users.cache.find(u => u.id == id)
|
||||||
|
|
||||||
|
if (tsconfig.sendTranscripts.useHTMLtranscripts){
|
||||||
|
const JSONDATA = require("./communication/compileJson").compile(guild,channel,user,messages,{
|
||||||
|
style:{
|
||||||
|
titleColor:tsconfig.style.titleColor,
|
||||||
|
enableCustomBackground:tsconfig.style.background.enableCustomBackground,
|
||||||
|
backgroundModus:tsconfig.style.background.backgroundModus,
|
||||||
|
backgroundData:tsconfig.style.background.backgroundData
|
||||||
|
},
|
||||||
|
bot:{
|
||||||
|
name:client.user.username,
|
||||||
|
id:client.user.id,
|
||||||
|
pfp:client.user.displayAvatarURL()
|
||||||
|
},
|
||||||
|
ticket:{
|
||||||
|
creatorid:ticketopener.id,
|
||||||
|
creatorname:ticketopener.tag,
|
||||||
|
openedtime:opentime.getTime(),
|
||||||
|
closedtime:new Date().getTime()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!await checkAvailability()){
|
||||||
|
const attachment = await require("./oldTranscript").createTranscript(messages,channel)
|
||||||
|
const errembed = tsembeds.tserror(chName,chId,user)
|
||||||
|
|
||||||
|
if (tsconfig.sendTranscripts.enableChannel){
|
||||||
|
/**@type {discord.TextChannel|undefined} */
|
||||||
|
const tc = guild.channels.cache.find((c) => c.id == tsconfig.sendTranscripts.channel)
|
||||||
|
|
||||||
|
if (!tc) return
|
||||||
|
tc.send({embeds:[errembed],files:[attachment]})
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const TSdata = await require("./communication/index").upload(JSONDATA)
|
||||||
|
if (!TSdata) return false
|
||||||
|
|
||||||
|
if (TSdata.status == "success"){
|
||||||
|
const url = "https://transcripts.dj-dj.be/t/"+TSdata.time+"_"+TSdata.id+".html"
|
||||||
|
|
||||||
|
//calculate estimated time
|
||||||
|
const lastDumpTime = (new Date(TSdata.estimated.lastdump).getTime())
|
||||||
|
const dumpLoopTime = 15000
|
||||||
|
const nextDump = new Date(lastDumpTime+dumpLoopTime)
|
||||||
|
const processtime = TSdata.estimated.processtime+6000 //6sec extra time for overflow
|
||||||
|
|
||||||
|
const finaltime = new Date(nextDump.getTime()+processtime)
|
||||||
|
const duration = finaltime.getTime()-new Date().getTime()
|
||||||
|
|
||||||
|
//waiting
|
||||||
|
if (tsconfig.sendTranscripts.enableChannel){
|
||||||
|
/**@type {discord.TextChannel|undefined} */
|
||||||
|
const tc = guild.channels.cache.find((c) => c.id == tsconfig.sendTranscripts.channel)
|
||||||
|
|
||||||
|
if (!tc) return
|
||||||
|
const embed = tsembeds.beingprocessed(chName,chId,finaltime,user)
|
||||||
|
var msg = await tc.send({embeds:[embed]})
|
||||||
|
}else {var msg = false}
|
||||||
|
|
||||||
|
//ready
|
||||||
|
setTimeout(() => {
|
||||||
|
if (msg){
|
||||||
|
msg.edit({embeds:[tsembeds.tsready(chName,chId,url,user)]})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tsconfig.sendTranscripts.enableDM){
|
||||||
|
if (!user) return
|
||||||
|
const embed = tsembeds.tsready(chName,chId,url,user)
|
||||||
|
try {
|
||||||
|
ticketopener.send({embeds:[embed]})
|
||||||
|
}catch{}
|
||||||
|
}
|
||||||
|
},duration)
|
||||||
|
}else{
|
||||||
|
const attachment = await require("./oldTranscript").createTranscript(messages,channel)
|
||||||
|
const errembed = tsembeds.tserror(chName,chId,user,"`error type: transcript API error`")
|
||||||
|
|
||||||
|
if (tsconfig.sendTranscripts.enableChannel){
|
||||||
|
/**@type {discord.TextChannel|undefined} */
|
||||||
|
const tc = guild.channels.cache.find((c) => c.id == tsconfig.sendTranscripts.channel)
|
||||||
|
|
||||||
|
if (!tc) return
|
||||||
|
tc.send({embeds:[errembed],files:[attachment]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
const attachment = await require("./oldTranscript").createTranscript(messages,channel)
|
||||||
|
const embed = tsembeds.tsready(chName,chId,false,user)
|
||||||
|
|
||||||
|
if (tsconfig.sendTranscripts.enableChannel){
|
||||||
|
/**@type {discord.TextChannel|undefined} */
|
||||||
|
const tc = guild.channels.cache.find((c) => c.id == tsconfig.sendTranscripts.channel)
|
||||||
|
|
||||||
|
if (!tc) return
|
||||||
|
tc.send({embeds:[embed],files:[attachment]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
asyncmanager(msglist)
|
||||||
|
}
|
||||||
Executable
+47
@@ -0,0 +1,47 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.Message[]} messagecollection
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {Boolean} backup
|
||||||
|
* @returns new `discord.attachmentBuilder`
|
||||||
|
*/
|
||||||
|
|
||||||
|
exports.createTranscript = async (messagecollection,channel,backup) => {
|
||||||
|
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.getHours()+":"+cd.getMinutes()+":"+cd.getSeconds()
|
||||||
|
let backuptitle = backup ? "BACKUP " : ""
|
||||||
|
let backupfilename = backup ? "backup" : ""
|
||||||
|
const filearray = [backuptitle+"TRANSCRIPT:\n"]
|
||||||
|
|
||||||
|
messagecollection.reverse()
|
||||||
|
|
||||||
|
messagecollection.forEach((msg) => {
|
||||||
|
const timestamp = new Date(msg.createdTimestamp)
|
||||||
|
|
||||||
|
if (msg.content){var content = msg.content}else{var content = "*empty message*"}
|
||||||
|
const fileurls = []
|
||||||
|
const rawfiles = Array.from(msg.attachments)
|
||||||
|
rawfiles.forEach((file) => {
|
||||||
|
fileurls.push("attachment: "+file[1].url)
|
||||||
|
})
|
||||||
|
const filestring = fileurls.length > 0 ? fileurls.join("\n")+"\n" : ""
|
||||||
|
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"+filestring)
|
||||||
|
})
|
||||||
|
|
||||||
|
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:backupfilename+"transcript.txt",description:"Open Ticket transcript"})
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
const fs = require("fs")
|
||||||
|
const location = "./storage/tsdatabase.json"
|
||||||
|
|
||||||
|
|
||||||
|
/**@returns {[{category:String, key:String, value:String}]}*/
|
||||||
|
function getData(){
|
||||||
|
if (fs.existsSync(location)){
|
||||||
|
return JSON.parse(fs.readFileSync(location).toString())
|
||||||
|
}else{
|
||||||
|
fs.writeFileSync(location,"[]")
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**@param {[{category:String, key:String, value:String}]} data*/
|
||||||
|
function setData(data){
|
||||||
|
fs.writeFileSync(location,JSON.stringify(data,null,"\t"))
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.set = (category,key,value) => {
|
||||||
|
const currentData = getData()
|
||||||
|
const exists = currentData.find((d) => (d.category == category) && (d.key == key)) ? true : false
|
||||||
|
var newData = []
|
||||||
|
if (exists){
|
||||||
|
currentData.forEach((d,i) => {
|
||||||
|
if (d.category == category && d.key == key){
|
||||||
|
newData.push({category,key,value})
|
||||||
|
}else{
|
||||||
|
newData.push(d)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
currentData.push({category,key,value})
|
||||||
|
newData = currentData
|
||||||
|
}
|
||||||
|
|
||||||
|
setData(newData)
|
||||||
|
return exists
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} key
|
||||||
|
* @returns {String|false}
|
||||||
|
*/
|
||||||
|
exports.get = (category,key) => {
|
||||||
|
const currentData = getData()
|
||||||
|
const tempresult = currentData.find((d) => (d.category == category) && (d.key == key))
|
||||||
|
const result = tempresult ? tempresult.value : false
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} key
|
||||||
|
* @param {String} value
|
||||||
|
*/
|
||||||
|
exports.delete = (category,key) => {
|
||||||
|
const currentData = getData()
|
||||||
|
const exists = currentData.find((d) => (d.category == category) && (d.key == key)) ? true : false
|
||||||
|
var newData = []
|
||||||
|
if (exists){
|
||||||
|
currentData.forEach((d,i) => {
|
||||||
|
if (!(d.category == category && d.key == key)){
|
||||||
|
newData.push(d)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
newData = currentData
|
||||||
|
}
|
||||||
|
|
||||||
|
setData(newData)
|
||||||
|
return exists
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
const bot = require("../../index")
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
//TYPEDEFS:
|
||||||
|
//==================
|
||||||
|
|
||||||
|
//OTTicketOptions
|
||||||
|
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color: "red"|"green"|"blue"|"gray",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, image:{enable:Boolean,url:String}, closedCategory:{enable:Boolean,id:String}}} OTTicketOptions */
|
||||||
|
|
||||||
|
//OTRoleOptions
|
||||||
|
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",enableDmOnOpen:Boolean}} OTRoleOptions */
|
||||||
|
|
||||||
|
//OTWebsiteOptions
|
||||||
|
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",url:String}} OTWebsiteOptions */
|
||||||
|
|
||||||
|
|
||||||
|
//OTConfigMessage
|
||||||
|
/**@typedef {{id: string, name: string, description: string, dropdown: boolean, enableFooter: boolean, footer: string, enableThumbnail: boolean, thumbnail: string, enableCustomColor: boolean, color: string, options: string[], other:{enableTicketExplaination: boolean, enableMaxTicketsWarning: boolean, customDropdownPlaceholder:{enable:Boolean,text:String}, customCategoryText:{enable:Boolean,text:String}, embedTitleURL:{enable:Boolean,url:String} } }} OTConfigMessage*/
|
||||||
|
|
||||||
|
//OTAllOptions
|
||||||
|
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, image:{enable:Boolean,url:String}, url:String, closedCategory:{enable:Boolean,id:String}}} OTAllOptions */
|
||||||
|
|
||||||
|
//StringOptions
|
||||||
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDmOnOpen"|"ticketmessage"|"thumbnail"|"image"|"closedCategory"} OTTicketStringOptions */
|
||||||
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDmOnOpen"} OTRoleStringOptions */
|
||||||
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} OTWebsiteStringOptions */
|
||||||
|
|
||||||
|
//FUNCTIONS:
|
||||||
|
//==================
|
||||||
|
|
||||||
|
/** @param {String} id the id of the embed @returns {OTConfigMessage}*/
|
||||||
|
exports.getConfigMessage = (id) => {
|
||||||
|
var returned = config.messages.find(a => a.id == id)
|
||||||
|
if (returned){
|
||||||
|
return returned
|
||||||
|
}
|
||||||
|
var result = config.messages[0]
|
||||||
|
if (!result){
|
||||||
|
throw new Error("'messages' object in config.json is empty")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id
|
||||||
|
* @param {Boolean} withoutOTnewT
|
||||||
|
* @returns {OTTicketOptions|false}
|
||||||
|
*/
|
||||||
|
exports.getTicketById = (id,withoutOTnewT) => {
|
||||||
|
var result = false
|
||||||
|
if (withoutOTnewT){
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if (option.id == id && option.type == "ticket"){
|
||||||
|
result = option
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if ("OTnewT"+option.id == id && option.type == "ticket"){
|
||||||
|
result = option
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id
|
||||||
|
* @param {Boolean} withoutOTnewR
|
||||||
|
* @returns {OTRoleOptions|false}
|
||||||
|
*/
|
||||||
|
exports.getRoleById = (id,withoutOTnewR) => {
|
||||||
|
var result = false
|
||||||
|
if (withoutOTnewR){
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if (option.id == id && option.type == "role"){
|
||||||
|
result = option
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if ("OTnewR"+option.id == id && option.type == "role"){
|
||||||
|
result = option
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id
|
||||||
|
* @returns {OTWebsiteOptions|false}
|
||||||
|
*/
|
||||||
|
exports.getWebsiteById = (id) => {
|
||||||
|
var result = false
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if (option.id == id && option.type == "website"){
|
||||||
|
result = option
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {OTTicketStringOptions} value
|
||||||
|
* @returns {String[]}
|
||||||
|
*/
|
||||||
|
exports.getTicketValuesArray = (value,idWithoutOTnewT) => {
|
||||||
|
var result = []
|
||||||
|
const prefix = idWithoutOTnewT ? "" : "OTnewT"
|
||||||
|
config.options.forEach((opt) => {
|
||||||
|
if (opt.type == "ticket"){
|
||||||
|
if (value == "id"){
|
||||||
|
result.push(prefix+opt[value])
|
||||||
|
}else{
|
||||||
|
result.push(opt[value])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {OTRoleStringOptions} value
|
||||||
|
* @returns {String[]}
|
||||||
|
*/
|
||||||
|
exports.getRoleValuesArray = (value,idWithoutOTnewR) => {
|
||||||
|
var result = []
|
||||||
|
const prefix = idWithoutOTnewR ? "" : "OTnewR"
|
||||||
|
config.options.forEach((opt) => {
|
||||||
|
if (o.type == "role"){
|
||||||
|
if (value == "id"){
|
||||||
|
result.push(prefix+opt[value])
|
||||||
|
}else{
|
||||||
|
result.push(opt[value])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {OTWebsiteStringOptions} value
|
||||||
|
* @returns {String[]}
|
||||||
|
*/
|
||||||
|
exports.getWebsiteValuesArray = (value) => {
|
||||||
|
var result = []
|
||||||
|
config.options.forEach((opt) => {
|
||||||
|
if (o.type == "website"){
|
||||||
|
result.push(opt[value])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@type {OTTicketOptions} */
|
||||||
|
this.ticketType = {}
|
||||||
|
|
||||||
|
/**@type {OTRoleOptions} */
|
||||||
|
this.roleType = {}
|
||||||
|
|
||||||
|
/**@type {OTWebsiteOptions} */
|
||||||
|
this.websiteType = {}
|
||||||
|
|
||||||
|
/**@type {OTConfigMessage} */
|
||||||
|
this.messageType = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.optionExists = (id) => {
|
||||||
|
var result = false
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if (option.id == id){
|
||||||
|
result = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
const discord = require("discord.js")
|
const discord = require("discord.js")
|
||||||
const bot = require("../../index")
|
const bot = require("../../index")
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getoptions = require("../getoptions")
|
|
||||||
const l = bot.language
|
const l = bot.language
|
||||||
|
|
||||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||||
@@ -81,7 +80,7 @@ exports.rawButtonData = class {
|
|||||||
this.type = ""
|
this.type = ""
|
||||||
|
|
||||||
this.color = ""
|
this.color = ""
|
||||||
this.enableDMMessage = true
|
this.enableDmOnOpen = true
|
||||||
this.url = ""
|
this.url = ""
|
||||||
this.roles = ["",""]
|
this.roles = ["",""]
|
||||||
this.mode = ""
|
this.mode = ""
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
const discord = require("discord.js")
|
||||||
|
const bot = require("../../index")
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
const configParser = require("./configParser")
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String[]} ids
|
||||||
|
* @param {String|undefined|false} placeholder
|
||||||
|
* @returns {discord.StringSelectMenuBuilder|false}
|
||||||
|
*/
|
||||||
|
exports.getDropdown = (ids,placeholder) => {
|
||||||
|
const dropdown = new discord.StringSelectMenuBuilder()
|
||||||
|
.setCustomId("OTdropdownMenu")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setMaxValues(1)
|
||||||
|
.setMinValues(1)
|
||||||
|
.setPlaceholder(placeholder || l.messages.chooseATicket)
|
||||||
|
.addOptions(
|
||||||
|
new discord.SelectMenuOptionBuilder()
|
||||||
|
.setDefault(true)
|
||||||
|
.setLabel(placeholder || l.messages.chooseATicket)
|
||||||
|
.setValue("OTChooseTicket")
|
||||||
|
)
|
||||||
|
|
||||||
|
ids.forEach((id) => {
|
||||||
|
const option = configParser.getTicketById(id,true)
|
||||||
|
const roleoption = configParser.getRoleById(id,true)
|
||||||
|
if (option){
|
||||||
|
const selectComponent = new discord.SelectMenuOptionBuilder()
|
||||||
|
.setDefault(false)
|
||||||
|
.setValue("OTnewT"+option.id)
|
||||||
|
|
||||||
|
if (!option.label && !option.icon){
|
||||||
|
selectComponent.setLabel("OT ERROR: no description/emoji")
|
||||||
|
}else{
|
||||||
|
if (option.label) selectComponent.setLabel(option.label)
|
||||||
|
if (option.icon) selectComponent.setEmoji(option.icon)
|
||||||
|
}
|
||||||
|
|
||||||
|
dropdown.addOptions(selectComponent)
|
||||||
|
|
||||||
|
}else if (roleoption){
|
||||||
|
const selectComponent = new discord.SelectMenuOptionBuilder()
|
||||||
|
.setDefault(false)
|
||||||
|
.setValue("OTnewR"+roleoption.id)
|
||||||
|
|
||||||
|
if (!roleoption.label && !roleoption.icon){
|
||||||
|
selectComponent.setLabel("OT ERROR: no description/emoji")
|
||||||
|
}else{
|
||||||
|
if (roleoption.label) selectComponent.setLabel(roleoption.label)
|
||||||
|
if (roleoption.icon) selectComponent.setEmoji(roleoption.icon)
|
||||||
|
}
|
||||||
|
|
||||||
|
dropdown.addOptions(selectComponent)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
return dropdown
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
const discord = require('discord.js')
|
const discord = require('discord.js')
|
||||||
const bot = require('../index')
|
const bot = require('../../index')
|
||||||
const client = bot.client
|
const client = bot.client
|
||||||
const config = bot.config
|
const config = bot.config
|
||||||
const getButton = require("./utils/getButton")
|
const getButton = require("./getButton")
|
||||||
const l = bot.language
|
const l = bot.language
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,7 +16,7 @@ const l = bot.language
|
|||||||
exports.createEmbed = (id) => {
|
exports.createEmbed = (id) => {
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
//general importing
|
//general importing
|
||||||
const data = require("./utils/getTicketMessages").getTicketMessage(id)
|
const data = require("./configParser").getConfigMessage(id)
|
||||||
/**@type {discord.ButtonBuilder[]}*/
|
/**@type {discord.ButtonBuilder[]}*/
|
||||||
var buttons = []
|
var buttons = []
|
||||||
/**@type {getButton.rawButtonData[]} */
|
/**@type {getButton.rawButtonData[]} */
|
||||||
@@ -35,7 +35,10 @@ exports.createEmbed = (id) => {
|
|||||||
const embed = new discord.EmbedBuilder()
|
const embed = new discord.EmbedBuilder()
|
||||||
.setTitle(data.name)
|
.setTitle(data.name)
|
||||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
if (data.enableFooter) embed.setFooter({text:data.footer})
|
||||||
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
|
||||||
|
try {
|
||||||
|
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
||||||
|
}catch{bot.errorLog.log("info","THUMBNAIL FAILED TO LOAD, probably invalid url!")}
|
||||||
|
|
||||||
if (data.enableCustomColor){
|
if (data.enableCustomColor){
|
||||||
embed.setColor(data.color)
|
embed.setColor(data.color)
|
||||||
@@ -43,9 +46,12 @@ exports.createEmbed = (id) => {
|
|||||||
embed.setColor(config.main_color)
|
embed.setColor(config.main_color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.other.embedTitleURL.enable) embed.setURL(data.other.embedTitleURL.url)
|
||||||
|
|
||||||
var description = data.description
|
var description = data.description
|
||||||
if (data.enableTicketExplaination){
|
if (data.other.enableTicketExplaination){
|
||||||
description = description+"\n\n__"+l.messages.chooseCategory+"__\n"
|
const chooseCategoryMSG = data.other.customCategoryText.enable ? data.other.customCategoryText.text : l.messages.chooseCategory
|
||||||
|
description = description+"\n\n__"+chooseCategoryMSG+"__\n"
|
||||||
|
|
||||||
var ticketExplainations = []
|
var ticketExplainations = []
|
||||||
buttonData.forEach((button) => {
|
buttonData.forEach((button) => {
|
||||||
@@ -56,35 +62,49 @@ exports.createEmbed = (id) => {
|
|||||||
description = description+ticketExplainations.join("\n\n")
|
description = description+ticketExplainations.join("\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.enableMaxTicketsWarning){
|
if (data.other.enableMaxTicketsWarning){
|
||||||
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
||||||
}
|
}
|
||||||
|
|
||||||
embed.setDescription(description)
|
if (description) 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--){
|
//-----------------------------------
|
||||||
|
//create the components IF DROPDOWN IS FALSE
|
||||||
|
if (!data.dropdown){
|
||||||
|
var AmountOfRows = Math.ceil(buttons.length / 4)
|
||||||
|
var currentRow = 0
|
||||||
|
|
||||||
componentRows.push(new discord.ActionRowBuilder())
|
/**
|
||||||
}
|
* @type {discord.MessageActionRow[]}
|
||||||
|
*/
|
||||||
|
var componentRows = []
|
||||||
|
|
||||||
buttons.forEach((button,index) => {
|
for (let i = AmountOfRows; i > 0; i--){
|
||||||
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){
|
componentRows.push(new discord.ActionRowBuilder())
|
||||||
currentRow = currentRow + 1
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//create the component IF DROPDOWN is true
|
||||||
|
}else{
|
||||||
|
const ids = data.options
|
||||||
|
const customPlaceholder = data.other.customDropdownPlaceholder.enable ? data.other.customDropdownPlaceholder.text : false
|
||||||
|
const dropdown = require("./getDropdown").getDropdown(ids,customPlaceholder)
|
||||||
|
var componentRows = [
|
||||||
|
new discord.ActionRowBuilder()
|
||||||
|
.setComponents(dropdown)
|
||||||
|
]
|
||||||
|
}
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
|
|
||||||
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -49,4 +49,18 @@ exports.writeHiddenData = (type,data) => {
|
|||||||
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} description
|
||||||
|
* @returns {{description:String,hiddenData:hiddenData}}
|
||||||
|
*/
|
||||||
|
exports.removeHiddenData = (description) => {
|
||||||
|
const hiddenData = this.readHiddenData(description)
|
||||||
|
|
||||||
|
const splitted = description.split("[ ](OTDATA")
|
||||||
|
const original = splitted[0]
|
||||||
|
|
||||||
|
return {description:original,hiddenData:hiddenData}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = async () => {
|
||||||
|
const chalk = await loadChalk()
|
||||||
|
|
||||||
|
//LIVESTATUS SOON
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ exports.command = (memberid,guildid) => {
|
|||||||
*/
|
*/
|
||||||
exports.sendUserNoPerms = (user) => {
|
exports.sendUserNoPerms = (user) => {
|
||||||
try {
|
try {
|
||||||
user.send({embeds:[bot.errorLog.noPermsMessage]})
|
user.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
||||||
return true
|
return true
|
||||||
}catch{
|
}catch{
|
||||||
return false
|
return false
|
||||||
@@ -54,7 +54,7 @@ exports.sendUserNoPerms = (user) => {
|
|||||||
*/
|
*/
|
||||||
exports.sendUserNoDelete = (user) => {
|
exports.sendUserNoDelete = (user) => {
|
||||||
try {
|
try {
|
||||||
user.send({embeds:[bot.errorLog.noPermsDelete]})
|
user.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
||||||
return true
|
return true
|
||||||
}catch{
|
}catch{
|
||||||
return false
|
return false
|
||||||
@@ -64,11 +64,12 @@ exports.sendUserNoPerms = (user) => {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
exports.sendChannelNoPerms = (channel) => {
|
exports.sendChannelNoPerms = (channel,user) => {
|
||||||
try {
|
try {
|
||||||
channel.send({embeds:[bot.errorLog.noPermsMessage]})
|
channel.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
||||||
return true
|
return true
|
||||||
}catch{
|
}catch{
|
||||||
return false
|
return false
|
||||||
@@ -78,9 +79,10 @@ exports.sendUserNoPerms = (user) => {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
exports.sendChannelNoTicket = (channel) => {
|
exports.sendChannelNoTicket = (channel,user) => {
|
||||||
try {
|
try {
|
||||||
channel.send({embeds:[bot.errorLog.notInATicket]})
|
channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
return true
|
return true
|
||||||
@@ -92,11 +94,12 @@ exports.sendUserNoPerms = (user) => {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {discord.TextChannel} channel
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
exports.sendChannelNoDelete = (channel) => {
|
exports.sendChannelNoDelete = (channel,user) => {
|
||||||
try {
|
try {
|
||||||
channel.send({embeds:[bot.errorLog.noPermsDelete]})
|
channel.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
||||||
return true
|
return true
|
||||||
}catch{
|
}catch{
|
||||||
return false
|
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"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +1,110 @@
|
|||||||
// __________ __________ ___________ ____ ____
|
/**
|
||||||
// / ____ \ / ______ \ / | | \ | |
|
____ _____ ______ _ _ _______ _____ _____ _ ________ _______
|
||||||
// | / \ | | | | | | |_______| | \ | |
|
/ __ \| __ \| ____| \ | | |__ __|_ _/ ____| |/ / ____|__ __|
|
||||||
// | | | | | |____| | | | | |\ \ | |
|
| | | | |__) | |__ | \| | | | | || | | ' /| |__ | |
|
||||||
// | | | | | ________/ | |______ | | \ \ | |
|
| | | | ___/| __| | . ` | | | | || | | < | __| | |
|
||||||
// | | | | | | | _____| | | \ \ | |
|
| |__| | | | |____| |\ | | | _| || |____| . \| |____ | |
|
||||||
// | | | | | | | | | | \ \ | |
|
\____/|_| |______|_| \_| |_| |_____\_____|_|\_\______| |_|
|
||||||
// | | | | | | | |________ | | \ \| |
|
|
||||||
// | \____/ | | | | | | | \ |
|
Hey! we are looking for you!
|
||||||
// \__________/ |__| \__________| |__| \___|
|
Do you speak a language that isn't yet in our /languages directory
|
||||||
|
or do you speak one that isn't up-to-date? Open Ticket needs
|
||||||
|
translators for lots of different languages!
|
||||||
|
Feel free to join our translator team and help us improve Open Ticket!
|
||||||
|
|
||||||
|
|
||||||
const discord = require('discord.js')
|
|
||||||
|
|
||||||
|
SUGGESTING NEW FEATURES:
|
||||||
|
=====================
|
||||||
|
Open Ticket is a community project. This means that
|
||||||
|
almost all feature ideas come from our community.
|
||||||
|
Are you missing something you want in open ticket?
|
||||||
|
Then join our Discord server and we will add it (if possible)
|
||||||
|
|
||||||
|
Did you know that 80% of all features in OT were ideas from our community?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INFORMATION:
|
||||||
|
============
|
||||||
|
Open Ticket v3.2.2 - © DJdj Development
|
||||||
|
|
||||||
|
discord: https://discord.dj-dj.be
|
||||||
|
website: https://www.dj-dj.be
|
||||||
|
github: https://openticket.dj-dj.be
|
||||||
|
support e-mail: support@dj-dj.be
|
||||||
|
|
||||||
|
Config files:
|
||||||
|
./config.json
|
||||||
|
./transcriptconfig.json
|
||||||
|
|
||||||
|
Send ./openticketdebug.txt when there are errors!
|
||||||
|
*/
|
||||||
|
|
||||||
|
const discord = require("discord.js")
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const {GatewayIntentBits,Partials} = discord
|
const {GatewayIntentBits,Partials} = discord
|
||||||
const client = new discord.Client({
|
const APIBase = require("./core/api/modules/base")
|
||||||
intents:[
|
if (APIBase.embeddedMode){
|
||||||
GatewayIntentBits.DirectMessages,
|
var tempClient = APIBase.clientLocation
|
||||||
GatewayIntentBits.GuildInvites,
|
}else{
|
||||||
GatewayIntentBits.GuildMembers,
|
var tempClient = new discord.Client({
|
||||||
GatewayIntentBits.GuildMessages,
|
intents:[
|
||||||
GatewayIntentBits.Guilds,
|
GatewayIntentBits.DirectMessages,
|
||||||
GatewayIntentBits.MessageContent
|
GatewayIntentBits.GuildInvites,
|
||||||
],
|
GatewayIntentBits.GuildMembers,
|
||||||
partials:[Partials.Channel,Partials.Message]
|
GatewayIntentBits.GuildMessages,
|
||||||
})
|
GatewayIntentBits.Guilds,
|
||||||
|
GatewayIntentBits.MessageContent
|
||||||
|
],
|
||||||
|
partials:[Partials.Channel,Partials.Message]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**@type {discord.Client} */
|
||||||
|
const client = tempClient
|
||||||
exports.client = client
|
exports.client = client
|
||||||
|
|
||||||
client.setMaxListeners(50)
|
client.setMaxListeners(50)
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","created client")
|
||||||
|
|
||||||
if (process.argv[2]){
|
var tempconfig = require("./config.json")
|
||||||
if (process.argv[2].endsWith("d")){
|
/**@type {Boolean} */
|
||||||
var isDev = true
|
var isDevConfig = false
|
||||||
console.log("starting in dev mode...")
|
|
||||||
}else{var isDev = false}
|
|
||||||
}else{var isDev = false}
|
|
||||||
|
|
||||||
exports.developerMode = isDev
|
if (process.argv.some((v) => v == "--devconfig")){
|
||||||
|
isDevConfig = true
|
||||||
|
try{
|
||||||
|
tempconfig = require("./devconfig.json")
|
||||||
|
}catch{tempconfig = require("./config.json")}
|
||||||
|
}else{
|
||||||
|
tempconfig = require("./config.json")
|
||||||
|
}
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded flags")
|
||||||
|
|
||||||
|
exports.developerConfig = isDevConfig
|
||||||
const language = require("./core/languageManager").language
|
const language = require("./core/languageManager").language
|
||||||
exports.language = language
|
exports.language = language
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded language")
|
||||||
|
|
||||||
if (isDev){
|
|
||||||
try {
|
const config = tempconfig
|
||||||
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.config = config
|
||||||
|
|
||||||
|
const tsconfig = isDevConfig ? require("./devtsconfig.json") : require("./transcriptconfig.json")
|
||||||
|
exports.tsconfig = tsconfig
|
||||||
|
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded config")
|
||||||
exports.storage = require('./core/dynamicdatabase/storage')
|
exports.storage = require('./core/dynamicdatabase/storage')
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded storage")
|
||||||
|
|
||||||
exports.errorLog = require("./core/errorLogSystem")
|
exports.errorLog = require("./core/errorLogSystem")
|
||||||
const log = this.errorLog.log
|
const log = this.errorLog.log
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","LOADED LOGGING SYSTEM")
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","switching to new logs")
|
||||||
|
this.errorLog.log("debug","loaded new logs")
|
||||||
|
|
||||||
exports.hiddenData = require("./core/utils/hiddendata")
|
exports.hiddenData = require("./core/utils/hiddendata")
|
||||||
|
this.errorLog.log("debug","loaded hiddendataTM")
|
||||||
|
|
||||||
exports.embeds = {
|
exports.embeds = {
|
||||||
commands:require("./core/interactionHandlers/embeds/commands")
|
commands:require("./core/interactionHandlers/embeds/commands")
|
||||||
@@ -63,8 +114,10 @@ exports.buttons = {
|
|||||||
firstmsg:require("./core/interactionHandlers/buttons/firstmsg"),
|
firstmsg:require("./core/interactionHandlers/buttons/firstmsg"),
|
||||||
verifybars:require("./core/interactionHandlers/buttons/verifyBars")
|
verifybars:require("./core/interactionHandlers/buttons/verifyBars")
|
||||||
}
|
}
|
||||||
|
this.errorLog.log("debug","loaded buttons & embeds")
|
||||||
|
|
||||||
client.on('ready',async () => {
|
client.on('ready',async () => {
|
||||||
|
this.errorLog.log("debug","client logged in")
|
||||||
var statusSet = false
|
var statusSet = false
|
||||||
const setStatus = (type,text) => {
|
const setStatus = (type,text) => {
|
||||||
if (statusSet == true) return
|
if (statusSet == true) return
|
||||||
@@ -76,51 +129,37 @@ client.on('ready',async () => {
|
|||||||
}
|
}
|
||||||
client.user.setActivity(text,{type:getTypeEnum(type)})
|
client.user.setActivity(text,{type:getTypeEnum(type)})
|
||||||
statusSet = true
|
statusSet = true
|
||||||
log("system","loaded status",[{key:"type",value:type},{key:"text",value:text}])
|
|
||||||
}
|
}
|
||||||
|
this.errorLog.log("debug","bot status loaded")
|
||||||
|
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
if (!process.argv[2]){
|
require("./core/startscreen").run()
|
||||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
if (!process.argv[2] || (process.argv[2] && !process.argv[2].startsWith("slash"))){
|
||||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
this.errorLog.log("debug","loaded console interface")
|
||||||
require("./core/utils/warningManager")()
|
|
||||||
|
require("./core/utils/liveStatus")()
|
||||||
|
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
|
||||||
if (config.status.enabled){
|
if (config.status.enabled){
|
||||||
setStatus(config.status.type,config.status.text)
|
setStatus(config.status.type,config.status.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
log("system","bot logged in!")
|
var updatingSlash = false
|
||||||
|
if (fs.existsSync("./storage/slashcmdEnabled.txt")){
|
||||||
|
/**@type {"true"|"false"} */
|
||||||
|
const data = fs.readFileSync("./storage/slashcmdEnabled.txt").toString()
|
||||||
|
if (data === "true"){require("./core/slashSystem/autoSlashUpdate")(); updatingSlash = true}
|
||||||
|
}else{fs.writeFileSync("./storage/slashcmdEnabled.txt","false")}
|
||||||
|
|
||||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
try {
|
||||||
return
|
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||||
}
|
}catch{
|
||||||
|
this.errorLog.log("info","tried to cache user information, failed!")
|
||||||
if (process.argv[2] == "d"){
|
|
||||||
if (config.status.enabled){
|
|
||||||
setStatus(config.status.type,config.status.text)
|
|
||||||
}
|
}
|
||||||
}
|
require("./core/startscreen").headerDataReady(chalk,config.status,updatingSlash,false)
|
||||||
|
|
||||||
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{
|
}else{
|
||||||
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
require("./core/startscreen").headerDataReady(chalk,config.status,updatingSlash,true)
|
||||||
console.log("logs:\n================")
|
this.errorLog.log("debug","slashmode activated")
|
||||||
console.log("client logged in...")
|
|
||||||
console.log("loading files...")
|
|
||||||
if (process.argv[3] == "enable"){
|
if (process.argv[3] == "enable"){
|
||||||
console.log(chalk.green("switching to slashEnable.js"))
|
console.log(chalk.green("switching to slashEnable.js"))
|
||||||
require("./core/slashSystem/slashEnable")()
|
require("./core/slashSystem/slashEnable")()
|
||||||
@@ -128,23 +167,24 @@ client.on('ready',async () => {
|
|||||||
console.log(chalk.green("switching to slashDisable.js"))
|
console.log(chalk.green("switching to slashDisable.js"))
|
||||||
require("./core/slashSystem/slashDisable")()
|
require("./core/slashSystem/slashDisable")()
|
||||||
}else{
|
}else{
|
||||||
console.log(chalk.red("Internal Error: unknown slash mode!"))
|
console.log(chalk.bgRed("[SLASH CMD MANAGER]: unknown slash command action!"))
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//load plugins
|
//load plugins
|
||||||
require("./core/api/pluginlauncher")()
|
require("./core/api/pluginlauncher")()
|
||||||
|
this.errorLog.log("debug","loading plugins")
|
||||||
})
|
})
|
||||||
|
if (!require("./core/api/api.json").disable.checkerjs.all) require("./core/checker").checker()
|
||||||
if (!isDev){
|
this.errorLog.log("debug","loading checker.js")
|
||||||
require("./core/checker").checker()
|
this.errorLog.log("debug","checking config...")
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv[2] && process.argv[2].startsWith("slash")){
|
if (process.argv[2] && process.argv[2].startsWith("slash")){
|
||||||
//do nothing
|
//do nothing
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
this.errorLog.log("debug","LOADING COMMANDS")
|
||||||
//commands
|
//commands
|
||||||
require('./commands/ticket')()
|
require('./commands/ticket')()
|
||||||
require("./commands/help")()
|
require("./commands/help")()
|
||||||
@@ -154,29 +194,41 @@ if (process.argv[2] && process.argv[2].startsWith("slash")){
|
|||||||
require("./commands/add")()
|
require("./commands/add")()
|
||||||
require("./commands/remove")()
|
require("./commands/remove")()
|
||||||
require("./commands/reopen")()
|
require("./commands/reopen")()
|
||||||
|
require("./commands/claim")()
|
||||||
|
require("./commands/unclaim")()
|
||||||
|
require("./commands/change")()
|
||||||
|
|
||||||
|
this.errorLog.log("debug","LOADING CORE")
|
||||||
//core
|
//core
|
||||||
require('./core/ticketOpener')()
|
require('./core/ticketActions/ticketOpener')()
|
||||||
require("./core/ticketCloser").runThis()
|
|
||||||
//require("./core/closebuttons")() // => everything is now in ./core/interactionHandlers/
|
|
||||||
require("./core/reactionRoles")()
|
require("./core/reactionRoles")()
|
||||||
require("./core/ticketReopener").runThis()
|
|
||||||
|
|
||||||
|
this.errorLog.log("debug","LOADING INTERACTION HANDLERS")
|
||||||
//InteractionHandlers
|
//InteractionHandlers
|
||||||
require("./core/interactionHandlers/handlers/handlers")()
|
require("./core/interactionHandlers/handlers/handlers")()
|
||||||
|
|
||||||
|
//require("./test")()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.errorLog.log("debug","loading api")
|
||||||
const APIEvents = require("./core/api/modules/events")
|
const APIEvents = require("./core/api/modules/events")
|
||||||
|
const APIConfig = require("./core/api/api.json")
|
||||||
|
|
||||||
const debugLog = (debugString) => {
|
const debugLog = (debugString) => {
|
||||||
|
if (!APIConfig.disable.debug.all && !APIConfig.disable.debug.debuglogs){
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
||||||
|
}
|
||||||
|
this.errorLog.clearDebugFile()
|
||||||
}
|
}
|
||||||
const errorLog = (errorString,stack) => {
|
const errorLog = (errorString,stack) => {
|
||||||
|
if (!APIConfig.disable.debug.all){
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
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)
|
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
|
||||||
|
}
|
||||||
|
this.errorLog.clearDebugFile()
|
||||||
}
|
}
|
||||||
|
this.errorLog.log("debug","OT error system loaded successfully")
|
||||||
|
|
||||||
client.on("debug", async (message) => {
|
client.on("debug", async (message) => {
|
||||||
if (message.startsWith("Provided token:")){
|
if (message.startsWith("Provided token:")){
|
||||||
@@ -194,4 +246,5 @@ process.on("uncaughtException",async (error,origin) => {
|
|||||||
APIEvents.onError(error.name+": "+error.message,new Date())
|
APIEvents.onError(error.name+": "+error.message,new Date())
|
||||||
})
|
})
|
||||||
|
|
||||||
client.login(config.auth_token)
|
if (!APIBase.embeddedMode) client.login(config.auth_token)
|
||||||
|
this.errorLog.log("debug","login with token")
|
||||||
+83
-71
@@ -1,75 +1,87 @@
|
|||||||
{
|
{
|
||||||
"errors":{
|
"errors": {
|
||||||
"missingArgsTitle":"حجج باطلة",
|
"missingArgsTitle": "قيمة غير صالحة!",
|
||||||
"missingArgsDescription":"حجة مفقودة",
|
"missingArgsDescription": "قيمة مفقودة",
|
||||||
"noPermsTitle":"ليس لديك إذن",
|
"noPermsTitle": "ليس لديك برمشنات !",
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
"noPermsDescription": "أنت بحاجة الى برمشن `ADMINISTRATOR` او أن تكون في قائمة المسموح بهم!",
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
"noPermsDelete": "فقط الإداريين يمكنهم حذف التكت!",
|
||||||
"chooseFromListTitle":"بطاقة التعريف غير صالحة",
|
"chooseFromListTitle": "Invalid ID",
|
||||||
"chooseFromListDescription":"اختر أحد المعرفات أدناه:",
|
"chooseFromListDescription": "قم بأختيار أحد من الأيديات من الأسفل:",
|
||||||
"boterror":"مشكلة في الروبوت",
|
"boterror": "خلل في البوت !",
|
||||||
"notInTicketTitle":"أنت لست في تذكرة!",
|
"notInTicketTitle": "انت لست في تكت!",
|
||||||
"notInTicketDescription":"هذا الأمر لا يعمل خارج التذاكر!",
|
"notInTicketDescription": "هذا الأمر لا يعمل خارج التكت!",
|
||||||
"ticketDoesntExist":"هذه التذكرة لم تعد موجودة!",
|
"ticketDoesntExist": "هذا التكت لم يعد فعال!",
|
||||||
"roleDoesntExist":"هذا الدور لم يعد موجودًا!",
|
"roleDoesntExist": "خطاً ,لم تعد الرتبة موجوده!",
|
||||||
"anotherOption":"هذا الخيار ليس تذكرة بل نوع آخر!",
|
"anotherOption": "هذا الخيار ليس التكت و لكنه شيء أخر!",
|
||||||
"maxAmountTitle":"بلغ الحد الأقصى!",
|
"maxAmountTitle": "خطأ , تم الوصول الى الحد الأقصى!",
|
||||||
"maxAmountDescription":"لقد وصلت إلى الحد الأقصى لعدد التذاكر المسموح بها!\nلذلك لا يمكنك إنشاء واحدة جديدة!",
|
"maxAmountDescription": "لقد وصلت الى الحد الأقصى لعدد التكتات المسموحة بها!\nSo لا يمكنك فتح واحدة أخرى!",
|
||||||
"somethingWentWrong":"**هناك خطأ ما!**\nالرجاء المحاولة مرة أخرى!",
|
"somethingWentWrong": "**هناك خطاً!**\nأعد المحاولة لاحقاً!"
|
||||||
"somethingWentWrongTranscript":"**حدث خطأ ما أثناء كتابة النص!**\nالرجاء المحاولة مرة أخرى!"
|
},
|
||||||
|
"commands": {
|
||||||
|
"userAddedTitle": "تم أضافة {0} من المستخدمين في التكت!",
|
||||||
|
"userRemovedTitle": "تم أزالة {0} من المستخدمين من التكت!",
|
||||||
|
"renameTitle": "تم تغيير أسم التكت الى {0}!",
|
||||||
|
"closeTitle": "تم أغلاق التكت!",
|
||||||
|
"deleteTitle": " جاري حذف التكت...",
|
||||||
|
"reopenTitle": "إعادة فتح التكت!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
"changeTitle":"Changed ticket type to {0}!",
|
||||||
|
|
||||||
|
"ticketWarning": "هذا الأمبد موجود بالفعل في الرسالة بالأسفل!",
|
||||||
|
"maxTicketWarning": "**تحذير:** _يمكنك فقط فتح {0} تكت في الوقت!_"
|
||||||
|
},
|
||||||
|
"helpMenu": {
|
||||||
|
"title": "الأوامر المتاحة:",
|
||||||
|
"header1": "**أذهب الى {0} لإنشاء تذكرة!**\n\n",
|
||||||
|
"header2": "**قم بكتابة أمر `/new` او `/ticket` لفتح تكت!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd": "أنشاء أيمبد مع الأزرار. (الأداريين فقط)",
|
||||||
|
"renameCmd": "إعادة تسمية التكت. (بدون مسافات)",
|
||||||
|
"closeCmd": "أغلاق التكت.",
|
||||||
|
"deleteCmd": "حذف التكت.",
|
||||||
|
"addCmd": "إضافة مستخدم الى التكت.",
|
||||||
|
"removeCmd": "إزالة مستخدم من التكت.",
|
||||||
|
"reopenCmd": "إعادة فتح تكت بعد إغلاقة."
|
||||||
|
},
|
||||||
|
"buttons": {
|
||||||
|
"close": "إغلاق التكت",
|
||||||
|
"delete": "حذف التكت",
|
||||||
|
"reopen": "إعادة فتح التكت",
|
||||||
|
"closeWithReason":"close with reason"
|
||||||
|
},
|
||||||
|
"messages": {
|
||||||
|
"reopenTitle": "تم إعادة فتح التكت بنجاح!",
|
||||||
|
"reopenDescription": "لا تتردد في فتح التكت مرة أخرى , حظاً موفقاً!",
|
||||||
|
"closedTitle": "تم إغلاق التكت!",
|
||||||
|
"closedDescription": "فقط الأداريين يمكنهم التحدث في هذا التكت الأن!\n\n*أضغط على الزر بالأسفل لحذف التكت او إعادة فتحة مجدداً!*",
|
||||||
|
"createdTitle": "تم إنشاء تكت!",
|
||||||
|
"createdDescription": "تم أنشاء تكت , قم بأنتظار الدعم في الطريق!",
|
||||||
|
|
||||||
|
"newTicketDmTitle": "تكت جديد!",
|
||||||
|
"closedTicketDmTitle": "تم إغلاق التكت!",
|
||||||
|
"deletedTicketDmTitle": "تم حذف التكت!",
|
||||||
|
"closedTicketDmDescription": "تم أغلاق تذكرتك من قبل إداري",
|
||||||
|
"deletedTicketDmDescription": "تم حذف تذكرتك من قبل إداري!",
|
||||||
|
"reopenTicketDmTitle": "تم إعادة فتح تذكرتك!",
|
||||||
|
"reopenTicketDmDescription": "تم إعادة فتح التكت!",
|
||||||
|
|
||||||
|
"chooseCategory": "أختر الكتقاجوري:",
|
||||||
|
"gettingdeleted": "يتم حذف التكت...",
|
||||||
|
|
||||||
|
"none": "لا يوجد",
|
||||||
|
"reason": "سبب",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
},
|
},
|
||||||
"commands":{
|
"transcripts":{
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
"title":"Transcript",
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
"processed":"This transcript is being processed",
|
||||||
"renameTitle":"Changed the name to {0}!",
|
"wait":"Please wait!",
|
||||||
"closeTitle":"Closed this ticket!",
|
"estimated":"Estimated time",
|
||||||
"deleteTitle":"Deleting this ticket...",
|
"available":"The transcript is available here"
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+18
-6
@@ -15,8 +15,7 @@
|
|||||||
"anotherOption":"This option is not a ticket but another type!",
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
"maxAmountTitle":"Max amount reached!",
|
"maxAmountTitle":"Max amount reached!",
|
||||||
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
"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!",
|
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!"
|
||||||
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
|
||||||
},
|
},
|
||||||
"commands":{
|
"commands":{
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
"userAddedTitle":"Added {0} to this ticket!",
|
||||||
@@ -25,6 +24,9 @@
|
|||||||
"closeTitle":"Closed this ticket!",
|
"closeTitle":"Closed this ticket!",
|
||||||
"deleteTitle":"Deleting this ticket...",
|
"deleteTitle":"Deleting this ticket...",
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
"changeTitle":"Changed ticket type to {0}!",
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
"ticketWarning":"The embed is in the message below!",
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
"close":"Close Ticket",
|
"close":"Close Ticket",
|
||||||
"delete":"Delete Ticket",
|
"delete":"Delete Ticket",
|
||||||
"reopen":"Re-Open Ticket",
|
"reopen":"Re-Open Ticket",
|
||||||
"sendTranscript":"Transcript"
|
"closeWithReason":"close with reason"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
@@ -63,13 +65,23 @@
|
|||||||
"deletedTicketDmDescription":"Your ticket is deleted!",
|
"deletedTicketDmDescription":"Your ticket is deleted!",
|
||||||
"reopenTicketDmTitle":"Ticket Re-opened!",
|
"reopenTicketDmTitle":"Ticket Re-opened!",
|
||||||
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
||||||
"newTranscriptTitle":"A new transcript is here!",
|
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"choose a category:",
|
"chooseCategory":"choose a category:",
|
||||||
"gettingdeleted":"Ticket is getting deleted...",
|
"gettingdeleted":"Ticket is getting deleted...",
|
||||||
|
|
||||||
"none":"none",
|
"none":"none",
|
||||||
"reason":"reason"
|
"reason":"reason",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcript",
|
||||||
|
"processed":"This transcript is being processed",
|
||||||
|
"wait":"Please wait!",
|
||||||
|
"estimated":"Estimated time",
|
||||||
|
"available":"The transcript is available here"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+66
-54
@@ -1,75 +1,87 @@
|
|||||||
{
|
{
|
||||||
"errors":{
|
"errors":{
|
||||||
"missingArgsTitle":"Neplatné argumenty",
|
"missingArgsTitle":"Neplatny Argument!",
|
||||||
"missingArgsDescription":"Chybí argumenty",
|
"missingArgsDescription":"Chybí Argument",
|
||||||
"noPermsTitle":"Nemáš práva!",
|
"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!",
|
"noPermsDescription":"Potřebujes `ADMINISTRATOR`roli nebo byt v listině povolenych roli!",
|
||||||
"noPermsDelete":"Pouze admin může smazat ticket!",
|
"noPermsDelete":"Pouze Admini muůřou mazat ticket!",
|
||||||
"chooseFromListTitle":"Neplatné ID",
|
"chooseFromListTitle":"Neplatný ID",
|
||||||
"chooseFromListDescription":"Vyber si z těchto ID:",
|
"chooseFromListDescription":"Vyber si jedno z ID níže:",
|
||||||
"boterror":"Error!",
|
"boterror":"Bot Chyba!",
|
||||||
"notInTicketTitle":"Nejsi v ticketu!",
|
"notInTicketTitle":"Nejsi v ticketu!",
|
||||||
"notInTicketDescription":"Tento příkaz nefunguje mimo tickety!",
|
"notInTicketDescription":"Tenhle příkaz nefunguje mimo ticket!",
|
||||||
"ticketDoesntExist":"Tento ticket už bohužel neexistuje!",
|
"ticketDoesntExist":"Tenhle ticket už neexistuje !",
|
||||||
"roleDoesntExist":"Tato role bohužel neexistuje!",
|
"roleDoesntExist":"Tenhle role už neexistuje!",
|
||||||
"anotherOption":"Tato možnost není ticket ale něco jiného!",
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
"maxAmountTitle":"Maximální počet ticketů dosažen!",
|
"maxAmountTitle":"Max počet byl dosáhnut!",
|
||||||
"maxAmountDescription":"Dosáhl jsi maximálního povoleného počtu ticketů!\n Nemůžeš si vytvořit nový!",
|
"maxAmountDescription":"Dosáhl jsi max počet povolených ticketu!\nSo nemůžeš si vytvořit nový!",
|
||||||
"somethingWentWrong":"**Něco je špatně**\nProsím zkus to příště znovu!",
|
"somethingWentWrong":"**Něco se pokazilo!**\nProsím zkus to jindy!"
|
||||||
"somethingWentWrongTranscript":"Něco je špatně s transcriptem!**\nProsím zkus to příště znovu!"
|
|
||||||
},
|
},
|
||||||
"commands":{
|
"commands":{
|
||||||
"userAddedTitle":"{0} byl přidán do ticketu!",
|
"userAddedTitle":"Přidat {0} do tohohle ticketu!",
|
||||||
"userRemovedTitle":"{0} byl odebrám z ticketu!",
|
"userRemovedTitle":"Odstranit {0} z tohohle ticketu!",
|
||||||
"renameTitle":"Jméno bylo změněno!",
|
"renameTitle":"Změnit jmeno na {0}!",
|
||||||
"closeTitle":"Zavři tento ticket!",
|
"closeTitle":"Zavři tenhle ticket!",
|
||||||
"deleteTitle":"Smaž tento ticket!",
|
"deleteTitle":"Mažu ticket...",
|
||||||
"reopenTitle":"Znovu otevři ticket!",
|
"reopenTitle":"Znovu otevíram ticket",
|
||||||
|
"claimTitle":"Nyní jsi převzal ticket {0}",
|
||||||
|
"unclaimTitle":"Tento ticketu už je převzatý!",
|
||||||
|
"changeTitle":"Změnil jsi typ ticketu na {0}!",
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
"ticketWarning":"The embed is in the message below!",
|
||||||
"maxTicketWarning":"**Varovaní:** _Můžeš si vytvořit použe {0} ticket(s) v jednu chvíli!_"
|
"maxTicketWarning":"**Warning:** _Můžeš vytvořit pouze {0} v tuhle chvíli!_"
|
||||||
},
|
},
|
||||||
"helpMenu":{
|
"helpMenu":{
|
||||||
"title":"Příkazy:",
|
"title":"Dostupné příkazy:",
|
||||||
"header1":"**Běž {0} vytvořit si ticket!**\n\n",
|
"header1":"**Běž do {0} pro vytvoření ticketi!**\n\n",
|
||||||
"header2":"**Použij příkaz `/new` nebo `/ticket` k vytvoření ticketu!**\n\n",
|
"header2":"**Použíj příkaz `/nový` nebo `/ticket` pro vytvoření ticketu**\n\n",
|
||||||
|
|
||||||
"msgCmd":"Vytvoř možnost otevírat tickety přes tlačítko. (ADMIN)",
|
"msgCmd":"Vytvoř embed s tlačíky. (admins only)",
|
||||||
"renameCmd":"Přejmenovat ticket. (Žádné mezery)",
|
"renameCmd":"Přejmenovat ticket. (no spaces)",
|
||||||
"closeCmd":"Zavři ticket.",
|
"closeCmd":"Zavřít ticket.",
|
||||||
"deleteCmd":"Smaž ticket.",
|
"deleteCmd":"Odstranit ticket.",
|
||||||
"addCmd":"Přidej člena do ticketu.",
|
"addCmd":"Pridat uživatele do ticketu.",
|
||||||
"removeCmd":"Odebere člena z ticketu.",
|
"removeCmd":"Odebrat uživatele z ticketu.",
|
||||||
"reopenCmd":"Znovu otevři ticket po uzavření."
|
"reopenCmd":"Re-Open a ticket after it was closed."
|
||||||
},
|
},
|
||||||
"buttons":{
|
"buttons":{
|
||||||
"close":"Zavři ticket",
|
"close":"Zavřit ticket",
|
||||||
"delete":"Smaž ticket",
|
"delete":"Vymazat ticket",
|
||||||
"reopen":"Znovu otevři ticket",
|
"reopen":"Znovu otevřít ticket",
|
||||||
"sendTranscript":"Odešli log ticketu"
|
"closeWithReason":"zavřít s důvodem"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"Ticket znovu otevřen!",
|
"reopenTitle":"Znovu otevřit ticket!",
|
||||||
"reopenDescription":"Cítím se skvěle že si můžeme zase povídat!",
|
"reopenDescription":"Klidně napiš znova!",
|
||||||
"closedTitle":"Zavřený ticket!",
|
"closedTitle":"Zavřít tenhle 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!*",
|
"closedDescription":"Pouze admini muzou zde psát ted!\n\n*Klikni na tlačítko níže pro smazání nebo pro znovu otevření tohohle ticketu!*",
|
||||||
"createdTitle":"Ticket vytvořen!",
|
"createdTitle":"Ticket otevřen!",
|
||||||
"createdDescription":"Váš tiket je vytvořen, můžete ho zjistit pomocí pingu!",
|
"createdDescription":"Tvůj ticket je vytvořem, můžeš si ho všimnout pomocí pingu!",
|
||||||
|
|
||||||
"newTicketDmTitle":"Nový ticket!",
|
"newTicketDmTitle":"Nový ticket!",
|
||||||
"closedTicketDmTitle":"Ticket uzavřen!",
|
"closedTicketDmTitle":"Ticket Zavřený!",
|
||||||
"deletedTicketDmTitle":"Ticket smazán!",
|
"deletedTicketDmTitle":"Ticket Odstranen!",
|
||||||
"closedTicketDmDescription":"Tvůj ticket byl uzavřen!",
|
"closedTicketDmDescription":"Tvuj ticket je uzavřen!",
|
||||||
"deletedTicketDmDescription":"Tvůj ticket byl smazán!",
|
"deletedTicketDmDescription":"Tvuj ticket byl smazan!",
|
||||||
"reopenTicketDmTitle":"Ticket znovu otevřen!",
|
"reopenTicketDmTitle":"Ticket je znovu otevřený!",
|
||||||
"reopenTicketDmDescription":"Tvůj ticket byl znovu otevřen!",
|
"reopenTicketDmDescription":"Tvuj ticket byl znovu ovetřený!",
|
||||||
"newTranscriptTitle":"Nový log ticketu je zde!",
|
|
||||||
"hereIsTheTranscript":"Zde je log:",
|
|
||||||
|
|
||||||
"chooseCategory":"Vyber kategorii:",
|
"chooseCategory":"Vyber si kategorii:",
|
||||||
"gettingdeleted":"Ticket bude smazán",
|
"gettingdeleted":"Ticket bude vymazan...",
|
||||||
|
|
||||||
"none":"nic",
|
"none":"žádný",
|
||||||
"reason":"důvod"
|
"reason":"důvod",
|
||||||
|
|
||||||
|
"deletedby":"smazano uzivatelem",
|
||||||
|
"closedby":"zavreno uzivatelem",
|
||||||
|
"modalreason":"Jakž byl důvod k zavření toho ticketu?",
|
||||||
|
"chooseATicket": "Vyber ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Přepis",
|
||||||
|
"processed":"Tento přepis se zpracoval",
|
||||||
|
"wait":"Prosím počkej!",
|
||||||
|
"estimated":"Odhadovaný čas",
|
||||||
|
"available":"Záloha je uložena zde!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"errors": {
|
||||||
|
"missingArgsTitle": "Ugyldigt Argument!",
|
||||||
|
"missingArgsDescription": "Manglende Argument",
|
||||||
|
"noPermsTitle": "Ikke tilladelse!",
|
||||||
|
"noPermsDescription": "Du skal have tilladelsen `ADMINISTRATOR` eller være på listen over tilladte roller!",
|
||||||
|
"noPermsDelete": "Kun administratorer kan slette en ticket!",
|
||||||
|
"chooseFromListTitle": "Ugyldigt ID",
|
||||||
|
"chooseFromListDescription": "Vælg et af id'erne nedenfor:",
|
||||||
|
"boterror": "Bot Fejl!",
|
||||||
|
"notInTicketTitle": "Du er ikke i en ticket!",
|
||||||
|
"notInTicketDescription": "Denne kommando virker ikke udenfor tickets!",
|
||||||
|
"ticketDoesntExist": "Denne ticket findes ikke længere!",
|
||||||
|
"roleDoesntExist": "Denne rolle eksisterer ikke længere!",
|
||||||
|
"anotherOption": "Denne mulighed er ikke en ticket, men en anden type!",
|
||||||
|
"maxAmountTitle": "Maks. mængde opnået!",
|
||||||
|
"maxAmountDescription": "Du har nået det maksimale antal tilladte tickets!\nSå du kan ikke oprette en ny!",
|
||||||
|
"somethingWentWrong": "**Noget gik galt!**\nPrøv venligst igen en anden gang!"
|
||||||
|
},
|
||||||
|
"commands": {
|
||||||
|
"userAddedTitle": "Føjede {0} til denne ticket!",
|
||||||
|
"userRemovedTitle": "Fjernede {0} fra denne ticket!",
|
||||||
|
"renameTitle": "Ændrede navnet til {0}!",
|
||||||
|
"closeTitle": "Lukket denne ticket!",
|
||||||
|
"deleteTitle": "Sletter denne ticket...",
|
||||||
|
"reopenTitle": "Genåbnede denne ticket!",
|
||||||
|
"claimTitle": "Denne ticket er nu krævet til {0}",
|
||||||
|
"unclaimTitle": "Der gøres ikke krav på denne ticket længere!",
|
||||||
|
"changeTitle": "Ændrede ticket type til {0}!",
|
||||||
|
|
||||||
|
"ticketWarning": "Embedet er i meddelelsen nedenfor!",
|
||||||
|
"maxTicketWarning": "**Warning:** _Du kan kun oprette {0} ticket(s) ad gangen!_"
|
||||||
|
},
|
||||||
|
"helpMenu": {
|
||||||
|
"title": "Tilgængelige kommandoer:",
|
||||||
|
"header1": "**Gå til {0} for at oprette en ticket!**\n\n",
|
||||||
|
"header2": "**Kør kommandoen `/new` eller `/ticket` for at oprette en billet!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd": "Lav et embed med buttons. (kun administratorer)",
|
||||||
|
"renameCmd": "Omdøb en ticket. (Ingen Mellemrum!!)",
|
||||||
|
"closeCmd": "Luk en ticket.",
|
||||||
|
"deleteCmd": "Slet en ticket.",
|
||||||
|
"addCmd": "Tilføj en bruger til ticketen.",
|
||||||
|
"removeCmd": "Fjern en bruger fra ticketen.",
|
||||||
|
"reopenCmd": "Genåbn en ticket, efter at den var lukket."
|
||||||
|
},
|
||||||
|
"buttons": {
|
||||||
|
"close": "Luk Ticket",
|
||||||
|
"delete": "Slet Ticket",
|
||||||
|
"reopen": "Genåben Ticket",
|
||||||
|
"closeWithReason": "Luk med grundlag"
|
||||||
|
},
|
||||||
|
"messages": {
|
||||||
|
"reopenTitle": "Genåbnede denne ticket!",
|
||||||
|
"reopenDescription": "Snak gerne igen!",
|
||||||
|
"closedTitle": "Lukket denne ticket!",
|
||||||
|
"closedDescription": "Kun administratorer kan tale i denne billet nu!\n\n*Klik på knappen nedenfor for at slette eller genåbne denne billet!",
|
||||||
|
"createdTitle": "Ticket Oprettet!",
|
||||||
|
"createdDescription": "Din ticket er oprettet, du kan registrere den ved et ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle": "Nt Ticket!",
|
||||||
|
"closedTicketDmTitle": "Ticket Lukket!",
|
||||||
|
"deletedTicketDmTitle": "Ticket Slettet!",
|
||||||
|
"closedTicketDmDescription": "Din ticket er lukket!",
|
||||||
|
"deletedTicketDmDescription": "Din ticket er slettet!",
|
||||||
|
"reopenTicketDmTitle": "Ticket Genåbnet!",
|
||||||
|
"reopenTicketDmDescription": "Din ticket er genåbnet!",
|
||||||
|
|
||||||
|
"chooseCategory": "vælg en kategori:",
|
||||||
|
"gettingdeleted": "Ticketen bliver slettet...",
|
||||||
|
|
||||||
|
"none": "intet",
|
||||||
|
"reason": "grundlag",
|
||||||
|
|
||||||
|
"deletedby": "slettet af",
|
||||||
|
"closedby": "lukket af",
|
||||||
|
"modalreason": "Hvad er grunden til at lukke denne ticket?",
|
||||||
|
"chooseATicket": "Vælg en ticket"
|
||||||
|
},
|
||||||
|
"transcripts": {
|
||||||
|
"title": "Transcript",
|
||||||
|
"processed": "Dette transcript er under behandling",
|
||||||
|
"wait": "Vent venligst!",
|
||||||
|
"estimated": "Estimeret tid",
|
||||||
|
"available": "Transcriptet er tilgængelig her"
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
-7
@@ -15,8 +15,7 @@
|
|||||||
"anotherOption":"Deze optie is niet een ticket, maar een ander type!",
|
"anotherOption":"Deze optie is niet een ticket, maar een ander type!",
|
||||||
"maxAmountTitle":"Maximum numer bereikt!",
|
"maxAmountTitle":"Maximum numer bereikt!",
|
||||||
"maxAmountDescription":"Je hebt het maximum aantal openstaande tickets bereikt!\nDus je kan geen nieuwe meer maken!",
|
"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!",
|
"somethingWentWrong":"**Iets ging fout!**\nProbeer een andere keer opnieuw!"
|
||||||
"somethingWentWrongTranscript":"Iets ging fout terwijl het transcript gemaakt werd!**\nProbeer een andere keer opnieuw!"
|
|
||||||
},
|
},
|
||||||
"commands":{
|
"commands":{
|
||||||
"userAddedTitle":"{0} is toegevoegd aan dit ticket!",
|
"userAddedTitle":"{0} is toegevoegd aan dit ticket!",
|
||||||
@@ -25,6 +24,9 @@
|
|||||||
"closeTitle":"Ticket gesloten!",
|
"closeTitle":"Ticket gesloten!",
|
||||||
"deleteTitle":"Ticket aan het verwijderen...",
|
"deleteTitle":"Ticket aan het verwijderen...",
|
||||||
"reopenTitle":"Ticket heropend!",
|
"reopenTitle":"Ticket heropend!",
|
||||||
|
"claimTitle":"Dit ticket is geclaimed door {0}",
|
||||||
|
"unclaimTitle":"Dit ticket is niet meer geclaimed!",
|
||||||
|
"changeTitle":"Ticket type veranderd naar {0}!",
|
||||||
|
|
||||||
"ticketWarning":"De embed is in het bericht hier onder!",
|
"ticketWarning":"De embed is in het bericht hier onder!",
|
||||||
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd maken!_"
|
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd maken!_"
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
"close":"Sluit Ticket",
|
"close":"Sluit Ticket",
|
||||||
"delete":"Verwijder Ticket",
|
"delete":"Verwijder Ticket",
|
||||||
"reopen":"Heropen Ticket",
|
"reopen":"Heropen Ticket",
|
||||||
"sendTranscript":"Transcript"
|
"closeWithReason":"sluit met reden"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"Ticket heropend!",
|
"reopenTitle":"Ticket heropend!",
|
||||||
@@ -63,13 +65,23 @@
|
|||||||
"deletedTicketDmDescription":"Je ticket is verwijderd!",
|
"deletedTicketDmDescription":"Je ticket is verwijderd!",
|
||||||
"reopenTicketDmTitle":"Ticket Heropend!",
|
"reopenTicketDmTitle":"Ticket Heropend!",
|
||||||
"reopenTicketDmDescription":"Je ticket is heropend!",
|
"reopenTicketDmDescription":"Je ticket is heropend!",
|
||||||
"newTranscriptTitle":"Er is een nieuw transcript!",
|
|
||||||
"hereIsTheTranscript":"Hier is het transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"kies een categorie:",
|
"chooseCategory":"kies een categorie:",
|
||||||
"gettingdeleted":"Ticket wordt verwijderd...",
|
"gettingdeleted":"Ticket wordt verwijderd...",
|
||||||
|
|
||||||
"none":"geen",
|
"none":"geen",
|
||||||
"reason":"reden"
|
"reason":"reden",
|
||||||
|
|
||||||
|
"deletedby":"verwijderd door",
|
||||||
|
"closedby":"gesloten door",
|
||||||
|
"modalreason":"Wat is de reden om dit ticket te sluiten?",
|
||||||
|
"chooseATicket": "Kies een ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcript",
|
||||||
|
"processed":"Dit transcript wordt verwerkt",
|
||||||
|
"wait":"Gelieve te wachten!",
|
||||||
|
"estimated":"Geschatte tijd",
|
||||||
|
"available":"Het transcript is hier beschikbaar"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+18
-6
@@ -15,8 +15,7 @@
|
|||||||
"anotherOption":"This option is not a ticket but another type!",
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
"maxAmountTitle":"Max amount reached!",
|
"maxAmountTitle":"Max amount reached!",
|
||||||
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
"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!",
|
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!"
|
||||||
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
|
||||||
},
|
},
|
||||||
"commands":{
|
"commands":{
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
"userAddedTitle":"Added {0} to this ticket!",
|
||||||
@@ -25,6 +24,9 @@
|
|||||||
"closeTitle":"Closed this ticket!",
|
"closeTitle":"Closed this ticket!",
|
||||||
"deleteTitle":"Deleting this ticket...",
|
"deleteTitle":"Deleting this ticket...",
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
"changeTitle":"Changed ticket type to {0}!",
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
"ticketWarning":"The embed is in the message below!",
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
"close":"Close Ticket",
|
"close":"Close Ticket",
|
||||||
"delete":"Delete Ticket",
|
"delete":"Delete Ticket",
|
||||||
"reopen":"Re-Open Ticket",
|
"reopen":"Re-Open Ticket",
|
||||||
"sendTranscript":"Transcript"
|
"closeWithReason":"close with reason"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
@@ -63,13 +65,23 @@
|
|||||||
"deletedTicketDmDescription":"Your ticket is deleted!",
|
"deletedTicketDmDescription":"Your ticket is deleted!",
|
||||||
"reopenTicketDmTitle":"Ticket Re-opened!",
|
"reopenTicketDmTitle":"Ticket Re-opened!",
|
||||||
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
||||||
"newTranscriptTitle":"A new transcript is here!",
|
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"choose a category:",
|
"chooseCategory":"choose a category:",
|
||||||
"gettingdeleted":"Ticket is getting deleted...",
|
"gettingdeleted":"Ticket is getting deleted...",
|
||||||
|
|
||||||
"none":"none",
|
"none":"none",
|
||||||
"reason":"reason"
|
"reason":"reason",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcript",
|
||||||
|
"processed":"This transcript is being processed",
|
||||||
|
"wait":"Please wait!",
|
||||||
|
"estimated":"Estimated time",
|
||||||
|
"available":"The transcript is available here"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+20
-8
@@ -15,8 +15,7 @@
|
|||||||
"anotherOption":"Cette option n'est pas un ticket mais un autre type!",
|
"anotherOption":"Cette option n'est pas un ticket mais un autre type!",
|
||||||
"maxAmountTitle":"Montant maximum atteint!",
|
"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!",
|
"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!",
|
"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":{
|
"commands":{
|
||||||
"userAddedTitle":"{0} a été ajouté à ce ticket!",
|
"userAddedTitle":"{0} a été ajouté à ce ticket!",
|
||||||
@@ -25,6 +24,9 @@
|
|||||||
"closeTitle":"Fermé ce ticket!",
|
"closeTitle":"Fermé ce ticket!",
|
||||||
"deleteTitle":"Suppression de ce ticket...",
|
"deleteTitle":"Suppression de ce ticket...",
|
||||||
"reopenTitle":"A rouvert ce ticket!",
|
"reopenTitle":"A rouvert ce ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
"changeTitle":"Changed ticket type to {0}!",
|
||||||
|
|
||||||
"ticketWarning":"L'intégration est dans le message ci-dessous!",
|
"ticketWarning":"L'intégration est dans le message ci-dessous!",
|
||||||
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} ticket(s) à la fois !_"
|
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} ticket(s) à la fois !_"
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
"close":"Fermer le ticket",
|
"close":"Fermer le ticket",
|
||||||
"delete":"Supprimer le billet",
|
"delete":"Supprimer le billet",
|
||||||
"reopen":"Billet de réouverture",
|
"reopen":"Billet de réouverture",
|
||||||
"sendTranscript":"Transcript"
|
"closeWithReason":"fermer avec une raison"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"A rouvert ce ticket!",
|
"reopenTitle":"A rouvert ce ticket!",
|
||||||
@@ -63,13 +65,23 @@
|
|||||||
"deletedTicketDmDescription":"Votre billet est supprimé !",
|
"deletedTicketDmDescription":"Votre billet est supprimé !",
|
||||||
"reopenTicketDmTitle":"Billet rouvert!",
|
"reopenTicketDmTitle":"Billet rouvert!",
|
||||||
"reopenTicketDmDescription":"Votre billet est rouvert !",
|
"reopenTicketDmDescription":"Votre billet est rouvert !",
|
||||||
"newTranscriptTitle":"Une nouvelle transcription est ici!",
|
|
||||||
"hereIsTheTranscript":"Voici la transcription :",
|
|
||||||
|
|
||||||
"chooseCategory":"choisissez une catégorie:",
|
"chooseCategory":"choisissez une catégorie:",
|
||||||
"gettingdeleted":"Le ticket est en cours de suppression...",
|
"gettingdeleted":"Le ticket est en cours de suppression...",
|
||||||
|
|
||||||
"none":"rien",
|
"none":"rien",
|
||||||
"reason":"raison"
|
"reason":"raison",
|
||||||
|
|
||||||
|
"deletedby":"supprimé par",
|
||||||
|
"closedby":"fermé par",
|
||||||
|
"modalreason":"Qu’elle est la raison pour fermer ce ticket?",
|
||||||
|
"chooseATicket": "Choisir un ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcript",
|
||||||
|
"processed":"Cette transcript est en cours de traitement",
|
||||||
|
"wait":"S'il vous plait, attendez...",
|
||||||
|
"estimated":"Temps estime:",
|
||||||
|
"available":"La transcript est disponible ici"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+86
-74
@@ -1,75 +1,87 @@
|
|||||||
{
|
{
|
||||||
"errors":{
|
"errors":{
|
||||||
"missingArgsTitle":"Ungültiges Argument!",
|
"missingArgsTitle":"Ungültiges Argument!",
|
||||||
"missingArgsDescription":"Fehlendes Argument!",
|
"missingArgsDescription":"Fehlendes Argument!",
|
||||||
"noPermsTitle":"Du hast keine Rechte!",
|
"noPermsTitle":"Du hast keine Rechte!",
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
"noPermsDescription":"Du benötigst die `ADMINISTRATOR` Rechte oder die erlaubte Rolle",
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
"noPermsDelete":"Nur Administratoren können ein Ticket löschen!",
|
||||||
"chooseFromListTitle":"Ungültige ID",
|
"chooseFromListTitle":"Ungültige ID",
|
||||||
"chooseFromListDescription":"Wählen Sie eine der folgenden ID:",
|
"chooseFromListDescription":"Wählen Sie eine der folgenden ID's:",
|
||||||
"boterror":"Bot Fehler!",
|
"boterror":"Bot Fehler!",
|
||||||
"notInTicketTitle":"Du bist ein kein Ticket!",
|
"notInTicketTitle":"Du bist in keinem Ticket!",
|
||||||
"notInTicketDescription":"Der Befehl funktioniert nicht außerhalb eines Tickets!",
|
"notInTicketDescription":"Der Befehl funktioniert außerhalb eines Tickets nicht!",
|
||||||
"ticketDoesntExist":"Das Ticket Exisitert nicht mehr!",
|
"ticketDoesntExist":"Das Ticket exisitert nicht mehr!",
|
||||||
"roleDoesntExist":"Die Rolle Exisitiert nicht mehr!",
|
"roleDoesntExist":"Die Rolle exisitiert nicht mehr!",
|
||||||
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
||||||
"maxAmountTitle":"Das Limit wurde erreicht!",
|
"maxAmountTitle":"Das Limit wurde erreicht!",
|
||||||
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neue erstellen.!",
|
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neuen erstellen.!",
|
||||||
"somethingWentWrong":"**Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
"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":{
|
||||||
"commands":{
|
"userAddedTitle":"User geaddet!",
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
"userRemovedTitle":"User entfernt!",
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
"renameTitle":"Der Name wurde geändert!",
|
||||||
"renameTitle":"Changed the name to {0}!",
|
"closeTitle":"Dieses Ticket schließen!",
|
||||||
"closeTitle":"Closed this ticket!",
|
"deleteTitle":"Löschen Sie dieses Ticket!",
|
||||||
"deleteTitle":"Deleting this ticket...",
|
"reopenTitle":"Öffne dieses Ticket erneut!",
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
"claimTitle":"Das Ticket wurde beansprucht von {0}",
|
||||||
|
"unclaimTitle":"Das Ticket wrid nicht mehr beansprucht",
|
||||||
"ticketWarning":"The embed is in the message below!",
|
"changeTitle":"Ticket Typ wurde geändert auf {0}!",
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
"ticketWarning":"Die Einbettung befindet sich in der Nachricht unten!",
|
||||||
"helpMenu":{
|
"maxTicketWarning":"**Warnung:** _Sie können nur {0} ticket(s) erstellen zu einer Zeit!_"
|
||||||
"title":"Available Commands:",
|
},
|
||||||
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
"helpMenu":{
|
||||||
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
"title":"Hilfe Menu:",
|
||||||
|
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
||||||
"msgCmd":"Eine Einbettung mit Schaltflächen erzeugen. (nur admins)",
|
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
||||||
"renameCmd":"Ein Ticket umbenennen. (keine Leerzeichen)",
|
|
||||||
"closeCmd":"Schließen Sie ein Ticket.",
|
"msgCmd":"Eine Einbettung mit Schaltflächen erzeugen. (nur admins)",
|
||||||
"deleteCmd":"Ein Ticket löschen.",
|
"renameCmd":"Ein Ticket umbenennen. (keine Leerzeichen)",
|
||||||
"addCmd":"Fügen Sie dem Ticket einen Benutzer hinzu.",
|
"closeCmd":"Schließen Sie ein Ticket.",
|
||||||
"removeCmd":"Entfernen eines Benutzers aus dem Ticket.",
|
"deleteCmd":"Ein Ticket löschen.",
|
||||||
"reopenCmd":"Öffnen Sie ein Ticket erneut, nachdem es geschlossen wurde."
|
"addCmd":"Fügen Sie dem Ticket einen Benutzer hinzu.",
|
||||||
},
|
"removeCmd":"Entfernen eines Benutzers aus dem Ticket.",
|
||||||
"buttons":{
|
"reopenCmd":"Öffnen Sie ein Ticket erneut, nachdem es geschlossen wurde."
|
||||||
"close":"Ticket schließen",
|
},
|
||||||
"delete":"Ticket löschen",
|
"buttons":{
|
||||||
"reopen":"Ticket wieder öffnen",
|
"close":"Ticket schließen",
|
||||||
"sendTranscript":"Transcript-Datei senden"
|
"delete":"Ticket löschen",
|
||||||
},
|
"reopen":"Ticket wieder öffnen",
|
||||||
"messages":{
|
"closeWithReason":"Geschlossen mit dem Grund"
|
||||||
"reopenTitle":"Dieses Ticket wiedereröffnet!",
|
},
|
||||||
"reopenDescription":"Sie können gerne weiterreden!",
|
"messages":{
|
||||||
"closedTitle":"Dieses Ticket geschlossen!",
|
"reopenTitle":"Dieses Ticket wiedereröffnet!",
|
||||||
"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!*",
|
"reopenDescription":"Sie können gerne weiterreden!",
|
||||||
"createdTitle":"Ticket erstellt!",
|
"closedTitle":"Dieses Ticket geschlossen!",
|
||||||
"createdDescription":"Ihr Ticket ist erstellt, Sie können es durch einen Ping erkennen!",
|
"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!",
|
||||||
"newTicketDmTitle":"Neues Ticket!",
|
"createdDescription":"Ihr Ticket ist erstellt, Sie können es durch einen Ping erkennen!",
|
||||||
"closedTicketDmTitle":"Ticket schließen!",
|
|
||||||
"deletedTicketDmTitle":"Ticket löschen!",
|
"newTicketDmTitle":"Neues Ticket!",
|
||||||
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
"closedTicketDmTitle":"Ticket schließen!",
|
||||||
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
"deletedTicketDmTitle":"Ticket löschen!",
|
||||||
"reopenTicketDmTitle":"Ticket neu Eröffnen!",
|
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
||||||
"reopenTicketDmDescription":"Dein Ticket ist Neu eröffnet!",
|
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
||||||
"newTranscriptTitle":"Eine neue Transscript finden Sie hier!",
|
"newTranscriptTitle":"Eine neue Transcript finden Sie hier!",
|
||||||
"hereIsTheTranscript":"Hier ist das Transscript:",
|
"hereIsTheTranscript":"Hier ist das Transcript:",
|
||||||
|
|
||||||
"chooseCategory":"Wähle eine Kategorie:",
|
"chooseCategory":"Wähle eine Kategorie:",
|
||||||
"gettingdeleted":"Ticket wird gelöscht...",
|
"gettingdeleted":"Ticket wird gelöscht...",
|
||||||
|
|
||||||
"none":"none",
|
"none":"none",
|
||||||
"reason":"reason"
|
"reason":"Grund",
|
||||||
}
|
|
||||||
|
"deletedby":"Gelöscht von",
|
||||||
|
"closedby":"Geschlossen von",
|
||||||
|
"modalreason":"Was ist der Grund?",
|
||||||
|
"chooseATicket": "Wähle ein passendes Thema!"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcript",
|
||||||
|
"processed":"Das Transcript wird erstellt",
|
||||||
|
"wait":"Bitte warten!",
|
||||||
|
"estimated":"Verbleibende Zeit",
|
||||||
|
"available":"Das Transcript ist hier verfügbar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Argomenti non validi!",
|
||||||
|
"missingArgsDescription":"Argomenti mancanti",
|
||||||
|
"noPermsTitle":"Non hai i permessi sufficienti!",
|
||||||
|
"noPermsDescription":"Hai bisogno del permesso `ADMINISTRATOR` o essere nella lista dei ruoli consentiti!",
|
||||||
|
"noPermsDelete":"Solo gli amministratori possono eliminare i ticket!",
|
||||||
|
"chooseFromListTitle":"ID non valido",
|
||||||
|
"chooseFromListDescription":"Scegli uno degli id sottostanti:",
|
||||||
|
"boterror":"Errore del bot!",
|
||||||
|
"notInTicketTitle":"Non sei in un ticket!",
|
||||||
|
"notInTicketDescription":"Questo comando non funziona al di fuori di un ticket!",
|
||||||
|
"ticketDoesntExist":"Questo ticket non esiste!",
|
||||||
|
"roleDoesntExist":"Questo ruolo non esiste!",
|
||||||
|
"anotherOption":"Questa opzione non è un ticket ma un'altra!",
|
||||||
|
"maxAmountTitle":"Massimo ammontare raggiunto!",
|
||||||
|
"maxAmountDescription":"Hai raggiunto il massimo di ticket aperti!\nNon puoi creare altri!",
|
||||||
|
"somethingWentWrong":"*Qualcosa è andato storto!*\nPerfavore riprova un'altra volta!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Aggiunti {0} a questo ticket!",
|
||||||
|
"userRemovedTitle":"Rimossi {0} da questo ticket!",
|
||||||
|
"renameTitle":"Cambiato il nome a {0}!",
|
||||||
|
"closeTitle":"Ticket chiuso!",
|
||||||
|
"deleteTitle":"Eliminando questo ticket...",
|
||||||
|
"reopenTitle":"Ri-aperto questo ticket!",
|
||||||
|
"claimTitle":"Questo ticket è ora gestito da {0}",
|
||||||
|
"unclaimTitle":"Questo ticket non è più gestito!",
|
||||||
|
"changeTitle":"Cambiato il tipo di ticket in {0}!",
|
||||||
|
|
||||||
|
"ticketWarning":"L'embed è nel messaggio sotto!",
|
||||||
|
"maxTicketWarning":"*Attenzione:* Tu puoi creare solo {0} ticket alla volta!"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Comandi disponibili:",
|
||||||
|
"header1":"*Vai a {0} per creare un ticket!*\n\n",
|
||||||
|
"header2":"*Esegui il comando `/new` o `/ticket` per creare un ticket!*\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Crea un embed con bottoni. (solo amministratori)",
|
||||||
|
"renameCmd":"Rinomina un ticket. (senza spazi)",
|
||||||
|
"closeCmd":"Chiudi un ticket.",
|
||||||
|
"deleteCmd":"Elimina un ticket.",
|
||||||
|
"addCmd":"Aggiungi un utente al ticket.",
|
||||||
|
"removeCmd":"Rimuovi un utente da un ticket.",
|
||||||
|
"reopenCmd":"Ri-apri un ticket dopo averlo chiuso."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Chiudi",
|
||||||
|
"delete":"Elimini",
|
||||||
|
"reopen":"Ri-apri un ticket",
|
||||||
|
"closeWithReason":"chiudi con motivo"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Ticket ri-aperto!",
|
||||||
|
"reopenDescription":"Sentiti libero di parlare nuovamente!",
|
||||||
|
"closedTitle":"Ticket chiuso!",
|
||||||
|
"closedDescription":"Solo gli amministratori possono parlare in questo ticket ora!\n\n*Clicca sul pulsante sotto per eliminare o ri-aprire questo ticket!*",
|
||||||
|
"createdTitle":"Ticket creato!",
|
||||||
|
"createdDescription":"Il tuo ticket è stato creato, puoi capirlo dal ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Nuovo ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket chiuso!",
|
||||||
|
"deletedTicketDmTitle":"Ticket eliminato!",
|
||||||
|
"closedTicketDmDescription":"Il tuo ticket è chiuso!",
|
||||||
|
"deletedTicketDmDescription":"Il tuo ticket è eliminato!",
|
||||||
|
"reopenTicketDmTitle":"Ticket ri-aperto!",
|
||||||
|
"reopenTicketDmDescription":"Il tuo ticket è stato ri-aperto!",
|
||||||
|
|
||||||
|
"chooseCategory":"scegli una categoria:",
|
||||||
|
"gettingdeleted":"Il ticket sta per essere chiuso...",
|
||||||
|
|
||||||
|
"none":"nessuno",
|
||||||
|
"reason":"motivo",
|
||||||
|
|
||||||
|
"deletedby":"eliminato da",
|
||||||
|
"closedby":"chiuso da",
|
||||||
|
"modalreason":"Quale è il motivo per chiudere questo ticket?",
|
||||||
|
"chooseATicket": "Scegli un ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Trascrizione",
|
||||||
|
"processed":"Questo ticket sta per essere processato",
|
||||||
|
"wait":"Perfavore attendi!",
|
||||||
|
"estimated":"Tempo estimato",
|
||||||
|
"available":"La trascrizione è disponibile qui"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Argumentos inválidos!",
|
||||||
|
"missingArgsDescription":"Argumento ausente",
|
||||||
|
"noPermsTitle":"Sem permissões!",
|
||||||
|
"noPermsDescription":"Você precisa da permissão `ADMINISTRATOR` ou estar na lista de funções permitidas!",
|
||||||
|
"noPermsDelete":"Somente administradores podem deletar um ticket!",
|
||||||
|
"chooseFromListTitle":"ID inválido",
|
||||||
|
"chooseFromListDescription":"Escolha um dos IDs abaixo:",
|
||||||
|
"boterror":"Erro de bot!",
|
||||||
|
"notInTicketTitle":"Você não está em um ticket!",
|
||||||
|
"notInTicketDescription":"Este comando não funciona fora dos tickets!",
|
||||||
|
"ticketDoesntExist":"Este ticket não existe mais!",
|
||||||
|
"roleDoesntExist":"Esta função não existe mais!",
|
||||||
|
"anotherOption":"Esta opção não é um ticket, mas sim outro tipo!",
|
||||||
|
"maxAmountTitle":"Quantidade máxima atingida!",
|
||||||
|
"maxAmountDescription":"Você atingiu o número máximo de tickets permitidos!\nEntão você não pode criar um novo!",
|
||||||
|
"somethingWentWrong":"**Algo deu errado!**\nPor favor, tente novamente outra vez!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Adicionado {0} a este ticket!",
|
||||||
|
"userRemovedTitle":"Removido {0} deste ticket!",
|
||||||
|
"renameTitle":"Mudou o nome para {0}!",
|
||||||
|
"closeTitle":"Fechado este ticket!",
|
||||||
|
"deleteTitle":"Excluindo este ticket...",
|
||||||
|
"reopenTitle":"Reabriu este ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
"changeTitle":"Changed ticket type to {0}!",
|
||||||
|
|
||||||
|
"ticketWarning":"A incorporação está na mensagem abaixo!",
|
||||||
|
"maxTicketWarning":"**Cuidado:** _Você só pode criar {0} ticket(s) de cada vez!!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Comandos Disponíveis:",
|
||||||
|
"header1":"**Vá para {0} para criar um ticket!**\n\n",
|
||||||
|
"header2":"**Execute o comando `/new` ou `/ticket` para criar um ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Gerar uma incorporação com botões. (somente administradores)",
|
||||||
|
"renameCmd":"Renomear um ticket. (sem espaços)",
|
||||||
|
"closeCmd":"Fechar um ticket.",
|
||||||
|
"deleteCmd":"Excluir um ticket.",
|
||||||
|
"addCmd":"Adicionar um usuário ao ticket.",
|
||||||
|
"removeCmd":"Remover um usuário do ticket.",
|
||||||
|
"reopenCmd":"Reabra um ticket depois que ele foi fechado."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Fechar Ticket",
|
||||||
|
"delete":"Excluir Ticket",
|
||||||
|
"reopen":"Reabrir Ticket",
|
||||||
|
"closeWithReason":"fechado com motivo"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Reabriu este ticket!",
|
||||||
|
"reopenDescription":"Sinta-se à vontade para falar novamente!",
|
||||||
|
"closedTitle":"Fechado este ticket!",
|
||||||
|
"closedDescription":"Somente administradores podem falar neste ticket agora!\n\n*Clique no botão abaixo para excluir ou reabrir este ticket!*",
|
||||||
|
"createdTitle":"Ticket criado!",
|
||||||
|
"createdDescription":"Seu ticket foi criado, você pode detectá-lo com um ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Novo Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket fechado!",
|
||||||
|
"deletedTicketDmTitle":"Ticket excluído!",
|
||||||
|
"closedTicketDmDescription":"Seu ticket está fechado!",
|
||||||
|
"deletedTicketDmDescription":"Seu bilhete foi excluído!",
|
||||||
|
"reopenTicketDmTitle":"Ticket reaberto!",
|
||||||
|
"reopenTicketDmDescription":"Seu ticket foi reaberto!",
|
||||||
|
|
||||||
|
"chooseCategory":"Escolha a categoria:",
|
||||||
|
"gettingdeleted":"Ticket está sendo deletado...",
|
||||||
|
|
||||||
|
"none":"vazio",
|
||||||
|
"reason":"motivo",
|
||||||
|
|
||||||
|
"deletedby":"deletado por",
|
||||||
|
"closedby":"fechado por",
|
||||||
|
"modalreason":"Qual o motivo de fechar o ticket?",
|
||||||
|
|
||||||
|
"chooseATicket": "Fechar Ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcrever",
|
||||||
|
"processed":"A Transcrição está em andamento",
|
||||||
|
"wait":"Por favor espere!",
|
||||||
|
"estimated":"Tempo estimado",
|
||||||
|
"available":"A Transcrição está disponível aqui"
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
-7
@@ -15,8 +15,7 @@
|
|||||||
"anotherOption":"Aceasta optiune este altceva decat un tip de ticket!",
|
"anotherOption":"Aceasta optiune este altceva decat un tip de ticket!",
|
||||||
"maxAmountTitle":"Limita atinsa!",
|
"maxAmountTitle":"Limita atinsa!",
|
||||||
"maxAmountDescription":"Ai atins limita de tickets!\nAsa ca nu mai poti creea altele noi!",
|
"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!",
|
"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":{
|
"commands":{
|
||||||
"userAddedTitle":"{0} a fost adaugat in acest ticket!",
|
"userAddedTitle":"{0} a fost adaugat in acest ticket!",
|
||||||
@@ -25,6 +24,9 @@
|
|||||||
"closeTitle":"Ticket inchis!",
|
"closeTitle":"Ticket inchis!",
|
||||||
"deleteTitle":"Se sterge ticket-ul...",
|
"deleteTitle":"Se sterge ticket-ul...",
|
||||||
"reopenTitle":"Ticket Re-deschis!",
|
"reopenTitle":"Ticket Re-deschis!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
"changeTitle":"Changed ticket type to {0}!",
|
||||||
|
|
||||||
"ticketWarning":"Embed-ul se afla in mesajul de mai jos!",
|
"ticketWarning":"Embed-ul se afla in mesajul de mai jos!",
|
||||||
"maxTicketWarning":"**Avertizare:** _Poti creea doar {0} tickete active!_"
|
"maxTicketWarning":"**Avertizare:** _Poti creea doar {0} tickete active!_"
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
"close":"Inchide ticket-ul",
|
"close":"Inchide ticket-ul",
|
||||||
"delete":"Sterge ticket-ul",
|
"delete":"Sterge ticket-ul",
|
||||||
"reopen":"Re-deschide un ticket",
|
"reopen":"Re-deschide un ticket",
|
||||||
"sendTranscript":"Transcript"
|
"closeWithReason":"Inchide cu motiv"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"Ticket Re-deschis!",
|
"reopenTitle":"Ticket Re-deschis!",
|
||||||
@@ -63,13 +65,23 @@
|
|||||||
"deletedTicketDmDescription":"Ticket-ul tau este sters!",
|
"deletedTicketDmDescription":"Ticket-ul tau este sters!",
|
||||||
"reopenTicketDmTitle":"Ticket Re-deschis!",
|
"reopenTicketDmTitle":"Ticket Re-deschis!",
|
||||||
"reopenTicketDmDescription":"Ticket-ul tau este re-deschis!",
|
"reopenTicketDmDescription":"Ticket-ul tau este re-deschis!",
|
||||||
"newTranscriptTitle":"Un nou transcript este aici!",
|
|
||||||
"hereIsTheTranscript":"Aici este transcriptul:",
|
|
||||||
|
|
||||||
"chooseCategory":"Alege o categorie:",
|
"chooseCategory":"Alege o categorie:",
|
||||||
"gettingdeleted":"Ticket-ul se sterge...",
|
"gettingdeleted":"Ticket-ul se sterge...",
|
||||||
|
|
||||||
"none":"niciunul",
|
"none":"niciunul",
|
||||||
"reason":"Motiv"
|
"reason":"Motiv",
|
||||||
|
|
||||||
|
"deletedby":"Sters de",
|
||||||
|
"closedby":"Inchis de",
|
||||||
|
"modalreason":"Care este motivul pentru inchiderea acestui ticket?",
|
||||||
|
"chooseATicket": "Alege un ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcript",
|
||||||
|
"processed":"Transcript in curs de procesare...",
|
||||||
|
"wait":"Te rugam sa astepti!",
|
||||||
|
"estimated":"Timp estimat",
|
||||||
|
"available":"Transcriptul este disponibil aici"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Неверные аргументы!",
|
||||||
|
"missingArgsDescription":"Отсутствует аргумент",
|
||||||
|
"noPermsTitle":"Недостаточно прав!",
|
||||||
|
"noPermsDescription":"Вы должны иметь права `ADMINISTRATOR` или быть в списке разрешённых ролей!",
|
||||||
|
"noPermsDelete":"Только админы могут удалить тикет!",
|
||||||
|
"chooseFromListTitle":"Неверный ID",
|
||||||
|
"chooseFromListDescription":"Выберите один из id ниже:",
|
||||||
|
"boterror":"Ошибка бота!",
|
||||||
|
"notInTicketTitle":"Вы не в тикете!",
|
||||||
|
"notInTicketDescription":"Эта команда не работает вне тикетов!",
|
||||||
|
"ticketDoesntExist":"Этого тикета больше не существует!",
|
||||||
|
"roleDoesntExist":"Этой роли больше не существует!",
|
||||||
|
"anotherOption":"Эта опция не является тикетом, а представляет собой другой тип!",
|
||||||
|
"maxAmountTitle":"Максимальное количество достигнуто!",
|
||||||
|
"maxAmountDescription":"Вы достигли максимальное количество разрешённых тикетов!\nТеперь вы не можете создать ещё один!",
|
||||||
|
"somethingWentWrong":"**Что-то пошло не так!**\nПожайлуста, попробуйте в другой раз!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Добавлено {0} в этот тикет!",
|
||||||
|
"userRemovedTitle":"Удалено {0} из этого тикета!",
|
||||||
|
"renameTitle":"Изменено имя на {0}!",
|
||||||
|
"closeTitle":"Закрыл этот тикет!",
|
||||||
|
"deleteTitle":"Удаляем этот тикет...",
|
||||||
|
"reopenTitle":"Открываем заново этот тикет!",
|
||||||
|
"claimTitle":"Этот тикет теперь взят {0}",
|
||||||
|
"unclaimTitle":"Этот тикет никем не взят!",
|
||||||
|
"changeTitle":"Изменён тип тикета на {0}!",
|
||||||
|
|
||||||
|
"ticketWarning":"embed ниже сообщения!",
|
||||||
|
"maxTicketWarning":"**Предупреждение:** _Вы можете создать только {0} тикет(а/ов) в этот раз!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Доступные команды:",
|
||||||
|
"header1":"**Перейдите в {0}, чтобы создать тикет!**\n\n",
|
||||||
|
"header2":"**Выполните команду `/new` или `/ticket` для создания тикета!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Создать embed с кнопками. (только админам)",
|
||||||
|
"renameCmd":"Переименовать тикет. (без пробелов)",
|
||||||
|
"closeCmd":"Закрыть тикет.",
|
||||||
|
"deleteCmd":"Удалить тикет.",
|
||||||
|
"addCmd":"Добавить пользователя в тикет.",
|
||||||
|
"removeCmd":"Удалить пользователя из тикета.",
|
||||||
|
"reopenCmd":"Открыть заново тикет после того, как он был закрыт."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Закрыть тикет",
|
||||||
|
"delete":"Удалить тикет",
|
||||||
|
"reopen":"Открыть заново тикет",
|
||||||
|
"closeWithReason":"закрыть с причиной"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Открыл заново этот тикет!",
|
||||||
|
"reopenDescription":"Не стесняйтесь обращаться снова!",
|
||||||
|
"closedTitle":"Закрыл этот тикет!",
|
||||||
|
"closedDescription":"Только админы теперь могут писать в этом тикете!\n\n*Нажмите на кнопку ниже, чтобы удалить или заново окрыть тикет!*",
|
||||||
|
"createdTitle":"Тикет создан!",
|
||||||
|
"createdDescription":"Ваш тикет создан, вы можете обнаружить его по пингу!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Новый тикет!",
|
||||||
|
"closedTicketDmTitle":"Тикет закрыт!",
|
||||||
|
"deletedTicketDmTitle":"Тикет удалён!",
|
||||||
|
"closedTicketDmDescription":"Ваш тикет закрыт!",
|
||||||
|
"deletedTicketDmDescription":"Ваш тикет удалён!",
|
||||||
|
"reopenTicketDmTitle":"Тикет открыт заново!",
|
||||||
|
"reopenTicketDmDescription":"Ваш тикет открыт заново!",
|
||||||
|
|
||||||
|
"chooseCategory":"выберите категорию:",
|
||||||
|
"gettingdeleted":"Тикет будет удалён...",
|
||||||
|
|
||||||
|
"none":"отсутствует",
|
||||||
|
"reason":"причина",
|
||||||
|
|
||||||
|
"deletedby":"удалён",
|
||||||
|
"closedby":"закрыт",
|
||||||
|
"modalreason":"Какая причина закрытия этого тикета?",
|
||||||
|
"chooseATicket": "Выберите тикет"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Транскрипт",
|
||||||
|
"processed":"This transcript is being processed",
|
||||||
|
"wait":"Пожайлуста подождите!",
|
||||||
|
"estimated":"Оценочное время",
|
||||||
|
"available":"Транскрипт здесь доступен"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
{
|
||||||
|
"examples":{
|
||||||
|
"en-GB":"english",
|
||||||
|
"en-US":"english",
|
||||||
|
"nl":"dutch",
|
||||||
|
"ro":"romanian",
|
||||||
|
"de":"german",
|
||||||
|
"cs":"czech",
|
||||||
|
"fr":"french",
|
||||||
|
"es-ES":"spanish",
|
||||||
|
"it":"italian",
|
||||||
|
"ru":"russian",
|
||||||
|
|
||||||
|
"MISSING":"arabic,portuguese",
|
||||||
|
"NOTAVAILABLE":"arabic,portuguese,czech"
|
||||||
|
},
|
||||||
|
"data":{
|
||||||
|
"help":{
|
||||||
|
"en-GB":"A list of the available commands.",
|
||||||
|
"en-US":"A list of the available commands.",
|
||||||
|
"nl":"Een lijst met de beschikbare commands.",
|
||||||
|
"ro":"O lista a comenzilor disponibile.",
|
||||||
|
"de":"Eine Liste der verfügbaren Befehle.",
|
||||||
|
"cs":"A list of the available commands",
|
||||||
|
"fr":"Une liste des commandes.",
|
||||||
|
"es-ES":"Una lista de los comandos disponibles.",
|
||||||
|
"it":"Una lista di tutti i comandi disponibili.",
|
||||||
|
"ru":"Список доступных команд"
|
||||||
|
},
|
||||||
|
"message":{
|
||||||
|
"en-GB":"Spawn an embed with buttons.",
|
||||||
|
"en-US":"Spawn an embed with buttons.",
|
||||||
|
"nl":"Spawn een embed met knoppen.",
|
||||||
|
"ro":"Deschide un embed cu butoane.",
|
||||||
|
"de":"Sendet ein Embed mit Knöpfen.",
|
||||||
|
"cs":"Spawn an embed with buttons.",
|
||||||
|
"fr":"Créer un embed avec des boutons.",
|
||||||
|
"es-ES":"Genera un embed con botones.",
|
||||||
|
"it":"Genera un embed con un pulsante.",
|
||||||
|
"ru":"Создать embed с кнопками"
|
||||||
|
},
|
||||||
|
"close":{
|
||||||
|
"en-GB":"Close a ticket.",
|
||||||
|
"en-US":"Close a ticket.",
|
||||||
|
"nl":"Sluit een ticket",
|
||||||
|
"ro":"Inchide un ticket.",
|
||||||
|
"de":"Schließe ein Ticket.",
|
||||||
|
"cs":"Close a ticket.",
|
||||||
|
"fr":"Fermer un ticket.",
|
||||||
|
"es-ES":"Cierra un ticket.",
|
||||||
|
"it":"Chiudi un ticket.",
|
||||||
|
"ru":"Закрыть тикет"
|
||||||
|
},
|
||||||
|
"delete":{
|
||||||
|
"en-GB":"Delete a ticket.",
|
||||||
|
"en-US":"Delete a ticket.",
|
||||||
|
"nl":"Verwijder een ticket",
|
||||||
|
"ro":"Sterge un ticket.",
|
||||||
|
"de":"Lösche ein Ticket.",
|
||||||
|
"cs":"Delete a ticket.",
|
||||||
|
"fr":"Supprimer un ticket.",
|
||||||
|
"es-ES":"Elimina un ticket.",
|
||||||
|
"it":"Elimina un ticket.",
|
||||||
|
"ru":"Удалить тикет"
|
||||||
|
},
|
||||||
|
"reopen":{
|
||||||
|
"en-GB":"Re-Open a ticket.",
|
||||||
|
"en-US":"Re-Open a ticket.",
|
||||||
|
"nl":"Heropen een ticket.",
|
||||||
|
"ro":"Re-deschide un ticket.",
|
||||||
|
"de":"Wiedereröffnung eines Tickets.",
|
||||||
|
"cs":"Re-Open a ticket.",
|
||||||
|
"fr":"Re-ouvrir un ticket.",
|
||||||
|
"es-ES":"Re-abre un ticket.",
|
||||||
|
"it":"Ri-Apri un ticket.",
|
||||||
|
"ru":"Открыть заново тикет"
|
||||||
|
},
|
||||||
|
"add":{
|
||||||
|
"en-GB":"Add another user to a ticket.",
|
||||||
|
"en-US":"Add another user to a ticket.",
|
||||||
|
"nl":"Voeg een andere user toe aan een ticket.",
|
||||||
|
"ro":"Adauga un utilizator la acest ticket.",
|
||||||
|
"de":"Füge einen anderen Nutzer zum Ticket hinzu.",
|
||||||
|
"cs":"Add another user to a ticket.",
|
||||||
|
"fr":"Ajouter un utilisateur au ticket.",
|
||||||
|
"es-ES":"Agrega otro usuario al ticket.",
|
||||||
|
"it":"Aggiungi un membro al ticket",
|
||||||
|
"ru":"Добавить другого пользователя в тикет"
|
||||||
|
},
|
||||||
|
"remove":{
|
||||||
|
"en-GB":"Remove a user from a ticket.",
|
||||||
|
"en-US":"Remove a user from a ticket.",
|
||||||
|
"nl":"Verwijder een user van een ticket.",
|
||||||
|
"ro":"Sterge un utilizator dintr-un ticket.",
|
||||||
|
"de":"Entferne einen Nutzer von dem Ticket.",
|
||||||
|
"cs":"Remove a user from a ticket.",
|
||||||
|
"fr":"Enlever quelqu’un du ticket.",
|
||||||
|
"es-ES":"Elimina otro usuario del ticket.",
|
||||||
|
"it":"Rimuovi un membro dal ticket",
|
||||||
|
"ru":"Удалить пользователя из тикета"
|
||||||
|
},
|
||||||
|
"newticket":{
|
||||||
|
"en-GB":"Create a ticket",
|
||||||
|
"en-US":"Create a ticket",
|
||||||
|
"nl":"Maak een ticket aan",
|
||||||
|
"ro":"Creeaza un ticket.",
|
||||||
|
"de":"Erstelle ein Ticket.",
|
||||||
|
"cs":"Create a ticket",
|
||||||
|
"fr":"Créer un ticket",
|
||||||
|
"es-ES":"Crear un ticket.",
|
||||||
|
"it":"Crea un ticket",
|
||||||
|
"ru":"Создать тикет"
|
||||||
|
},
|
||||||
|
"rename":{
|
||||||
|
"en-GB":"Rename a ticket channel.",
|
||||||
|
"en-US":"Rename a ticket channel.",
|
||||||
|
"nl":"Hernoem een ticket channel.",
|
||||||
|
"ro":"Redenumeste un ticket.",
|
||||||
|
"de":"Benenne einen Ticket Channel.",
|
||||||
|
"cs":"Rename a ticket channel",
|
||||||
|
"fr":"Renommer un ticket.",
|
||||||
|
"es-ES":"Renombrar un canal de ticket.",
|
||||||
|
"it":"Rinomina il canale di un ticket.",
|
||||||
|
"ru":"Переименовать канал тикета"
|
||||||
|
},
|
||||||
|
"claim":{
|
||||||
|
"en-GB":"Claim a ticket.",
|
||||||
|
"en-US":"Claim a ticket.",
|
||||||
|
"nl":"Claim een ticket.",
|
||||||
|
"ro":" ",
|
||||||
|
"de":" ",
|
||||||
|
"cs":" ",
|
||||||
|
"fr":" ",
|
||||||
|
"es-ES":" ",
|
||||||
|
"it":" ",
|
||||||
|
"ru":"Взять тикет"
|
||||||
|
},
|
||||||
|
"unclaim":{
|
||||||
|
"en-GB":"Un-claim a ticket.",
|
||||||
|
"en-US":"Un-claim a ticket.",
|
||||||
|
"nl":"Ontclaim een ticket.",
|
||||||
|
"ro":" ",
|
||||||
|
"de":" ",
|
||||||
|
"cs":" ",
|
||||||
|
"fr":" ",
|
||||||
|
"es-ES":" ",
|
||||||
|
"it":" ",
|
||||||
|
"ru":"Снять тикет"
|
||||||
|
},
|
||||||
|
"category":{
|
||||||
|
"en-GB":"Change ticket type.",
|
||||||
|
"en-US":"Change ticket type.",
|
||||||
|
"nl":"Verander ticket type.",
|
||||||
|
"ro":" ",
|
||||||
|
"de":" ",
|
||||||
|
"cs":" ",
|
||||||
|
"fr":" ",
|
||||||
|
"es-ES":" ",
|
||||||
|
"it":" ",
|
||||||
|
"ru":"Изменить тип тикета"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+32
-20
@@ -3,8 +3,8 @@
|
|||||||
"missingArgsTitle":"¡Argumentos inválidos!",
|
"missingArgsTitle":"¡Argumentos inválidos!",
|
||||||
"missingArgsDescription":"Argumento faltante.",
|
"missingArgsDescription":"Argumento faltante.",
|
||||||
"noPermsTitle":"¡Sin permisos!",
|
"noPermsTitle":"¡Sin permisos!",
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
"noPermsDescription":"Necesitas el permiso de `ADMINISTRADOR` o estar en la lista de roles permitidos!",
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
"noPermsDelete":"Solo los administradores pueden eliminar un ticket.!",
|
||||||
"chooseFromListTitle":"ID Invalida",
|
"chooseFromListTitle":"ID Invalida",
|
||||||
"chooseFromListDescription":"Elije una de las ID de abajo:",
|
"chooseFromListDescription":"Elije una de las ID de abajo:",
|
||||||
"boterror":"¡Error del bot!",
|
"boterror":"¡Error del bot!",
|
||||||
@@ -15,22 +15,24 @@
|
|||||||
"anotherOption":"¡Esta opción no es un ticket, si no otra cosa!",
|
"anotherOption":"¡Esta opción no es un ticket, si no otra cosa!",
|
||||||
"maxAmountTitle":"¡Máxima cantidad alcanzada!",
|
"maxAmountTitle":"¡Máxima cantidad alcanzada!",
|
||||||
"maxAmountDescription":"¡Has alcanzado la máxima cantidad de tickets permitida!\n¡Por lo que no puedes crear otro!",
|
"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!",
|
"somethingWentWrong":"**¡Algo salió mal!**\n¡Prueba dentro de un rato!"
|
||||||
"somethingWentWrongTranscript":"**¡Algo salió mal al hacer el transcript!**\n¡Prueba en otro momento!"
|
|
||||||
},
|
},
|
||||||
"commands":{
|
"commands":{
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
"userAddedTitle":"Se agregó {0} al ticket!",
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
"userRemovedTitle":"Se eliminó {0} del ticket!",
|
||||||
"renameTitle":"Changed the name to {0}!",
|
"renameTitle":"Cambió el nombre a {0}!",
|
||||||
"closeTitle":"Closed this ticket!",
|
"closeTitle":"Cerró este ticket!",
|
||||||
"deleteTitle":"Deleting this ticket...",
|
"deleteTitle":"Eliminando este ticket...",
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
"reopenTitle":"Re-abrió este boleto!",
|
||||||
|
"claimTitle":"Este ticket será atendido por {0}",
|
||||||
|
"unclaimTitle":"¡Este ticket ya no está reservado!",
|
||||||
|
"changeTitle":"¡Cambiando el tipo de ticket a {0}!",
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
"ticketWarning":"La inserción está en el mensaje a continuación!",
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
"maxTicketWarning":"**Advertencia:** _Solo puedes crear {0} ticket(s) a la vez!_"
|
||||||
},
|
},
|
||||||
"helpMenu":{
|
"helpMenu":{
|
||||||
"title":"Available Commands:",
|
"title":"Comandos disponibles:",
|
||||||
"header1":"**¡Dirígete a {0} para crear un nuevo ticket!**\n\n",
|
"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",
|
"header2":"**¡Ejecuta el comando `/new` o `/ticket` para crear un ticket!**\n\n",
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@
|
|||||||
"close":"Cerrar ticket.",
|
"close":"Cerrar ticket.",
|
||||||
"delete":"Eliminar ticket",
|
"delete":"Eliminar ticket",
|
||||||
"reopen":"Re-Abrir ticket",
|
"reopen":"Re-Abrir ticket",
|
||||||
"sendTranscript":"Obtener transcript."
|
"closeWithReason":"cerrar con razón"
|
||||||
},
|
},
|
||||||
"messages":{
|
"messages":{
|
||||||
"reopenTitle":"¡Ticket Re-Abierto!",
|
"reopenTitle":"¡Ticket Re-Abierto!",
|
||||||
@@ -63,13 +65,23 @@
|
|||||||
"deletedTicketDmDescription":"¡Tu ticket fué eliminado!",
|
"deletedTicketDmDescription":"¡Tu ticket fué eliminado!",
|
||||||
"reopenTicketDmTitle":"¡Ticket re-abierto!",
|
"reopenTicketDmTitle":"¡Ticket re-abierto!",
|
||||||
"reopenTicketDmDescription":"¡Tu ticket se vió abierto de nuevo!",
|
"reopenTicketDmDescription":"¡Tu ticket se vió abierto de nuevo!",
|
||||||
"newTranscriptTitle":"¡Un nuevo transcript está aquí!",
|
|
||||||
"hereIsTheTranscript":"Aquí está el transcript:",
|
"chooseCategory":"Elije una categoría:",
|
||||||
|
|
||||||
"chooseCategory":"elije una categoría:",
|
|
||||||
"gettingdeleted":"El ticket se está viendo eliminado...",
|
"gettingdeleted":"El ticket se está viendo eliminado...",
|
||||||
|
|
||||||
"none":"none",
|
"none":"Ninguna.",
|
||||||
"reason":"reason"
|
"reason":"Razón",
|
||||||
|
|
||||||
|
"deletedby":"eliminado por",
|
||||||
|
"closedby":"cerrado por",
|
||||||
|
"modalreason":"Cúal es la razón para cerrar este ticket?",
|
||||||
|
"chooseATicket": "Elije un ticket"
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"title":"Transcripción",
|
||||||
|
"processed":"La transcripción del ticket está siendo procesada...",
|
||||||
|
"wait":"¡Por favor, espere!",
|
||||||
|
"estimated":"Tiempo estimado",
|
||||||
|
"available":"La transcripción estará disponible aquí"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
+3
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "open-ticket",
|
"name": "open-ticket",
|
||||||
"version": "2.5.0",
|
"version": "3.2.2",
|
||||||
"description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.",
|
"description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -15,10 +15,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"chalk": "^5.0.1",
|
"chalk": "^5.0.1",
|
||||||
"discord.js": "^14.0.2",
|
"discord.js": "^14.7.1",
|
||||||
"express": "^4.17.1",
|
"node": "^16.10.0"
|
||||||
"node": "^16.10.0",
|
|
||||||
"node-localstorage": "^2.2.1"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
This file is only here to make sure that this directory exists!
|
||||||
|
|
||||||
|
I don't have any other use :)
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"sendTranscripts":{
|
||||||
|
"enableChannel":false,
|
||||||
|
"channel":"transcript channel id",
|
||||||
|
"useHTMLtranscripts":true,
|
||||||
|
|
||||||
|
"enableDM":false
|
||||||
|
},
|
||||||
|
"style":{
|
||||||
|
"titleColor":"#F8BA00",
|
||||||
|
"background":{
|
||||||
|
"enableCustomBackground":false,
|
||||||
|
"backgroundModus":"color OR image",
|
||||||
|
"backgroundData":"#abc123 OR https://www.example.com/image.png"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user