Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b8074c520 | ||
|
|
1d5830975f | ||
|
|
95bc1f4fbf | ||
|
|
bfc02611c7 | ||
|
|
e4c1e2559e | ||
|
|
69b669956e | ||
|
|
893a7c5b1f | ||
|
|
ed9c98e2f0 | ||
|
|
62d950b1a6 | ||
|
|
69de612d1e | ||
|
|
5494e112c0 | ||
|
|
cd2c08303e | ||
|
|
a8619e448a | ||
|
|
c990257c02 | ||
|
|
e7f05b4ed5 | ||
|
|
697594b311 | ||
|
|
6823b96114 | ||
|
|
0845390569 | ||
|
|
568b2c9bee | ||
|
|
034247ea99 | ||
|
|
ad10a98f33 | ||
|
|
8aee358081 | ||
|
|
e2f237e7b6 | ||
|
|
210923d29e | ||
|
|
a69f2ee5a1 | ||
|
|
ffa075d177 | ||
|
|
e7a331b969 | ||
|
|
6b32fc9d5d | ||
|
|
7603dbcc47 | ||
|
|
512e564c60 | ||
|
|
5a731e6336 | ||
|
|
d02bf2b826 | ||
|
|
2603a7bdd0 | ||
|
|
c1ba677b82 | ||
|
|
7e6ac6a4b9 | ||
|
|
0ee9a312eb | ||
|
|
d282a516e6 | ||
|
|
9638179d45 | ||
|
|
30d45ddc39 | ||
|
|
2c08ca7245 | ||
|
|
3d5b1f6e8d | ||
|
|
edc8d4bc44 | ||
|
|
c57507cea9 | ||
|
|
ace46deb52 | ||
|
|
fc09858f92 | ||
|
|
1b7767641e | ||
|
|
76d491d27c | ||
|
|
06b57f18f1 | ||
|
|
5f5699f160 | ||
|
|
702f225983 | ||
|
|
aab5a9c241 | ||
|
|
59e756210e | ||
|
|
a8bb210eca | ||
|
|
e3ee51d9fb | ||
|
|
a6e107c12a | ||
|
|
a49b53e2d6 | ||
|
|
0bbde2018c | ||
|
|
15825d0da6 | ||
|
|
9d19c7053b | ||
|
|
09f9944cf7 | ||
|
|
6cd6799712 | ||
|
|
44515fc6b4 | ||
|
|
4c947b138f | ||
|
|
428f4a9e92 | ||
|
|
a274576589 | ||
|
|
2410743a46 | ||
|
|
89a44f3f2f | ||
|
|
1728c3653a | ||
|
|
62a1f0f8c1 | ||
|
|
8875c9ff01 | ||
|
|
9b378caff5 | ||
|
|
821a49cb0b | ||
|
|
ebacb92b99 | ||
|
|
e1eb3f252b | ||
|
|
49405b848e | ||
|
|
5dcd36d290 | ||
|
|
d00a26a1e0 | ||
|
|
8c9eddd4a1 | ||
|
|
046cef0088 | ||
|
|
0f143c7ebb | ||
|
|
4cc12eb727 | ||
|
|
e3e5c04096 | ||
|
|
eddbcf9acd | ||
|
|
3c2f39df9c | ||
|
|
ca4532931b | ||
|
|
14ad1f48f3 | ||
|
|
fa8741aef8 | ||
|
|
130fd98d0c | ||
|
|
a9770ec66c | ||
|
|
f163769de4 | ||
|
|
07de112f32 | ||
|
|
8e7a98b810 | ||
|
|
92c1e8fce0 | ||
|
|
4e73626072 | ||
|
|
943e7b6fef | ||
|
|
af8d6351af | ||
|
|
5fc3ba3279 |
+14
@@ -1,2 +1,16 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
devConfig.json
|
||||||
|
devConfig1.json
|
||||||
|
devConfig2.json
|
||||||
|
devConfig3.json
|
||||||
|
devConfig4.json
|
||||||
|
devConfig5.json
|
||||||
|
.DS_Store
|
||||||
|
openticketdebug.txt
|
||||||
|
developerChangelog.md
|
||||||
|
storage/dynamicDB/
|
||||||
|
storage/.DS_Store
|
||||||
|
.vscode/
|
||||||
|
livestatus.json
|
||||||
|
test.js
|
||||||
@@ -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
|
||||||
@@ -1,68 +1,59 @@
|
|||||||
# open-ticket
|
# Open Ticket
|
||||||
[](https://discord.com/invite/26vT9wt3n3)
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.0) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
||||||
[](https://github.com/DJj123dj/open-ticket/releases/tag/v1.3.2)
|
|
||||||
[](#packages)
|
|
||||||
[](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE)
|
|
||||||
|
|
||||||
This is an open-source discord ticket bot, you can configure it and it comes with cool features like transcripts & custom options!
|
Open ticket is the most configurable open-source ticket bot for discord! Made with the newest technologies. Like: Slash commands, transcripts, multiple ticket types, buttons & dropdowns!
|
||||||
|
Start using it now, you can do anything!
|
||||||
|
|
||||||
|
*We love to hear suggestions for more features!*
|
||||||
|
|
||||||
<img src="logo.png" alt="Open Ticket logo" style="height: 200px; width:200px;"/>
|
<img src="logo.png" alt="Open Ticket logo" style="height: 200px; width:200px;"/>
|
||||||
|
|
||||||
[](https://github.com/DJj123dj/open-ticket/discussions/3)
|
[](https://www.github.com/DJj123dj/open-ticket/wiki)
|
||||||
|
|
||||||
[](./documentation/Q&A.md)
|
### Thanks to these people:
|
||||||
|
- DJ-Lite: for doing the administration
|
||||||
|
- Sanke: for translation & new ideas
|
||||||
|
- Everyone that reported a bug
|
||||||
|
#### And our translators!
|
||||||
|
- ExothDE
|
||||||
|
- 1x1
|
||||||
|
- Redactado
|
||||||
|
- t0miiis
|
||||||
|
- josuens14
|
||||||
|
- M4
|
||||||
|
- David.
|
||||||
|
- Maurizio
|
||||||
|
|
||||||
## features
|
## features
|
||||||
- discord interaction buttons
|
- discord interaction buttons
|
||||||
|
- slash & text commands
|
||||||
|
- close, delete & re-open tickets
|
||||||
|
- translation in 10 different languages
|
||||||
- transcripts
|
- transcripts
|
||||||
- add/remove users from ticket
|
- add/remove users from a ticket
|
||||||
- custom colors & name
|
- a lot of customisation options.
|
||||||
- create custom ticket names, icons & colors
|
- tickets, reaction roles & links are all possible!
|
||||||
- create url buttons for websites
|
- choose between buttons or dropdowns!
|
||||||
- uses discord.js 13
|
- discord.js v14
|
||||||
- configure your own ticket options
|
- everyting is configurable
|
||||||
- remove credits if you want
|
- custom API + plugins
|
||||||
- up to 6 tickets at the same time
|
- unlimited tickets spread over multiple messages
|
||||||
- change all bot messages
|
- close with reason
|
||||||
|
|
||||||
## installation
|
*comming soon*
|
||||||
**You need `node.js 16` to run this project!**
|
- share transcripts
|
||||||
|
- view transcripts in html
|
||||||
|
|
||||||
You can clone or download this project.
|
## quick start
|
||||||
|
[Click here to start your adventure!](https://docs.openticket.dj-dj.be/quick-start)
|
||||||
|
|
||||||
### packages
|
## documentation
|
||||||
- chalk => version `latest`
|
[Official Documentation](https://docs.openticket.dj-dj.be)
|
||||||
- discord.js => version `latest`
|
|
||||||
- express => version `latest`
|
|
||||||
- node-localstorage => 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 the discord server**.
|
|
||||||
|
|
||||||
### config
|
|
||||||
Our config documentation is moved to another file:
|
|
||||||
[click here to view](./documentation/CONFIG.md)
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
||||||
## v1.4.0 announcement
|
|
||||||
Hello everyone, soon open-ticket v1.4.0 will be launched, it contains a lot of new features. You can view them below.
|
|
||||||
[click here to view the announcement](https://github.com/DJj123dj/open-ticket/discussions/3)
|
|
||||||
|
|
||||||
## information
|
## information
|
||||||
|
|
||||||
_v1.3.2_
|
_v3.0.0_
|
||||||
|
|
||||||
changelog: [click here](./documentation/CHANGELOG.md)
|
changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
||||||
|
|
||||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.com/invite/26vT9wt3n3)
|
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.dj-dj.be) | [terms of service](https://www.dj-dj.be/terms)
|
||||||
-214
@@ -1,214 +0,0 @@
|
|||||||
module.exports = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
const config = require("./config.json")
|
|
||||||
var errorList = []
|
|
||||||
var isError = false
|
|
||||||
var warnList = []
|
|
||||||
var isWarn = false
|
|
||||||
const createError = (message) => {
|
|
||||||
isError = true
|
|
||||||
errorList.push("open-ticket ERROR: "+message)
|
|
||||||
}
|
|
||||||
const createWarn = (message) => {
|
|
||||||
isWarn = true
|
|
||||||
warnList.push("open-ticket WARNING: "+message)
|
|
||||||
}
|
|
||||||
|
|
||||||
//checker
|
|
||||||
|
|
||||||
//token
|
|
||||||
if (config.auth_token.includes(" ")){
|
|
||||||
createError("invalid token | there are spaces in your token!")
|
|
||||||
}
|
|
||||||
if (config.auth_token.length < 40){
|
|
||||||
createError("invalid token | length not correct!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//color
|
|
||||||
if (!config.main_color.startsWith("#")){
|
|
||||||
createError("color not detected | 'main_color' doesn't start with a '#'!")
|
|
||||||
}
|
|
||||||
if (config.main_color.length > 7 || config.main_color.length < 7){
|
|
||||||
createError("color not detected | 'main_color' is not a valid hex color!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//admin
|
|
||||||
if (config.botperms_role.includes(" ")){
|
|
||||||
createError("invalid role id | 'botperms_role' is not a valid role id!")
|
|
||||||
}
|
|
||||||
if (config.botperms_role.length > 20|| config.botperms_role.length < 16){
|
|
||||||
createError("invalid role id | 'botperms_role' is not a valid role id!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//prefix
|
|
||||||
if (config.prefix == ""){
|
|
||||||
createError("no prefix | 'prefix' is empty!")
|
|
||||||
}
|
|
||||||
if (config.prefix.length > 3){
|
|
||||||
createWarn("long prefix | your prefix is a little bit long!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//status
|
|
||||||
if (config.status.enabled && (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING" && config.status.type != "CUSTOM")){
|
|
||||||
createError("status error | 'status/type' is invalid!")
|
|
||||||
}
|
|
||||||
if (config.status.enabled && config.status.text.length < 1){
|
|
||||||
createError("status error | 'status/text' must be at least 1 character long!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//ticketchannel
|
|
||||||
if (config.system.ticket_channel.includes(" ")){
|
|
||||||
createWarn("invalid channel id | 'system/ticket_channel' is not a valid channel id!")
|
|
||||||
}
|
|
||||||
if (config.system.ticket_channel.length < 1){
|
|
||||||
createWarn("no ticket channel | 'system/ticket_channel' is empty")
|
|
||||||
}else if (config.system.ticket_channel.length > 20|| config.system.ticket_channel.length < 16){
|
|
||||||
createWarn("invalid channel id | 'system/ticket_channel' is not a valid channel id!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//maxticket
|
|
||||||
if (config.system.max_allowed_tickets < 1){
|
|
||||||
createWarn("no tickets | if 'system/max_allowed_tickets' is under 1 you can't create any ticket")
|
|
||||||
}
|
|
||||||
|
|
||||||
//category
|
|
||||||
if (config.system.enable_category == true && config.system.ticket_category.includes(" ")){
|
|
||||||
createError("invalid category id | 'system/ticket_category' is not a valid category id!")
|
|
||||||
}
|
|
||||||
if (config.system.enable_category && config.system.ticket_category > 20 || config.system.ticket_category < 16){
|
|
||||||
createError("invalid category id | 'system/ticket_category' is not a valid category id!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//everyoneaccess
|
|
||||||
if (config.system["has@everyoneaccess"] == true){
|
|
||||||
createWarn("access | everyone has access to the tickets!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//memberrole
|
|
||||||
if (config.system.member_role.includes(" ")){
|
|
||||||
createError("invalid role id | 'system/member_role' is not a valid role id!")
|
|
||||||
}
|
|
||||||
if (config.system.member_role.length > 20){
|
|
||||||
createError("invalid role id | 'system/member_role' is not a valid role id!")
|
|
||||||
}
|
|
||||||
if (config.system.member_role == "" || config.system.member_role == " " || config.system.member_role == "false" || config.system.member_role == "null" || config.system.member_role == "0"){
|
|
||||||
createWarn("no member role | 'system/member_role' is not valid so technically everyone can view a ticket!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//transcript
|
|
||||||
if (config.system.enable_transcript && config.system.transcript_channel.includes(" ")){
|
|
||||||
createError("invalid channel id | 'system/transcript_channel' is not a valid channel id!")
|
|
||||||
}
|
|
||||||
if (config.system.enable_transcript && config.system.transcript_channel.length > 20 || config.system.transcript_channel.length < 16){
|
|
||||||
createError("invalid channel id | 'system/transcript_channel' is not a valid channel id!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//messages
|
|
||||||
if (config.messages.general.nopermissions.length < 1){
|
|
||||||
createError("no message | 'messages/general/nopermissions' is empty!")
|
|
||||||
}
|
|
||||||
if (config.messages.ticket.newTicketEmbed.length < 1){
|
|
||||||
createError("no message | 'messages/ticket/newTicketEmbed' is empty!")
|
|
||||||
}
|
|
||||||
if (config.messages.dm.alreadyCreated.length < 1){
|
|
||||||
createError("no message | 'messages/dm/alreadyCreated' is empty!")
|
|
||||||
}
|
|
||||||
if (config.messages.dm.newTicket.length < 1){
|
|
||||||
createError("no message | 'messages/dm/newTicket' is empty!")
|
|
||||||
}
|
|
||||||
if (config.messages.dm.closeTicket.length < 1){
|
|
||||||
createError("no message | 'messages/dm/closeTicket' is empty!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//layout
|
|
||||||
const checkLayout = (layout,layoutname,color,footer,thumbnail) => {
|
|
||||||
if (color){
|
|
||||||
if (!layout.customColor.startsWith("#")){
|
|
||||||
createError("color not detected | 'layout/"+layoutname+"/customColor' doesn't start with a '#'!")
|
|
||||||
}
|
|
||||||
if (layout.customColor.length > 7 || layout.customColor.length < 7){
|
|
||||||
createError("color not detected | 'layout/"+layoutname+"/customColor' is not a valid hex color!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (footer){
|
|
||||||
if (layout.footer.length < 1){
|
|
||||||
createError("no footer | 'layout/"+layoutname+"/footer' doesn't have a footer!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (thumbnail){
|
|
||||||
if (!layout.thumbnailURL.startsWith("https://") && !layout.thumbnailURL.startsWith("http://")){
|
|
||||||
createError("thumbnail | the thumbnail url in 'layout/"+layoutname+"/thumbnailURL' is not a valid url!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
checkLayout(config.layout.ticketEmbed,"ticketEmbed",config.layout.ticketEmbed.customColorEnabled,config.layout.ticketEmbed.footerEnabled,config.layout.ticketEmbed.thumbnailEnabled)
|
|
||||||
checkLayout(config.layout.ticketMsg,"ticketMsg",config.layout.ticketMsg.customColorEnabled,config.layout.ticketMsg.footerEnabled,config.layout.ticketMsg.thumbnailEnabled)
|
|
||||||
checkLayout(config.layout.transcripts,"transcripts",config.layout.transcripts.customColorEnabled,false,config.layout.transcripts.thumbnailEnabled)
|
|
||||||
|
|
||||||
const checkOption = (ticket,ticketname,enabled,urlmode) => {
|
|
||||||
if (enabled){
|
|
||||||
if (ticket.icon.length > 0){
|
|
||||||
const emojiRegex = /\p{Emoji}/u
|
|
||||||
const isEmoji = emojiRegex.test(ticket.icon)
|
|
||||||
if (isEmoji == false){
|
|
||||||
createWarn("invalid emoji | 'options/"+ticketname+"/icon' is not a valid emoji (code can be wrong)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ticket.description.length < 1){
|
|
||||||
createWarn("no description | 'options/"+ticketname+"/description' is empty")
|
|
||||||
}
|
|
||||||
if (ticket.name.length < 1){
|
|
||||||
createWarn("no description | 'options/"+ticketname+"/name' is empty")
|
|
||||||
}
|
|
||||||
if (ticket.channel_prefix.length < 1){
|
|
||||||
createWarn("no description | 'options/"+ticketname+"/channel_prefix' is empty")
|
|
||||||
}
|
|
||||||
if (ticket.isURL == true && ticket.color != "red" && ticket.color != "blue" && ticket.color != "green" && ticket.color != "gray" && ticket.color != "none"){
|
|
||||||
createWarn("invalid button color | 'options/"+ticketname+"/color' must be one of (red,green,blue,gray,none)")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (urlmode && (!ticket.url.startsWith("https://") && !ticket.url.startsWith("http://"))){
|
|
||||||
createError("url invalid | the url in 'options/"+ticketname+"/url' is not a valid url!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
checkOption(config.options.ticket1,"ticket1",config.options.ticket1.enabled,config.options.ticket1.isURL)
|
|
||||||
checkOption(config.options.ticket2,"ticket2",config.options.ticket2.enabled,config.options.ticket2.isURL)
|
|
||||||
checkOption(config.options.ticket3,"ticket3",config.options.ticket3.enabled,config.options.ticket3.isURL)
|
|
||||||
checkOption(config.options.ticket4,"ticket4",config.options.ticket4.enabled,config.options.ticket4.isURL)
|
|
||||||
checkOption(config.options.ticket5,"ticket5",config.options.ticket5.enabled,config.options.ticket5.isURL)
|
|
||||||
checkOption(config.options.ticket6,"ticket6",config.options.ticket6.enabled,config.options.ticket6.isURL)
|
|
||||||
|
|
||||||
//the end
|
|
||||||
if (errorList.length > 0 || warnList.length > 0){
|
|
||||||
console.log("REPORT:\n===========================")
|
|
||||||
}
|
|
||||||
warnList.forEach((w) => {
|
|
||||||
const splitw = w.split("'")
|
|
||||||
if (splitw.length > 1){
|
|
||||||
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
|
|
||||||
}else {var splitstring = chalk.yellow(splitw[0])}
|
|
||||||
console.log(splitstring)
|
|
||||||
})
|
|
||||||
errorList.forEach((e) => {
|
|
||||||
const splite = e.split("'")
|
|
||||||
if (splite.length > 1){
|
|
||||||
var splitstring = chalk.red(splite[0])+chalk.blue("'"+splite[1]+"'")+chalk.red(splite[2])
|
|
||||||
}else {var splitstring = chalk.red(splite[0])}
|
|
||||||
console.log(splitstring)
|
|
||||||
})
|
|
||||||
if (isError){
|
|
||||||
console.log("===========================")
|
|
||||||
console.log("=> "+chalk.bgRed("your bot doesn't work if you don't fix the above errors!"))
|
|
||||||
if (isWarn){
|
|
||||||
console.log("\n=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
|
||||||
}
|
|
||||||
process.exit(0)
|
|
||||||
}else if (isWarn == true && isError == false){
|
|
||||||
console.log("===========================")
|
|
||||||
console.log("=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
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 add.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.add) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"add")) return
|
||||||
|
var user = msg.mentions.users.first()
|
||||||
|
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
|
||||||
|
|
||||||
|
if (!msg.guild) return
|
||||||
|
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(msg.author)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
msg.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
||||||
|
msg.channel.send({embeds:[bot.embeds.commands.addEmbed(user,msg.author)]})
|
||||||
|
|
||||||
|
var loguser = msg.mentions.users.first()
|
||||||
|
log("command","someone used the 'add' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","user added to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"added_user",value:loguser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/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.add) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "add") return
|
||||||
|
const user = interaction.options.getUser("user")
|
||||||
|
|
||||||
|
if (!interaction.guild) return
|
||||||
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
interaction.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.addEmbed(user,interaction.user)]})
|
||||||
|
|
||||||
|
var loguser = user
|
||||||
|
log("command","someone used the 'add' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","user added to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"added_user",value:loguser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/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())
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -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())
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
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 close.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.close) client.on("messageCreate",msg => {
|
||||||
|
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 => {
|
||||||
|
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
|
||||||
|
|
||||||
|
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 prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
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}])
|
||||||
|
APIEvents.onCommand("close",true,msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.close) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "close") return
|
||||||
|
|
||||||
|
//interaction.deferReply()
|
||||||
|
|
||||||
|
const reason = interaction.options.getString("reason") ? interaction.options.getString("reason") : false
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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 prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
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}])
|
||||||
|
APIEvents.onCommand("close",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = require("../config.json")
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",(msg) => {
|
|
||||||
var args = msg.content.split(" ")
|
|
||||||
if (args[0] == config.prefix+"resetdatabase" || args[0] == config.prefix+"resetdb"){
|
|
||||||
const databaseEmbed = new discord.MessageEmbed()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("How to reset the database:")
|
|
||||||
.setDescription("1: Go to the folder `./storage` in your bot's directory.\n\n2: If posible remove the folders\n`./tickets`, `./transcripts` & `./userTickets`\nfrom the folder `./storage`\n\n3: Restart the bot")
|
|
||||||
.setFooter({text:"if it doesn't work, create an issue on github or DM me on discord!"})
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[databaseEmbed]})
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"resetdatabase (user:"+msg.author.username+")")}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
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 delete.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.delete) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"delete")) return
|
||||||
|
|
||||||
|
if (!msg.guild) return
|
||||||
|
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(msg.author)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
msg.channel.send({embeds:[bot.embeds.commands.deleteEmbed(msg.author)]})
|
||||||
|
|
||||||
|
var name = msg.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"delete",false,true)
|
||||||
|
|
||||||
|
log("command","someone used the 'delete' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
APIEvents.onCommand("delete",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.delete) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "delete") return
|
||||||
|
|
||||||
|
//interaction.deferReply()
|
||||||
|
|
||||||
|
if (!interaction.guild) return
|
||||||
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
|
return interaction.reply({embeds:[bot.errorLog.noPermsDelete(interaction.user)]})
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||||
|
|
||||||
|
var name = interaction.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||||
|
|
||||||
|
log("command","someone used the 'delete' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
APIEvents.onCommand("delete",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
const APIEvents = require("../core/api/modules/events")
|
||||||
|
const DISABLE = require("../core/api/api.json").disable
|
||||||
|
|
||||||
|
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()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle("❔ "+l.helpMenu.title)
|
||||||
|
|
||||||
|
const header = config.system.ticket_channel ? l.helpMenu.header1.replace("{0}","<#"+config.system.ticket_channel+">") : l.helpMenu.header2
|
||||||
|
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+"_")
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.help) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix)) return
|
||||||
|
var args = msg.content.split(config.prefix)
|
||||||
|
|
||||||
|
if (msg.content == config.prefix || msg.content == config.prefix+" " || msg.content == otherprefix){
|
||||||
|
msg.channel.send({embeds:[helpEmbed]})
|
||||||
|
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args[1]){
|
||||||
|
if (!args[1].startsWith("close") && !args[1].startsWith("delete") && !args[1].startsWith("remove") && !args[1].startsWith("add") && !args[1].startsWith("msg") && !args[1].startsWith("remove") && !args[1].startsWith("rename") && !args[1].startsWith("reopen")){
|
||||||
|
msg.channel.send({embeds:[helpEmbed]})
|
||||||
|
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.help) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "help") return
|
||||||
|
|
||||||
|
interaction.reply({embeds:[helpEmbed]})
|
||||||
|
log("command","someone used the 'help' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
APIEvents.onCommand("help",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -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 remove.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.remove) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"remove")) return
|
||||||
|
var user = msg.mentions.users.first()
|
||||||
|
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
|
||||||
|
|
||||||
|
if (!msg.guild) return
|
||||||
|
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(msg.author)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
msg.channel.permissionOverwrites.delete(user.id)
|
||||||
|
msg.channel.send({embeds:[bot.embeds.commands.removeEmbed(user,msg.author)]})
|
||||||
|
|
||||||
|
var loguser = msg.mentions.users.first()
|
||||||
|
|
||||||
|
log("command","someone used the 'remove' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","user removed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"removed_user",value:loguser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/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.onCommand("remove",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.remove) client.on("interactionCreate",async (interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "remove") return
|
||||||
|
const user = interaction.options.getUser("user")
|
||||||
|
|
||||||
|
if (!interaction.guild) return
|
||||||
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
interaction.channel.permissionOverwrites.delete(user.id)
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.removeEmbed(user,interaction.user)]})
|
||||||
|
|
||||||
|
var loguser = user
|
||||||
|
|
||||||
|
log("command","someone used the 'remove' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","user removed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"removed_user",value:loguser.tag}])
|
||||||
|
|
||||||
|
const ticketData = require("../core/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.onCommand("remove",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
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 rename.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.rename) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"rename")) return
|
||||||
|
|
||||||
|
if (!msg.guild) return
|
||||||
|
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(msg.author)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
var newname = msg.content.split(config.prefix+"rename")[1].substring(1)
|
||||||
|
|
||||||
|
if (!newname) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<name>`:\n`"+config.prefix+"rename <name>`")]})
|
||||||
|
|
||||||
|
var name = msg.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!prefix) prefix = "noprefix-"
|
||||||
|
|
||||||
|
msg.channel.setName(prefix+newname)
|
||||||
|
msg.channel.send({embeds:[bot.embeds.commands.renameEmbed(msg.author,prefix+newname)]})
|
||||||
|
|
||||||
|
log("command","someone used the 'rename' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
log("system","ticket renamed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
||||||
|
APIEvents.onCommand("rename",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.rename) client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "rename") return
|
||||||
|
|
||||||
|
if (!interaction.guild) return
|
||||||
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//interaction.deferReply()
|
||||||
|
|
||||||
|
interaction.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
var newname = interaction.options.getString("name")
|
||||||
|
var name = interaction.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!prefix) prefix = "noprefix-"
|
||||||
|
|
||||||
|
interaction.channel.setName(prefix+newname)
|
||||||
|
interaction.reply({embeds:[bot.embeds.commands.renameEmbed(interaction.user,prefix+newname)]})
|
||||||
|
|
||||||
|
log("command","someone used the 'rename' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
log("system","ticket renamed",[{key:"user",value:interaction.user.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
||||||
|
|
||||||
|
APIEvents.onCommand("rename",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
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 reopen.js")
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.reopen) client.on("messageCreate",msg => {
|
||||||
|
if (!msg.content.startsWith(config.prefix+"reopen")) return
|
||||||
|
|
||||||
|
msg.channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
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]})
|
||||||
|
|
||||||
|
require("../core/ticketActions/ticketReopener").reopenTicket(msg.guild,msg.channel,msg.author)
|
||||||
|
|
||||||
|
log("command","someone used the 'reopen' command",[{key:"user",value:msg.author.tag}])
|
||||||
|
APIEvents.onCommand("reopen",true,msg.author,msg.channel,msg.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.reopen) client.on("interactionCreate",async (interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "reopen") return
|
||||||
|
|
||||||
|
//interaction.deferReply()
|
||||||
|
|
||||||
|
interaction.channel.messages.fetchPinned().then(async msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
|
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]})
|
||||||
|
|
||||||
|
require("../core/ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||||
|
|
||||||
|
log("command","someone used the 'reopen' command",[{key:"user",value:interaction.user.tag}])
|
||||||
|
APIEvents.onCommand("reopen",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
+53
-225
@@ -1,242 +1,70 @@
|
|||||||
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 = require("../config.json")
|
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 = () => {
|
module.exports = () => {
|
||||||
client.on("messageCreate", msg => {
|
bot.errorLog.log("debug","COMMANDS: loaded ticket.js")
|
||||||
if (msg.content == config.prefix+"ticket msg"){
|
|
||||||
if (msg.member.roles.cache.has(config.botperms_role) == false){
|
/**@type {String[]} */
|
||||||
msg.channel.send({content:config.messages.general.nopermissions})
|
var msgIds = []
|
||||||
|
config.messages.forEach((msg) => {
|
||||||
|
msgIds.push(msg.id)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
if (!DISABLE.commands.text.msg) client.on("messageCreate", msg => {
|
||||||
|
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
||||||
|
|
||||||
|
if (!msg.guild) return
|
||||||
|
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(msg.author)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentTicketButtons = 0
|
const id = msg.content.split(config.prefix+"msg")[1].substring(1) ? msg.content.split(config.prefix+"msg")[1].substring(1) : false
|
||||||
var ticketButton = new discord.MessageActionRow()
|
|
||||||
var ticketButton2 = new discord.MessageActionRow()
|
|
||||||
|
|
||||||
const getColor = (color) => {
|
if (!id) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<id>`:\n`"+config.prefix+"msg <id>`")]})
|
||||||
if (color.toLowerCase() == "red"){
|
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||||
return "DANGER"
|
|
||||||
}else if (color.toLowerCase() == "green"){
|
|
||||||
return "SUCCESS"
|
|
||||||
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
|
||||||
return "PRIMARY"
|
|
||||||
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
|
||||||
return "SECONDARY"
|
|
||||||
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
|
||||||
return color
|
|
||||||
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
|
||||||
return "SECONDARY"
|
|
||||||
}else return "SECONDARY"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.options.ticket1.enabled){
|
|
||||||
if (currentTicketButtons < 4){
|
|
||||||
var localTicketButton = ticketButton
|
|
||||||
}else{
|
|
||||||
var localTicketButton = ticketButton2
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTicketButtons = currentTicketButtons + 1
|
|
||||||
|
|
||||||
if (config.options.ticket1.isURL == false){
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("newTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(config.options.ticket1.color))
|
|
||||||
.setEmoji(config.options.ticket1.icon)
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("LINK")
|
|
||||||
.setEmoji(config.options.ticket1.icon)
|
|
||||||
.setURL(config.options.ticket1.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (config.options.ticket2.enabled){
|
|
||||||
if (currentTicketButtons < 4){
|
|
||||||
var localTicketButton = ticketButton
|
|
||||||
}else{
|
|
||||||
var localTicketButton = ticketButton2
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTicketButtons = currentTicketButtons + 1
|
|
||||||
|
|
||||||
if (config.options.ticket2.isURL == false){
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("newTicket2")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(config.options.ticket2.color))
|
|
||||||
.setEmoji(config.options.ticket2.icon)
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("LINK")
|
|
||||||
.setEmoji(config.options.ticket2.icon)
|
|
||||||
.setURL(config.options.ticket2.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.options.ticket3.enabled){
|
|
||||||
if (currentTicketButtons < 4){
|
|
||||||
var localTicketButton = ticketButton
|
|
||||||
}else{
|
|
||||||
var localTicketButton = ticketButton2
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTicketButtons = currentTicketButtons + 1
|
|
||||||
|
|
||||||
if (config.options.ticket3.isURL == false){
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("newTicket3")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(config.options.ticket3.color))
|
|
||||||
.setEmoji(config.options.ticket3.icon)
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("LINK")
|
|
||||||
.setEmoji(config.options.ticket3.icon)
|
|
||||||
.setURL(config.options.ticket3.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.options.ticket4.enabled){
|
|
||||||
if (currentTicketButtons < 4){
|
|
||||||
var localTicketButton = ticketButton
|
|
||||||
}else{
|
|
||||||
var localTicketButton = ticketButton2
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTicketButtons = currentTicketButtons + 1
|
|
||||||
|
|
||||||
if (config.options.ticket4.isURL == false){
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("newTicket4")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(config.options.ticket4.color))
|
|
||||||
.setEmoji(config.options.ticket4.icon)
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("LINK")
|
|
||||||
.setEmoji(config.options.ticket4.icon)
|
|
||||||
.setURL(config.options.ticket4.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.options.ticket5.enabled){
|
|
||||||
if (currentTicketButtons < 4){
|
|
||||||
var localTicketButton = ticketButton
|
|
||||||
}else{
|
|
||||||
var localTicketButton = ticketButton2
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTicketButtons = currentTicketButtons + 1
|
|
||||||
|
|
||||||
if (config.options.ticket5.isURL == false){
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("newTicket5")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(config.options.ticket5.color))
|
|
||||||
.setEmoji(config.options.ticket5.icon)
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("LINK")
|
|
||||||
.setEmoji(config.options.ticket5.icon)
|
|
||||||
.setURL(config.options.ticket5.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.options.ticket6.enabled){
|
|
||||||
if (currentTicketButtons < 4){
|
|
||||||
var localTicketButton = ticketButton
|
|
||||||
}else{
|
|
||||||
var localTicketButton = ticketButton2
|
|
||||||
}
|
|
||||||
|
|
||||||
currentTicketButtons = currentTicketButtons + 1
|
|
||||||
|
|
||||||
if (config.options.ticket6.isURL == false){
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("newTicket6")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(config.options.ticket6.color))
|
|
||||||
.setEmoji(config.options.ticket6.icon)
|
|
||||||
)
|
|
||||||
}else{
|
|
||||||
localTicketButton.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("LINK")
|
|
||||||
.setEmoji(config.options.ticket6.icon)
|
|
||||||
.setURL(config.options.ticket6.url)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var categorylist = ""
|
|
||||||
if (config.options.ticket1.enabled){categorylist = categorylist+"\n"+config.options.ticket1.icon+": **"+config.options.ticket1.name+"**\n"+config.options.ticket1.description}
|
|
||||||
|
|
||||||
if (config.options.ticket2.enabled){categorylist = categorylist+"\n\n"+config.options.ticket2.icon+": **"+config.options.ticket2.name+"**\n"+config.options.ticket2.description}
|
|
||||||
|
|
||||||
if (config.options.ticket3.enabled){categorylist = categorylist+"\n\n"+config.options.ticket3.icon+": **"+config.options.ticket3.name+"**\n"+config.options.ticket3.description}
|
|
||||||
|
|
||||||
if (config.options.ticket4.enabled){categorylist = categorylist+"\n\n"+config.options.ticket4.icon+": **"+config.options.ticket4.name+"**\n"+config.options.ticket4.description}
|
|
||||||
|
|
||||||
if (config.options.ticket5.enabled){categorylist = categorylist+"\n\n"+config.options.ticket5.icon+": **"+config.options.ticket5.name+"**\n"+config.options.ticket5.description}
|
|
||||||
|
|
||||||
if (config.options.ticket6.enabled){categorylist = categorylist+"\n\n"+config.options.ticket6.icon+": **"+config.options.ticket6.name+"**\n"+config.options.ticket6.description}
|
|
||||||
|
|
||||||
|
|
||||||
|
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
||||||
|
|
||||||
var ticketEmbed = new discord.MessageEmbed()
|
msg.channel.send({embeds:[embed],components:componentRows})
|
||||||
if (config.layout.ticketMsg.customColorEnabled){
|
|
||||||
ticketEmbed.setColor(config.layout.ticketMsg.customColor)
|
|
||||||
}else{ticketEmbed.setColor(config.main_color)}
|
|
||||||
|
|
||||||
if (config.layout.ticketMsg.footerEnabled){
|
log("command","someone used the 'message' command",[{key:"user",value:msg.author.tag},{key:"id",value:id}])
|
||||||
ticketEmbed.setFooter({text:config.layout.ticketMsg.footer})
|
APIEvents.onCommand("message",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
||||||
}
|
|
||||||
if (config.layout.ticketMsg.thumbnailEnabled){
|
|
||||||
ticketEmbed.setThumbnail(config.layout.ticketMsg.thumbnailURL)
|
|
||||||
}
|
|
||||||
|
|
||||||
ticketEmbed.setDescription("**Create a ticket:**\nClick one of the buttons below to create a ticket.\n\n__choose a category:__"+categorylist+"\n\n**watch out:**_You can only create "+config.system.max_allowed_tickets+" ticket(s) at a time!_")
|
|
||||||
|
|
||||||
|
|
||||||
if (currentTicketButtons <= 4){
|
|
||||||
var embedComponents = [ticketButton]
|
|
||||||
}else{var embedComponents = [ticketButton,ticketButton2]}
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[ticketEmbed],components:embedComponents})
|
|
||||||
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket msg (user:"+msg.author.username+")")}
|
|
||||||
if (config.logs){console.log("[system] created ticket message")}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!DISABLE.commands.slash.msg) client.on("interactionCreate", (interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return
|
||||||
|
if (interaction.commandName != "message") return
|
||||||
|
|
||||||
|
if (!interaction.guild) return
|
||||||
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const id = interaction.options.getString("id")
|
||||||
|
|
||||||
|
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
||||||
|
|
||||||
|
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
||||||
|
|
||||||
|
interaction.reply({content:l.commands.ticketWarning})
|
||||||
|
interaction.channel.send({embeds:[embed],components:componentRows})
|
||||||
|
|
||||||
|
log("command","someone used the 'message' command",[{key:"user",value:interaction.user.tag},{key:"id",value:id}])
|
||||||
|
|
||||||
|
APIEvents.onCommand("message",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = require("../config.json")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
var args = msg.content.split(" ")
|
|
||||||
if (args[0] == config.prefix+"ticket" && (args[1] == undefined ||args[1] == "" ||args[1] == null)){
|
|
||||||
var TicketHelpMsg = new discord.MessageEmbed()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("Ticket commands")
|
|
||||||
|
|
||||||
const prefix = config.prefix
|
|
||||||
TicketHelpMsg.setDescription("**Go to <#"+config.system.ticket_channel+"> to create a ticket!**\n\n`"+prefix+"ticket msg` ➜ _Admin command._\n`"+prefix+"ticket rename` ➜ _Rename a ticket (no spaces)._\n`"+prefix+"ticket close` ➜ _Close a ticket._\n`"+prefix+"ticket add <user>` ➜ _Add a user to the ticket._\n`"+prefix+"ticket remove <user>` ➜ _Remove a user from the ticket._\n`"+prefix+"resetdatabase` ➜ _Steps to reset the database._\n`"+prefix+"resetdb` ➜ _Also database stuff._")
|
|
||||||
|
|
||||||
if (config.credits){
|
|
||||||
TicketHelpMsg.setFooter({text:"Open-Ticket by DJdj Development | view on github for source code"})
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[TicketHelpMsg]})
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket help (user:"+msg.author.username+")")}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
var args = msg.content.split(" ")
|
|
||||||
if (args[0] == config.prefix+"ticket" && args[1] == "close"){
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
|
|
||||||
if (firstmsg == undefined){
|
|
||||||
msg.channel.send({content:"I didn't find the close button!"})
|
|
||||||
}
|
|
||||||
if (firstmsg.author.id != client.user.id){
|
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var CloseMsg = new discord.MessageEmbed()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setDescription("Click [here]("+firstmsg.url+") to close this ticket.")
|
|
||||||
.setTitle("Close this ticket:")
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[CloseMsg]})
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket close (user:"+msg.author.username+")")}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
var args = msg.content.split(" ")
|
|
||||||
if (args[0] == config.prefix+"ticket" && args[1] == "rename"){
|
|
||||||
|
|
||||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
|
||||||
msg.channel.send({content:config.messages.general.nopermissions})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[2] == null || args[2] == undefined || args[2] == "" || args[2] == false){
|
|
||||||
msg.channel.send({content:"Not enough parameters!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var name = args[2]
|
|
||||||
var oldname = msg.channel.name
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
if (msglist.last().author.id == client.user.id){
|
|
||||||
msg.channel.send({content:"The name from the ticket is changed!"}).then(rmsg => {
|
|
||||||
rmsg.channel.setName(name)
|
|
||||||
if (config.logs){console.log("[system] renamed a ticket (name:"+oldname+",newname:"+name+")")}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket rename (user:"+msg.author.username+")")}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
var args = msg.content.split(" ")
|
|
||||||
if (args[0] == config.prefix+"ticket" && args[1] == "add"){
|
|
||||||
|
|
||||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
|
||||||
msg.channel.send({content:config.messages.general.nopermissions})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetch().then(msglist => {
|
|
||||||
if (msglist.last().author.id != client.user.id){
|
|
||||||
msg.channel.send({content:"You are not in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[2] == null || args[2] == undefined || args[2] == "" || args[2] == false){
|
|
||||||
msg.channel.send({content:"Not enough parameters!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
if (!user){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.create(user.id, { VIEW_CHANNEL:true, ADD_REACTIONS:true,ATTACH_FILES:true, EMBED_LINKS:true, SEND_MESSAGES:true})
|
|
||||||
if (config.logs){console.log("[system] added user to ticket (name:"+user.username+",ticket:"+msg.channel.name+")")}
|
|
||||||
|
|
||||||
})
|
|
||||||
var loguser = msg.mentions.users.first()
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket add "+loguser.username+" (user:"+msg.author.username+")")}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("messageCreate",msg => {
|
|
||||||
var args = msg.content.split(" ")
|
|
||||||
if (args[0] == config.prefix+"ticket" && args[1] == "remove"){
|
|
||||||
|
|
||||||
if (msg.member.roles.cache.has(config.botperms_role) == false && msg.author.id != "779742674932072469"){
|
|
||||||
msg.channel.send({content:config.messages.general.nopermissions})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
if (msglist.last().author.id != client.user.id){
|
|
||||||
msg.channel.send({content:"You aren't in a ticket!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[2] == null || args[2] == undefined || args[2] == "" || args[2] == false){
|
|
||||||
msg.channel.send({content:"Not enough parameters!"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
if (!user){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.delete(user.id)
|
|
||||||
if (config.logs){console.log("[system] removed user from ticket (name:"+user.username+",ticket:"+msg.channel.name+")")}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
|
||||||
if (config.logs){console.log("[command] "+config.prefix+"ticket remove "+loguser.username+" (user:"+msg.author.username+")")}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,309 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = require("../config.json")
|
|
||||||
|
|
||||||
const ticketStorage = bot.TicketStorage
|
|
||||||
const userTicketStorage = bot.userTicketStorage
|
|
||||||
const transcriptStorage = bot.transcriptStorage
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
|
|
||||||
var closeButton = new discord.MessageActionRow()
|
|
||||||
.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("closeTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("SECONDARY")
|
|
||||||
.setLabel("Close Ticket")
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
//ticket button click / create ticket
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
|
|
||||||
if (interaction.isButton() == false){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interaction.customId == "newTicket1"||interaction.customId == "newTicket2"||interaction.customId == "newTicket3"||interaction.customId == "newTicket4"||interaction.customId == "newTicket5"||interaction.customId == "newTicket6"){
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (ticketStorage.getItem(interaction.member.id) == null ||ticketStorage.getItem(interaction.member.id) == "false"|| Number(ticketStorage.getItem(interaction.member.id)) < config.system.max_allowed_tickets){
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send(config.messages.dm.newTicket)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{console.log("can't send DM to member || member doesn't allow dm's")}
|
|
||||||
|
|
||||||
|
|
||||||
//update storage
|
|
||||||
ticketStorage.setItem(interaction.member.id,Number(ticketStorage.getItem(interaction.member.id))+1)
|
|
||||||
var ticketNumber = interaction.member.user.username
|
|
||||||
|
|
||||||
//set ticketName
|
|
||||||
if (interaction.customId == "newTicket1"){
|
|
||||||
var ticketName = config.options.ticket1.channel_prefix+ticketNumber
|
|
||||||
var logsname = config.options.ticket1.name
|
|
||||||
}else if (interaction.customId == "newTicket2"){
|
|
||||||
var ticketName = config.options.ticket2.channel_prefix+ticketNumber
|
|
||||||
var logsname = config.options.ticket2.name
|
|
||||||
}else if (interaction.customId == "newTicket3"){
|
|
||||||
var ticketName = config.options.ticket3.channel_prefix+ticketNumber
|
|
||||||
var logsname = config.options.ticket3.name
|
|
||||||
}else if (interaction.customId == "newTicket4"){
|
|
||||||
var ticketName = config.options.ticket4.channel_prefix+ticketNumber
|
|
||||||
var logsname = config.options.ticket4.name
|
|
||||||
}else if (interaction.customId == "newTicket5"){
|
|
||||||
var ticketName = config.options.ticket5.channel_prefix+ticketNumber
|
|
||||||
var logsname = config.options.ticket5.name
|
|
||||||
}else if (interaction.customId == "newTicket6"){
|
|
||||||
var ticketName = config.options.ticket6.channel_prefix+ticketNumber
|
|
||||||
var logsname = config.options.ticket6.name
|
|
||||||
}
|
|
||||||
|
|
||||||
//set category
|
|
||||||
if (config.system.enable_category){
|
|
||||||
var Category = config.system.ticket_category
|
|
||||||
}else{var Category = null}
|
|
||||||
|
|
||||||
var permissionsArray = []
|
|
||||||
|
|
||||||
//set everyone allowed
|
|
||||||
if (config.system['has@everyoneaccess']){
|
|
||||||
var everyoneAllowPerms = ["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
|
||||||
var everyoneDenyPerms = []
|
|
||||||
}else{
|
|
||||||
var everyoneAllowPerms = []
|
|
||||||
var everyoneDenyPerms = ["VIEW_CHANNEL"]
|
|
||||||
}
|
|
||||||
permissionsArray.push({
|
|
||||||
id:interaction.member.id,
|
|
||||||
type:"member",
|
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
|
||||||
})
|
|
||||||
permissionsArray.push({
|
|
||||||
id:config.botperms_role,
|
|
||||||
type:"role",
|
|
||||||
allow:["ADD_REACTIONS","ATTACH_FILES","EMBED_LINKS","SEND_MESSAGES","VIEW_CHANNEL"]
|
|
||||||
})
|
|
||||||
permissionsArray.push({
|
|
||||||
id:interaction.guild.id,
|
|
||||||
type:"role",
|
|
||||||
allow:everyoneAllowPerms,
|
|
||||||
deny:everyoneDenyPerms
|
|
||||||
})
|
|
||||||
if (config.system.member_role == "" || config.system.member_role == " " || config.system.member_role == "false" || config.system.member_role == "null" || config.system.member_role == "0"){
|
|
||||||
permissionsArray.push({
|
|
||||||
id:config.system.member_role,
|
|
||||||
type:"role",
|
|
||||||
deny:["VIEW_CHANNEL"]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//create the channel
|
|
||||||
interaction.guild.channels.create(ticketName,{
|
|
||||||
type:"GUILD_TEXT",
|
|
||||||
parent:Category,
|
|
||||||
permissionOverwrites:permissionsArray
|
|
||||||
}).then(tChannel => {
|
|
||||||
userTicketStorage.setItem(tChannel.id,interaction.member.id)
|
|
||||||
|
|
||||||
|
|
||||||
var ticketEmbed = new discord.MessageEmbed()
|
|
||||||
if (config.layout.ticketEmbed.customColorEnabled){
|
|
||||||
ticketEmbed.setColor(config.layout.ticketEmbed.customColor)
|
|
||||||
}else{ticketEmbed.setColor(config.main_color)}
|
|
||||||
|
|
||||||
if (config.layout.ticketEmbed.footerEnabled){
|
|
||||||
ticketEmbed.setFooter({text:"config.layout.ticketEmbed.footer"})
|
|
||||||
}
|
|
||||||
if (config.layout.ticketEmbed.thumbnailEnabled){
|
|
||||||
ticketEmbed.setThumbnail(config.layout.ticketEmbed.thumbnailURL)
|
|
||||||
}
|
|
||||||
ticketEmbed.setTitle("You created a ticket!")
|
|
||||||
ticketEmbed.setDescription(config.messages.ticket.newTicketEmbed)
|
|
||||||
|
|
||||||
tChannel.send({content:"<@"+interaction.member.id+"> <@&"+config.botperms_role+">",embeds:[ticketEmbed],components:[closeButton]}).then(firstmsg => {
|
|
||||||
firstmsg.pin()
|
|
||||||
})
|
|
||||||
if (config.logs){console.log("[system] created a new ticket (name:"+logsname+",user:"+interaction.user.username+")")}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
|
||||||
try {
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send(config.messages.dm.alreadyCreated)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{console.log("can't send DM to member || member doesn't allow dm's")}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
//closeBAR
|
|
||||||
var closeBar = new discord.MessageActionRow()
|
|
||||||
.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("closeTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("SECONDARY")
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.MessageButton()
|
|
||||||
.setCustomId("closeTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle("SECONDARY")
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (interaction.isButton() == false){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (interaction.customId == "closeTicket"){
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[closeBar]})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (interaction.isButton() == false){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (interaction.customId == "closeTicketFalse"){
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
interaction.message.edit({components:[closeButton]})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (interaction.isButton() == false){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (interaction.customId == "closeTicketTrue"){
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.channel.messages.fetch().then(messages => {
|
|
||||||
var transcriptArray = []
|
|
||||||
messages.forEach(msg => {
|
|
||||||
if (msg.author.id != client.user.id){
|
|
||||||
transcriptArray.push("["+msg.author.username+"]: "+msg.content)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
var getuserID = userTicketStorage.getItem(interaction.channel.id)
|
|
||||||
var getusernameStep1 = client.users.cache.find(u => u.id === getuserID)
|
|
||||||
if (getusernameStep1 == null || getusernameStep1 == undefined || getusernameStep1 == false || getusernameStep1 == ""){
|
|
||||||
var getuserNAME = ":usernotfound:"
|
|
||||||
}else {
|
|
||||||
var getuserNAME = getusernameStep1.username
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (config.system.enable_transcript){
|
|
||||||
var transcript = transcriptArray.reverse().join("\n")
|
|
||||||
transcriptStorage.setItem(interaction.channel.id,transcript)
|
|
||||||
|
|
||||||
//transcript color & thumbnail
|
|
||||||
if (config.layout.transcripts.customColorEnabled){
|
|
||||||
var transcriptColor = config.layout.transcripts.customColor
|
|
||||||
}else{var transcriptColor = config.main_color}
|
|
||||||
|
|
||||||
if (config.layout.transcripts.thumbnailEnabled){
|
|
||||||
var transcriptThumbnail = config.layout.transcripts.thumbnailURL
|
|
||||||
}else{var transcriptThumbnail = ""}
|
|
||||||
|
|
||||||
var splittedTranscript = [transcript.slice(0,2000)]
|
|
||||||
if (transcript.length > 4000){
|
|
||||||
splittedTranscript.push(transcript.slice(2000,4000))
|
|
||||||
splittedTranscript.push(transcript.slice(4000))
|
|
||||||
}else if (transcript.length > 2000){
|
|
||||||
splittedTranscript.push(transcript.slice(2000))
|
|
||||||
}
|
|
||||||
var transcriptEmbed = new discord.MessageEmbed()
|
|
||||||
.setColor(transcriptColor)
|
|
||||||
.setAuthor({name:interaction.channel.name + " - ticket created by "+getuserNAME})
|
|
||||||
.setTitle("There is a new transcript!")
|
|
||||||
.setDescription(splittedTranscript[0])
|
|
||||||
.setFooter({text:"ticket closed by "+interaction.member.user.username})
|
|
||||||
.setThumbnail(transcriptThumbnail)
|
|
||||||
|
|
||||||
if (transcript.length > 4000){
|
|
||||||
var transcriptEmbed2 = new discord.MessageEmbed()
|
|
||||||
.setColor(transcriptColor)
|
|
||||||
.setAuthor({name:interaction.channel.name + " - ticket created by "+getuserNAME})
|
|
||||||
.setTitle("transcript #2")
|
|
||||||
.setDescription(splittedTranscript[1])
|
|
||||||
.setFooter("ticket closed by "+interaction.member.user.username)
|
|
||||||
.setThumbnail(transcriptThumbnail)
|
|
||||||
|
|
||||||
var transcriptEmbed3 = new discord.MessageEmbed()
|
|
||||||
.setColor(transcriptColor)
|
|
||||||
.setAuthor({name:interaction.channel.name + " - ticket created by "+getuserNAME})
|
|
||||||
.setTitle("transcript #3")
|
|
||||||
.setDescription(splittedTranscript[1])
|
|
||||||
.setFooter({text:"ticket closed by "+interaction.member.user.username})
|
|
||||||
.setThumbnail(transcriptThumbnail)
|
|
||||||
|
|
||||||
client.channels.cache.find(ch => ch.id == config.system.transcript_channel).send({embeds:[transcriptEmbed,transcriptEmbed2,transcriptEmbed3]})
|
|
||||||
|
|
||||||
}else if (transcript.length > 2000){
|
|
||||||
var transcriptEmbed2 = new discord.MessageEmbed()
|
|
||||||
.setColor(transcriptColor)
|
|
||||||
.setAuthor({name:interaction.channel.name + " - ticket created by "+getuserNAME})
|
|
||||||
.setTitle("transcript #2")
|
|
||||||
.setDescription(splittedTranscript[1])
|
|
||||||
.setFooter({text:"ticket closed by "+interaction.member.user.username})
|
|
||||||
.setThumbnail(transcriptThumbnail)
|
|
||||||
|
|
||||||
client.channels.cache.find(ch => ch.id == config.system.transcript_channel).send({embeds:[transcriptEmbed,transcriptEmbed2]})
|
|
||||||
}else{
|
|
||||||
client.channels.cache.find(ch => ch.id == config.system.transcript_channel).send({embeds:[transcriptEmbed]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interaction.channel.delete()
|
|
||||||
if (config.logs){console.log("[system] closed a ticket (name:"+interaction.channel.name+",user:"+interaction.user.username+")")}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ticketStorage.setItem(getuserID,Number(ticketStorage.getItem(getuserID)) - 1)
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send(config.messages.dm.closeTicket)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{console.log("can't send DM to member || member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
process.on('unhandledRejection',error => {
|
|
||||||
console.log("ERROR: "+error)
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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())
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
+88
-112
@@ -1,132 +1,108 @@
|
|||||||
{
|
{
|
||||||
"bot_name":"Wumpus",
|
"main_color":"#ffffff",
|
||||||
"main_color":"#fffff",
|
"server_id":"server id (for slash cmds)",
|
||||||
"auth_token":"the bot's auth token",
|
"auth_token":"auth token",
|
||||||
"botperms_role":"the id from an admin role (they can do admin things with the bot)",
|
"main_adminroles":["discord role id"],
|
||||||
"prefix":"!",
|
"prefix":"!ticket ",
|
||||||
"logs":true,
|
"languagefile":"english",
|
||||||
|
|
||||||
"credits":true,
|
"credits":true,
|
||||||
"status":{
|
"status":{
|
||||||
"enabled":true,
|
"enabled":true,
|
||||||
"type":"PLAYING | LISTENING | WATCHING | CUSTOM",
|
"type":"PLAYING",
|
||||||
"text":"!ticket"
|
"text":"!ticket help"
|
||||||
},
|
},
|
||||||
|
|
||||||
"system":{
|
"system":{
|
||||||
"ticket_channel":"id of the channel with the !ticket msg",
|
"ticket_channel":"channel id",
|
||||||
"max_allowed_tickets":5,
|
"max_allowed_tickets":3,
|
||||||
"enable_DM_Messages":true,
|
"enable_DM_Messages":true,
|
||||||
|
|
||||||
"enable_category":false,
|
|
||||||
"ticket_category":"the id of a category for the tickets",
|
|
||||||
|
|
||||||
"has@everyoneaccess":false,
|
"has@everyoneaccess":false,
|
||||||
"member_role":"this role doesn't have access to tickets",
|
"member_role":"member role (doesn't have access to tickets)",
|
||||||
|
"closeMode":"adminonly|normal",
|
||||||
|
|
||||||
"enable_transcript":false,
|
"enable_transcript":false,
|
||||||
"transcript_channel":"the channel for transcripts"
|
"enable_DM_transcript":false,
|
||||||
|
"transcript_channel":"channel id",
|
||||||
|
|
||||||
|
"showSlashcmdsInHelp":false
|
||||||
},
|
},
|
||||||
|
|
||||||
"messages":{
|
"options":[
|
||||||
"general":{
|
{
|
||||||
"nopermissions":"**You don't have permissions to run this command!**"
|
"id":"general",
|
||||||
},
|
|
||||||
"dm":{
|
|
||||||
"alreadyCreated":"**You currently have as many open tickets as the maximum allowed!**",
|
|
||||||
"newTicket":"You created a new ticket in our server, the staff will come and help you soon!",
|
|
||||||
"closeTicket":"**Your ticket is closed!**"
|
|
||||||
},
|
|
||||||
"ticket":{
|
|
||||||
"newTicketEmbed":"You created a ticket!\n\n_Click on the close button below to close this ticket_"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"layout":{
|
|
||||||
"transcripts":{
|
|
||||||
"customColorEnabled":false,
|
|
||||||
"customColor":"#ffffff",
|
|
||||||
"thumbnailEnabled":false,
|
|
||||||
"thumbnailURL":"https://www.example.com/path/to/image.png"
|
|
||||||
},
|
|
||||||
"ticketMsg":{
|
|
||||||
"customColorEnabled":false,
|
|
||||||
"customColor":"#ffffff",
|
|
||||||
"footerEnabled":false,
|
|
||||||
"footer":"We are using open-tickets from DJj123dj",
|
|
||||||
"thumbnailEnabled":false,
|
|
||||||
"thumbnailURL":"https://www.example.com/path/to/image.png"
|
|
||||||
},
|
|
||||||
"ticketEmbed":{
|
|
||||||
"customColorEnabled":false,
|
|
||||||
"customColor":"#ffffff",
|
|
||||||
"footerEnabled":false,
|
|
||||||
"footer":"This is embed in the start of a ticket.",
|
|
||||||
"thumbnailEnabled":false,
|
|
||||||
"thumbnailURL":"https://www.example.com/path/to/image.png"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"options":{
|
|
||||||
"ticket1":{
|
|
||||||
"enabled":true,
|
|
||||||
"icon":"🎫",
|
|
||||||
"description":"Create a general ticket.",
|
|
||||||
"name":"Ticket",
|
|
||||||
"channel_prefix":"ticket-",
|
|
||||||
"color":"red | green | blue | gray | none",
|
|
||||||
"isURL":false,
|
|
||||||
"url":"https://www.example.com/a/random/path/to/a/website"
|
|
||||||
},
|
|
||||||
"ticket2":{
|
|
||||||
"enabled":false,
|
|
||||||
"icon":"💼",
|
|
||||||
"description":"Do you want to apply? Then click here!",
|
|
||||||
"name":"Apply",
|
|
||||||
"channel_prefix":"apply-",
|
|
||||||
"color":"red | green | blue | gray | none",
|
|
||||||
"isURL":false,
|
|
||||||
"url":"https://www.example.com/a/random/path/to/a/website"
|
|
||||||
},
|
|
||||||
"ticket3":{
|
|
||||||
"enabled":false,
|
|
||||||
"icon":"❓",
|
|
||||||
"description":"Click here if you have a question about the server.",
|
|
||||||
"name":"Question",
|
"name":"Question",
|
||||||
"channel_prefix":"question-",
|
"description":"Create this ticket if you have a question.",
|
||||||
"color":"red | green | blue | gray | none",
|
"icon":"🎫",
|
||||||
"isURL":false,
|
"label":"question",
|
||||||
"url":"https://www.example.com/a/random/path/to/a/website"
|
"type":"ticket",
|
||||||
|
|
||||||
|
"color":"gray",
|
||||||
|
"adminroles":["role id"],
|
||||||
|
"channelprefix":"question-",
|
||||||
|
"category":"category id",
|
||||||
|
"message":"You created a ticket!",
|
||||||
|
"enableDmOnOpen":true,
|
||||||
|
"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"
|
||||||
|
},
|
||||||
|
|
||||||
|
"closedCategory":{
|
||||||
|
"enable":false,
|
||||||
|
"id":"category id"
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"ticket4":{
|
{
|
||||||
"enabled":false,
|
"id":"website",
|
||||||
"icon":"🛒",
|
"name":"Website",
|
||||||
"description":"Buy something in our shop.",
|
"description":"Go to our website.",
|
||||||
"name":"Shop",
|
"icon":"✅",
|
||||||
"channel_prefix":"shop-",
|
"label":"click here",
|
||||||
"color":"red | green | blue | gray | none",
|
"type":"website",
|
||||||
"isURL":false,
|
|
||||||
"url":"https://www.example.com/a/random/path/to/a/website"
|
"url":"https://www.dj-dj.be"
|
||||||
|
|
||||||
},
|
},
|
||||||
"ticket5":{
|
{
|
||||||
"enabled":false,
|
"id":"role",
|
||||||
"icon":"😄",
|
"name":"Verify",
|
||||||
"description":"hello",
|
"description":"Click here to get the verify role.",
|
||||||
"name":"AnotherTicket",
|
"icon":"👮🏼",
|
||||||
"channel_prefix":"prefix-",
|
"label":"get a role",
|
||||||
"color":"red | green | blue | gray | none",
|
"type":"role",
|
||||||
"isURL":false,
|
|
||||||
"url":"https://www.example.com/a/random/path/to/a/website"
|
"color":"red",
|
||||||
},
|
"roles":["discord role id"],
|
||||||
"ticket6":{
|
"mode":"add&remove|remove|add",
|
||||||
"enabled":false,
|
"enableDmOnOpen":true
|
||||||
"icon":"😄",
|
|
||||||
"description":"hello",
|
|
||||||
"name":"AnotherTicket",
|
|
||||||
"channel_prefix":"prefix-",
|
|
||||||
"color":"red | green | blue | gray | none",
|
|
||||||
"isURL":false,
|
|
||||||
"url":"https://www.example.com/a/random/path/to/a/website"
|
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
|
|
||||||
|
"messages":[
|
||||||
|
{
|
||||||
|
"id":"1",
|
||||||
|
"name":"Choose Your Ticket",
|
||||||
|
"description":"You can click one of the buttons below!",
|
||||||
|
"dropdown":false,
|
||||||
|
|
||||||
|
"enableFooter":false,
|
||||||
|
"footer":"Open Ticket v3.0.0 - I'm a footer!",
|
||||||
|
|
||||||
|
"enableThumbnail":false,
|
||||||
|
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||||
|
|
||||||
|
"enableCustomColor":false,
|
||||||
|
"color":"#ffffff",
|
||||||
|
|
||||||
|
"options":["general","apply"],
|
||||||
|
"enableTicketExplaination":true,
|
||||||
|
"enableMaxTicketsWarning":true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
//base
|
||||||
|
const bot = require("../../index")
|
||||||
|
|
||||||
|
exports.client = bot.client
|
||||||
|
exports.config = bot.config
|
||||||
|
exports.utils = {
|
||||||
|
log:bot.errorLog.log(),
|
||||||
|
storage:bot.storage
|
||||||
|
}
|
||||||
|
|
||||||
|
//events
|
||||||
|
const events = require("./modules/events").events
|
||||||
|
exports.events = events
|
||||||
|
|
||||||
|
//actions
|
||||||
|
const actions = require("./modules/actions").actions
|
||||||
|
//comming soon
|
||||||
|
//exports.actions = actions
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"version":"1.0.0",
|
||||||
|
"enableAPIdebug":false,
|
||||||
|
"enableAPIconsolelogs":false,
|
||||||
|
|
||||||
|
"info":"If you turn these switches to true, then the feature will be turned OFF!",
|
||||||
|
"info2":"You can use this to disable some features you don't want!",
|
||||||
|
"disable":{
|
||||||
|
"messages":{
|
||||||
|
"DISCLAIMER":"the messages part doesn't work yet!",
|
||||||
|
"ticketCreated":false,
|
||||||
|
"ticketClosed":false,
|
||||||
|
"ticketDeleted":false,
|
||||||
|
"ticketReopened":false
|
||||||
|
},
|
||||||
|
"transcripts":{
|
||||||
|
"server":false,
|
||||||
|
"dm":false
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"text":{
|
||||||
|
"help":false,
|
||||||
|
"msg":false,
|
||||||
|
"close":false,
|
||||||
|
"delete":false,
|
||||||
|
"reopen":false,
|
||||||
|
"new":false,
|
||||||
|
"add":false,
|
||||||
|
"remove":false,
|
||||||
|
"rename":false,
|
||||||
|
"claim":false,
|
||||||
|
"unclaim":false
|
||||||
|
},
|
||||||
|
"slash":{
|
||||||
|
"help":false,
|
||||||
|
"msg":false,
|
||||||
|
"close":false,
|
||||||
|
"delete":false,
|
||||||
|
"reopen":false,
|
||||||
|
"new":false,
|
||||||
|
"add":false,
|
||||||
|
"remove":false,
|
||||||
|
"rename":false,
|
||||||
|
"claim":false,
|
||||||
|
"unclaim":false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"checkerjs":{
|
||||||
|
"token":false,
|
||||||
|
"all":false
|
||||||
|
},
|
||||||
|
"debug":{
|
||||||
|
"all":false,
|
||||||
|
"debuglogs":false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
//ACTIONS:
|
||||||
|
|
||||||
|
|
||||||
|
//EXPORT ACTIONS:
|
||||||
|
exports.actions = {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/** FOR DEVELOPERS ONLY!!
|
||||||
|
* Don't change anything in this file before reading the documentation!
|
||||||
|
* visit the api documentation at https://docs.openticket.dj-dj.be
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
exports.embeddedMode = false
|
||||||
|
exports.clientLocation = require("../../../index").client
|
||||||
@@ -0,0 +1,361 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../../../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
const storage = bot.storage
|
||||||
|
|
||||||
|
|
||||||
|
//EVENT API:
|
||||||
|
const ticketOpenListeners = []
|
||||||
|
const ticketCloseListeners = []
|
||||||
|
const ticketDeleteListeners = []
|
||||||
|
const ticketReopenListeners = []
|
||||||
|
|
||||||
|
const ticketAddListeners = []
|
||||||
|
const ticketRemoveListeners = []
|
||||||
|
|
||||||
|
|
||||||
|
const transcriptCreationListeners = []
|
||||||
|
const commandListeners = []
|
||||||
|
const reactionRoleListeners = []
|
||||||
|
const errorListeners = []
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketOpen = (user,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","new ticket created",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketOpenListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
* @param {String} reason
|
||||||
|
*/
|
||||||
|
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","ticket closed",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)},{key:"reason",value:reason}])
|
||||||
|
|
||||||
|
ticketCloseListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,channel,guild,date,ticketdata,reason)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","ticket deleted",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketDeleteListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","ticket reopened",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketReopenListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.User} editeduser
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","user added to ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketAddListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,editeduser,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.User} editeduser
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","user removed from ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
||||||
|
|
||||||
|
ticketRemoveListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(user,editeduser,channel,guild,date,ticketdata)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.Message[]} messages
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
exports.onTranscriptCreation = (messages,channel,guild,date) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","transcript created",[{key:"messages",value:JSON.stringify(messages)},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
||||||
|
|
||||||
|
transcriptCreationListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(messages,channel,guild,date)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@typedef {"help"|"message"|"close"|"delete"|"reopen"|"rename"|"add"|"remove"} OTCommandType */
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {OTCommandType} type
|
||||||
|
* @param {Boolean} hasPerms
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
||||||
|
|
||||||
|
const newguild = guild ? guild : false
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","someone used a command",[{key:"type",value:type},{key:"hasPerms",value:hasPerms},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:newguild.id}])
|
||||||
|
|
||||||
|
commandListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(type,hasPerms,user,channel,newguild,date)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@typedef {"add"|"remove"|"add&remove"} OTReactionRoleType */
|
||||||
|
/**@typedef {"add"|"remove"} OTReactionRoleMode */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {OTReactionRoleMode} mode
|
||||||
|
* @param {OTReactionRoleType} type
|
||||||
|
* @param {discord.Role} role
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
exports.onReactionRole = (mode,type,role,user,channel,guild,date) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","someone used a reaction role",[{key:"mode",value:mode},{key:"type",value:type},{key:"roleid",value:role.id},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
||||||
|
|
||||||
|
reactionRoleListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(mode,type,role,user,channel,guild,date)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} err
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
exports.onError = (err,date) => {
|
||||||
|
//system
|
||||||
|
bot.errorLog.log("api","there is an error",[{key:"error",value:err}])
|
||||||
|
|
||||||
|
errorListeners.forEach((func) => {
|
||||||
|
try {
|
||||||
|
func(err,date)
|
||||||
|
}catch{}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//EVENT CALLBACKS:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback TicketActionEvent
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback TicketCloseEvent
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
* @param {String} reason
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback TranscriptCreationEvent
|
||||||
|
* @param {discord.Message[]} messages
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback TicketUserChangeEvent
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.User} editeduser
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback CommandEvent
|
||||||
|
* @param {OTCommandType} type
|
||||||
|
* @param {Boolean} hasPerms
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild|false} guild
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback ReactionRoleEvent
|
||||||
|
* @param {OTReactionRoleMode} mode
|
||||||
|
* @param {OTReactionRoleType} type
|
||||||
|
* @param {discord.Role} role
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.Guild} guild
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback ErrorEvent
|
||||||
|
* @param {String} error
|
||||||
|
* @param {Date} date
|
||||||
|
*/
|
||||||
|
|
||||||
|
//EVENT EXPORT:
|
||||||
|
|
||||||
|
/**@param {TicketActionEvent} callback */
|
||||||
|
const onTicketOpen = (callback) => {
|
||||||
|
ticketOpenListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketCloseEvent} callback */
|
||||||
|
const onTicketClose = (callback) => {
|
||||||
|
ticketCloseListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketActionEvent} callback */
|
||||||
|
const onTicketDelete = (callback) => {
|
||||||
|
ticketDeleteListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketActionEvent} callback */
|
||||||
|
const onTicketReopen = (callback) => {
|
||||||
|
ticketReopenListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketUserChangeEvent} callback */
|
||||||
|
const onTicketAdd = (callback) => {
|
||||||
|
ticketAddListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TicketUserChangeEvent} callback */
|
||||||
|
const onTicketRemove = (callback) => {
|
||||||
|
ticketRemoveListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {TranscriptCreationEvent} callback */
|
||||||
|
const onTranscriptCreation = (callback) => {
|
||||||
|
transcriptCreationListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {CommandEvent} callback */
|
||||||
|
const onCommand = (callback) => {
|
||||||
|
commandListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {ReactionRoleEvent} callback */
|
||||||
|
const onReactionRole = (callback) => {
|
||||||
|
commandListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {ErrorEvent} callback */
|
||||||
|
const onError = (callback) => {
|
||||||
|
errorListeners.push(callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.events = {
|
||||||
|
onTicketOpen,
|
||||||
|
onTicketClose,
|
||||||
|
onTicketDelete,
|
||||||
|
onTicketReopen,
|
||||||
|
onTicketAdd,
|
||||||
|
onTicketRemove,
|
||||||
|
onTranscriptCreation,
|
||||||
|
onCommand,
|
||||||
|
onReactionRole,
|
||||||
|
onError
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
const fs = require("fs")
|
||||||
|
const bot = require("../../index")
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
const files = fs.readdirSync("./plugins")
|
||||||
|
const api = require("./api.json")
|
||||||
|
var totalcount = 0
|
||||||
|
var successcount = 0
|
||||||
|
var failcount = 0
|
||||||
|
files.forEach((file) => {
|
||||||
|
if (file.endsWith(".plugin.js")){
|
||||||
|
try {
|
||||||
|
require("../../plugins/"+file)()
|
||||||
|
|
||||||
|
successcount++
|
||||||
|
totalcount++
|
||||||
|
}catch(err){
|
||||||
|
/**@type {Error} */
|
||||||
|
const theError = err
|
||||||
|
if (api.enableAPIdebug){
|
||||||
|
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")
|
||||||
|
}
|
||||||
|
failcount++
|
||||||
|
totalcount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
log("info","loaded plugins",[{key:"success",value:successcount},{key:"error",value:failcount},{key:"total",value:totalcount}])
|
||||||
|
}
|
||||||
+463
@@ -0,0 +1,463 @@
|
|||||||
|
exports.checker = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
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 isError = false
|
||||||
|
var warnList = []
|
||||||
|
var isWarn = false
|
||||||
|
const createError = (message) => {
|
||||||
|
isError = true
|
||||||
|
errorList.push("open-ticket CONFIG ERROR: "+message)
|
||||||
|
}
|
||||||
|
const createWarn = (message) => {
|
||||||
|
isWarn = true
|
||||||
|
warnList.push("open-ticket CONFIG WARNING: "+message)
|
||||||
|
}
|
||||||
|
|
||||||
|
//validators
|
||||||
|
/**@param {"userid"|"roleid"|"channelid"|"serverid"|"categoryid"} mode @param {String} value @param {String} path */
|
||||||
|
const checkDiscord = (mode,value,path) => {
|
||||||
|
if (mode == "userid"){
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+"' | this user id is invalid")
|
||||||
|
}
|
||||||
|
}else if (mode == "channelid"){
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+"' | this channel id is invalid")
|
||||||
|
}
|
||||||
|
}else if (mode == "roleid"){
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+"' | this role id is invalid")
|
||||||
|
}
|
||||||
|
}else if (mode == "serverid"){
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+"' | this server id is invalid")
|
||||||
|
}
|
||||||
|
}else if (mode == "categoryid"){
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+"' | this category id is invalid")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**@param {String} value */
|
||||||
|
const checkToken = (value) => {
|
||||||
|
if (value.length < 40){
|
||||||
|
createError("'auth_token' | your token is invalid")
|
||||||
|
}
|
||||||
|
if (value.includes(" ")) createError("'auth_token' | your token includes spaces!")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} value @param {String} path */
|
||||||
|
const checkHexColor = (value,path) => {
|
||||||
|
if (!/^#[a-fA-F0-9]{3,6}$/.test(value)){
|
||||||
|
if (value.length < 4) return createError("'"+path+"' | hex color too short! (example: #123abc)")
|
||||||
|
if (value.length > 7) return createError("'"+path+"' | hex color too long! (example: #123abc)")
|
||||||
|
createError("'"+path+"' | invalid color! (example: #123abc)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} value @param {String} path */
|
||||||
|
const checkEmbedColor = (value,path) => {
|
||||||
|
if (!['DEFAULT','WHITE','AQUA','GREEN','BLUE','YELLOW','PURPLE','LUMINOUS_VIVID_PINK','FUCHSIA','GOLD','ORANGE','RED','GREY','DARKER_GREY','NAVY','DARK_AQUA','DARK_GREEN','DARK_BLUE','DARK_PURPLE','DARK_VIVID_PINK','DARK_GOLD','DARK_ORANGE','DARK_RED','DARK_GREY','LIGHT_GREY','DARK_NAVY','BLURPLE','GREYPLE','DARK_BUT_NOT_BLACK','NOT_QUITE_BLACK','RANDOM'].includes(value)){
|
||||||
|
return createError("'"+path+"' | invalid color, must be a hex code or default color (more info in the wiki)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} value @param {String} path @param {Number} minLength @param {Number} maxLength @param {String} name */
|
||||||
|
const checkString = (value,minLength,maxLength,path,name) => {
|
||||||
|
if (value.length < minLength){
|
||||||
|
createError("'"+path+"' | "+name+" is too short!")
|
||||||
|
}else if (value.length > maxLength){
|
||||||
|
createError("'"+path+"' | "+name+" is too long!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
|
||||||
|
const checkDiscordArray = (mode,arrayValue,path) => {
|
||||||
|
if (mode == "userid"){
|
||||||
|
arrayValue.forEach((value,index) => {
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+":"+index+"' | this user id is invalid")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else if (mode == "channelid"){
|
||||||
|
arrayValue.forEach((value,index) => {
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+":"+index+"' | this channel id is invalid")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else if (mode == "roleid"){
|
||||||
|
arrayValue.forEach((value,index) => {
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+":"+index+"' | this role id is invalid")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else if (mode == "serverid"){
|
||||||
|
arrayValue.forEach((value,index) => {
|
||||||
|
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
||||||
|
createError("'"+path+":"+index+"' | this server id is invalid")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**@param {String} value @param {"string"|"boolean"|"number"} type */
|
||||||
|
const checkType = (value,type,path) => {
|
||||||
|
if (type == "boolean"){
|
||||||
|
if (typeof value != "boolean"){
|
||||||
|
createError("'"+path+"' | invalid type, this must be a boolean!")
|
||||||
|
}
|
||||||
|
}else if (type == "number"){
|
||||||
|
if (typeof value != "number"){
|
||||||
|
createError("'"+path+"' | invalid type, this must be a number!")
|
||||||
|
}
|
||||||
|
}else if (type == "string"){
|
||||||
|
if (typeof value != "string"){
|
||||||
|
createError("'"+path+"' | invalid type, this must be a string!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkButtonColor = (value,path) => {
|
||||||
|
if (value != "none" && value != "grey" && value != "gray" && value != "black" && value != "red" && value != "green" && value != "blue" && value != "blurple"){
|
||||||
|
createError("'"+path+"' | invalid color, it must be one of these: none, gray, red, green, blue!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const configParser = require("./utils/configParser")
|
||||||
|
/**
|
||||||
|
* @param {configParser.OTAllOptions} option
|
||||||
|
* @param {String} path
|
||||||
|
*/
|
||||||
|
|
||||||
|
const checkOption = (option,path) => {
|
||||||
|
|
||||||
|
//id
|
||||||
|
checkType(option.id,"string",path+"/id")
|
||||||
|
if (option.id.includes(" ")){
|
||||||
|
createError("'"+path+"/id' | option id can't contain space characters!")
|
||||||
|
}
|
||||||
|
if (option.id.length > 20){
|
||||||
|
createError("'"+path+"/id' | option id max lenght is 20!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//name
|
||||||
|
checkType(option.name,"string",path+"/name")
|
||||||
|
if (option.name.length > 100){
|
||||||
|
createWarn("'"+path+"/name' | if your name is too long it maybe doesn't look so good!")
|
||||||
|
}else if (option.name.length < 1){
|
||||||
|
createError("'"+path+"/name' | there is no name!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//description
|
||||||
|
checkType(option.description,"string",path+"/description")
|
||||||
|
|
||||||
|
//icon
|
||||||
|
const emojiRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi;
|
||||||
|
if (option.icon.length > 0){
|
||||||
|
|
||||||
|
const isEmoji = emojiRegex.test(option.icon)
|
||||||
|
|
||||||
|
if (isEmoji == false){
|
||||||
|
createError("'"+path+"/icon' | invalid emoji or custom discord emoji")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkType(option.icon,"string",path+"/icon")
|
||||||
|
|
||||||
|
//label
|
||||||
|
checkType(option.label,"string",path+"/label")
|
||||||
|
if (option.label.length < 1 && option.icon.length < 1){
|
||||||
|
createError("'"+path+"' | you need at least one of these: label, icon!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//type
|
||||||
|
checkType(option.type,"string",path+"/type")
|
||||||
|
if (option.type != "ticket" && option.type != "website" && option.type != "role"){
|
||||||
|
createError("'"+path+"/type' | the type must be one of these: ticket, website, role!")
|
||||||
|
}
|
||||||
|
/**@type {"ticket"|"website"|"role"} */
|
||||||
|
const type = option.type
|
||||||
|
|
||||||
|
if (type == "ticket"){
|
||||||
|
//color
|
||||||
|
checkType(option.color,"string",path+"/color")
|
||||||
|
checkButtonColor(option.color,path+"/color")
|
||||||
|
|
||||||
|
//adminroles
|
||||||
|
checkDiscordArray("roleid",option.adminroles,path+"/adminroles")
|
||||||
|
|
||||||
|
//channelprefix
|
||||||
|
checkType(option.channelprefix,"string",path+"/channelprefix")
|
||||||
|
if (option.channelprefix.includes(" ")){
|
||||||
|
createWarn("'"+path+"/channelprefix' | this prefix can't contain spaces!")
|
||||||
|
}
|
||||||
|
|
||||||
|
//category
|
||||||
|
checkType(option.category,"string",path+"/category")
|
||||||
|
if (option.category.length > 0){
|
||||||
|
checkDiscord("categoryid",option.category,path+"/category")
|
||||||
|
}
|
||||||
|
|
||||||
|
//message
|
||||||
|
checkType(option.message,"string",path+"/message")
|
||||||
|
|
||||||
|
//enableDmOnOpen
|
||||||
|
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
||||||
|
|
||||||
|
//ticketmessage
|
||||||
|
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
||||||
|
|
||||||
|
//thumbnail
|
||||||
|
checkType(option.thumbnail.enable,"boolean",path/"/thumbnail/enable")
|
||||||
|
checkType(option.thumbnail.url,"string",path/"/thumbnail/url")
|
||||||
|
|
||||||
|
//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 if (type == "website"){
|
||||||
|
//url
|
||||||
|
checkType(option.url,"string",path+"/url")
|
||||||
|
if (option.url.includes(" ")){
|
||||||
|
createWarn("'"+path+"/url' | a url can't contain spaces")
|
||||||
|
}
|
||||||
|
if (option.url.length < 1){
|
||||||
|
createError("'"+path+"/url' | there is no url!")
|
||||||
|
}
|
||||||
|
if (!option.url.startsWith("https://") && !option.url.startsWith("http://") && !option.url.startsWith("discord://")){
|
||||||
|
createWarn("'"+path+"/url' | your url doesn't start with https or http!")
|
||||||
|
}
|
||||||
|
if (option.url.startsWith("http://")){
|
||||||
|
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord can block this url!")
|
||||||
|
}
|
||||||
|
}else if (type == "role"){
|
||||||
|
//color
|
||||||
|
checkType(option.color,"string",path+"/color")
|
||||||
|
checkButtonColor(option.color,path+"/color")
|
||||||
|
|
||||||
|
//roles
|
||||||
|
checkDiscordArray("roleid",option.roles,path+"/roles")
|
||||||
|
|
||||||
|
//mode
|
||||||
|
checkType(option.mode,"string",path+"/mode")
|
||||||
|
if (option.mode != "add&remove" && option.mode != "add" && option.mode != "remove"){
|
||||||
|
createError("'"+path+"/mode' | mode must be one of these: add, remove, add&remove")
|
||||||
|
}
|
||||||
|
|
||||||
|
//enableDmOnOpen
|
||||||
|
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {configParser.OTConfigMessage} input
|
||||||
|
* @param {String} 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")
|
||||||
|
}
|
||||||
|
|
||||||
|
//ticket explaination & max tickets warning
|
||||||
|
checkType(input.enableTicketExplaination,"boolean",path+"/enableTicketExplaination")
|
||||||
|
checkType(input.enableMaxTicketsWarning,"boolean",path+"/enableMaxTicketsWarning")
|
||||||
|
|
||||||
|
//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!")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------|
|
||||||
|
//--------------------------|
|
||||||
|
//checker => START HERE |
|
||||||
|
//--------------------------|
|
||||||
|
//--------------------------|
|
||||||
|
|
||||||
|
var configArray = ["main_color","server_id","auth_token","main_adminroles","prefix","languagefile","credits","status","system","options","messages"]
|
||||||
|
configArray.forEach((item) => {
|
||||||
|
if (config[item] == undefined){
|
||||||
|
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
checkHexColor(config.main_color,"main_color")
|
||||||
|
checkDiscord("serverid",config.server_id,"server_id")
|
||||||
|
|
||||||
|
if (!require("./api/api.json").disable.checkerjs.token) checkToken(config.auth_token)
|
||||||
|
|
||||||
|
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
||||||
|
checkString(config.prefix,1,15,"prefix","prefix")
|
||||||
|
//languagefile
|
||||||
|
checkType(config.languagefile,"string","languagefile")
|
||||||
|
const lf = config.languagefile
|
||||||
|
|
||||||
|
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian")){
|
||||||
|
createError("'languagefile' | invalid language, more info in the wiki")
|
||||||
|
}
|
||||||
|
|
||||||
|
checkType(config.credits,"boolean","credits")
|
||||||
|
//status:
|
||||||
|
checkType(config.status.enabled,"boolean","status/enabled")
|
||||||
|
if (config.status.enabled){
|
||||||
|
if (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING"){
|
||||||
|
createError("'status/type' | not a valid status type! (LISTENING,WATCHING,PLAYING)")
|
||||||
|
}
|
||||||
|
if (config.status.text.length < 1){
|
||||||
|
createError("'status/text' | there is no status text!")
|
||||||
|
}
|
||||||
|
if (config.status.text.length > 50) createError("'status/text' | text too long!")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//system:
|
||||||
|
if (config.system.ticket_channel){
|
||||||
|
if (config.system.ticket_channel.length < 16 || config.system.ticket_channel.length > 20 || !/^\d+$/.test(config.system.ticket_channel)){
|
||||||
|
createError("'system/ticket_channel' | this channel id is invalid")
|
||||||
|
}
|
||||||
|
}else createWarn("'"+path+"' | you have no ticket channel selected!")
|
||||||
|
checkType(config.system.max_allowed_tickets,"number","system/max_allowed_tickets")
|
||||||
|
checkType(config.system.enable_DM_Messages,"boolean","system/enable_DM_Messages")
|
||||||
|
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
||||||
|
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||||
|
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
||||||
|
}else{
|
||||||
|
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
||||||
|
}
|
||||||
|
checkType(config.system.closeMode,"string","system/closeMode")
|
||||||
|
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
||||||
|
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
||||||
|
}
|
||||||
|
|
||||||
|
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
||||||
|
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
||||||
|
if (config.system.enable_transcript){
|
||||||
|
checkDiscord("channelid",config.system.transcript_channel,"system/transcript_channel")
|
||||||
|
}
|
||||||
|
checkType(config.system.showSlashcmdsInHelp,"boolean","system/showSlashcmdsInHelp")
|
||||||
|
|
||||||
|
//options
|
||||||
|
|
||||||
|
config.options.forEach((option,index) => {
|
||||||
|
checkOption(option,"options/"+index)
|
||||||
|
})
|
||||||
|
|
||||||
|
//messages
|
||||||
|
config.messages.forEach((message,index) => {
|
||||||
|
checkMessage(message,"messages/"+index)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
//discord check
|
||||||
|
/**
|
||||||
|
const discord = require("discord.js")
|
||||||
|
const {GatewayIntentBits,Partials} = discord
|
||||||
|
const client = new discord.Client({
|
||||||
|
intents:[
|
||||||
|
GatewayIntentBits.DirectMessages,
|
||||||
|
GatewayIntentBits.GuildInvites,
|
||||||
|
GatewayIntentBits.GuildMembers,
|
||||||
|
GatewayIntentBits.GuildMessages,
|
||||||
|
GatewayIntentBits.Guilds,
|
||||||
|
GatewayIntentBits.MessageContent
|
||||||
|
],
|
||||||
|
partials:[Partials.Channel,Partials.Message]
|
||||||
|
})
|
||||||
|
await client.guilds.fetch()
|
||||||
|
if (!client.guilds.cache.find(g => g.id == config.server_id)){
|
||||||
|
createError("'server_id' | i'm not in a server with this id!")
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//the end
|
||||||
|
if (errorList.length > 0 || warnList.length > 0){
|
||||||
|
console.log("REPORT:\n===========================")
|
||||||
|
}
|
||||||
|
warnList.forEach((w) => {
|
||||||
|
const splitw = w.split("'")
|
||||||
|
if (splitw.length > 1){
|
||||||
|
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
|
||||||
|
}else {var splitstring = chalk.yellow(splitw[0])}
|
||||||
|
console.log(splitstring)
|
||||||
|
})
|
||||||
|
errorList.forEach((e) => {
|
||||||
|
const splite = e.split("'")
|
||||||
|
if (splite.length > 1){
|
||||||
|
var splitstring = chalk.red(splite[0])+chalk.blue("'"+splite[1]+"'")+chalk.red(splite[2])
|
||||||
|
}else {var splitstring = chalk.red(splite[0])}
|
||||||
|
console.log(splitstring)
|
||||||
|
})
|
||||||
|
if (isError){
|
||||||
|
console.log("===========================")
|
||||||
|
console.log("=> "+chalk.bgRed("your bot doesn't work if you don't fix the above errors!"))
|
||||||
|
if (isWarn){
|
||||||
|
console.log("\n=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
||||||
|
}
|
||||||
|
process.exit(0)
|
||||||
|
}else if (isWarn == true && isError == false){
|
||||||
|
console.log("===========================")
|
||||||
|
console.log("=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const readline = require("readline")
|
||||||
|
const rl = readline.createInterface({
|
||||||
|
input:process.stdin,
|
||||||
|
output:process.stdout,
|
||||||
|
terminal:true
|
||||||
|
})
|
||||||
|
|
||||||
|
const ask = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
rl.question(chalk.yellow("WARNING: are you sure that there are",chalk.red("no tickets open"),"at the moment? ")+chalk.green("(yes/no)")+"\n",(answer) => {
|
||||||
|
if (answer != "1" && !answer.toLowerCase().startsWith("yes")){
|
||||||
|
console.log(chalk.red("invalid answer"))
|
||||||
|
ask()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(chalk.green("clearing data..."))
|
||||||
|
runClear()
|
||||||
|
rl.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
ask()
|
||||||
|
|
||||||
|
const runClear = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
//console.log(chalk.blue("You can get a node.js warning below, just ignore that, it's not important!"))
|
||||||
|
const dataPaths = ["./storage/dynamicDB"]
|
||||||
|
|
||||||
|
var index = 0
|
||||||
|
|
||||||
|
dataPaths.forEach((path) => {
|
||||||
|
try {
|
||||||
|
fs.rmSync(path,{recursive:true,force:true})
|
||||||
|
}catch{
|
||||||
|
//console.log(path,"doesn't exist")
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
try{
|
||||||
|
fs.mkdirSync(path)
|
||||||
|
}catch{
|
||||||
|
//console.log(path,"already exists")
|
||||||
|
}
|
||||||
|
index++
|
||||||
|
},500)
|
||||||
|
})
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
if (index >= 1){
|
||||||
|
console.log(chalk.bgGreen("All local data is cleared!"))
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
},500)
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
const localstorage = require("node-localstorage")
|
||||||
|
|
||||||
|
const ls = new localstorage.LocalStorage("./storage/dynamicDB")
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} id
|
||||||
|
* @param {String} value
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.set = (category,id,value) => {
|
||||||
|
ls.setItem(category+"--"+id,value.toString())
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} id
|
||||||
|
* @returns {String|false}
|
||||||
|
*/
|
||||||
|
exports.get = (category,id) => {
|
||||||
|
const result = ls.getItem(category+"--"+id)
|
||||||
|
if (!result) return false
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} category
|
||||||
|
* @param {String} id
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.delete = (category,id) => {
|
||||||
|
ls.removeItem(category+"--"+id)
|
||||||
|
return true
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
//Do not change this without knowing what you are doing!!
|
||||||
|
const databaseFile = "local"
|
||||||
|
//Do not change this without knowing what you are doing!!
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
var db = require("./dynamicfiles/local")
|
||||||
|
}catch{
|
||||||
|
console.log("I couldn't find the database file! (location: ./core/dynamicdatabase/storage.js:2)")
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = db
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
const loadChalk = async () => {
|
||||||
|
return await (await import("chalk")).default
|
||||||
|
}
|
||||||
|
const embed = discord.EmbedBuilder
|
||||||
|
const c = discord.Colors
|
||||||
|
|
||||||
|
/**@param {discord.User} user*/
|
||||||
|
exports.noPermsMessage = (user) => {
|
||||||
|
return new embed()
|
||||||
|
.setColor(c.Red)
|
||||||
|
.setTitle(":x: "+l.errors.noPermsTitle)
|
||||||
|
.setDescription(l.errors.noPermsDescription)
|
||||||
|
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {discord.User} user*/
|
||||||
|
exports.noPermsDelete = (user) => {
|
||||||
|
return new embed()
|
||||||
|
.setColor(c.Red)
|
||||||
|
.setTitle(":x: "+l.errors.noPermsTitle)
|
||||||
|
.setDescription(l.errors.noPermsDelete)
|
||||||
|
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message */
|
||||||
|
exports.invalidArgsMessage = (message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(c.Red)
|
||||||
|
.setTitle(":x: "+l.errors.missingArgsTitle)
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message */
|
||||||
|
exports.serverError = (message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(c.Orange)
|
||||||
|
.setTitle(":warning: "+l.errors.boterror)
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String[]} list */
|
||||||
|
exports.invalidIdChooseFromList = (list) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(c.Red)
|
||||||
|
.setTitle(":x: "+l.errors.chooseFromListTitle)
|
||||||
|
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.notInATicket = new embed()
|
||||||
|
.setColor(c.Red)
|
||||||
|
.setTitle(":x: "+l.errors.notInTicketTitle)
|
||||||
|
.setDescription(l.errors.notInTicketDescription)
|
||||||
|
|
||||||
|
|
||||||
|
/**@param {String} message @param {String} title */
|
||||||
|
exports.success = (title,message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle(":white_check_mark: "+title)
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message @param {String} title */
|
||||||
|
exports.warning = (title,message) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(c.Orange)
|
||||||
|
.setTitle(":warning: "+title)
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@param {String} message the message @param {String} title the title @param {String} emoji an discord emoji @param {discord.ColorResolvable} color the embed color*/
|
||||||
|
exports.custom = (title,message,emoji,color) => {
|
||||||
|
var x = new embed()
|
||||||
|
.setColor(color)
|
||||||
|
.setTitle(emoji+" "+title)
|
||||||
|
.setDescription(message)
|
||||||
|
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
|
||||||
|
const normalLog = (debugString) => {
|
||||||
|
const fs = require("fs")
|
||||||
|
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||||
|
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {"system"|"command"|"info"|"api"|"debug"} type
|
||||||
|
* @param {String} message
|
||||||
|
* @param {[{key:String,value:String}]} params
|
||||||
|
*/
|
||||||
|
exports.log = async (type,message,params) => {
|
||||||
|
var ptype = type
|
||||||
|
const chalk = await loadChalk()
|
||||||
|
var paramstring = ""
|
||||||
|
if (params){
|
||||||
|
if (params.length > 0){
|
||||||
|
params.forEach((p) => {
|
||||||
|
paramstring = paramstring+p.key+": "+p.value+" "
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const parameters = params ? "("+paramstring+")" : " "
|
||||||
|
|
||||||
|
if (ptype == "command"){
|
||||||
|
console.log(chalk.green("[command] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}else if (ptype == "info"){
|
||||||
|
console.log(chalk.blue("[info] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}else if (ptype == "system"){
|
||||||
|
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}else if (ptype == "api"){
|
||||||
|
if (require("./api/api.json").enableAPIconsolelogs == true){
|
||||||
|
console.log(chalk.red("[api v"+require("./api/api.json").version+"] ")+message+" "+chalk.yellow(parameters))
|
||||||
|
}
|
||||||
|
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 months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
||||||
|
normalLog("["+cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getSeconds()+":"+cd.getMinutes()+":"+cd.getHours()+"] ["+ptype+"] "+message+" "+parameters)
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
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 hiddendata = bot.hiddenData
|
||||||
|
const embed = discord.EmbedBuilder
|
||||||
|
const mc = config.main_color
|
||||||
|
|
||||||
|
const button = discord.ButtonBuilder
|
||||||
|
const arb = discord.ActionRowBuilder
|
||||||
|
const bs = discord.ButtonStyle
|
||||||
|
|
||||||
|
|
||||||
|
exports.closeCommandRow = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicket1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTsendTranscript")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setLabel(l.buttons.sendTranscript)
|
||||||
|
.setEmoji("📄")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTreopenTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Success)
|
||||||
|
.setLabel(l.buttons.reopen)
|
||||||
|
.setEmoji("✔")
|
||||||
|
)
|
||||||
|
|
||||||
|
exports.openRowNormal = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setLabel(l.buttons.close)
|
||||||
|
.setEmoji("🔒")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
|
||||||
|
exports.openRowDisabled = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicket")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setLabel(l.buttons.close)
|
||||||
|
.setEmoji("🔒")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicket")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle(bs.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
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 hiddendata = bot.hiddenData
|
||||||
|
const embed = discord.EmbedBuilder
|
||||||
|
const mc = config.main_color
|
||||||
|
|
||||||
|
const button = discord.ButtonBuilder
|
||||||
|
const arb = discord.ActionRowBuilder
|
||||||
|
const bs = discord.ButtonStyle
|
||||||
|
|
||||||
|
|
||||||
|
exports.firstmsgRowNormal = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setLabel(l.buttons.close)
|
||||||
|
.setEmoji("🔒")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
|
||||||
|
exports.firstmsgRowDisabled = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicket")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setLabel(l.buttons.close)
|
||||||
|
.setEmoji("🔒")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicket")
|
||||||
|
.setDisabled(true)
|
||||||
|
.setStyle(bs.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
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 hiddendata = bot.hiddenData
|
||||||
|
const embed = discord.EmbedBuilder
|
||||||
|
const mc = config.main_color
|
||||||
|
|
||||||
|
const button = discord.ButtonBuilder
|
||||||
|
const arb = discord.ActionRowBuilder
|
||||||
|
const bs = discord.ButtonStyle
|
||||||
|
|
||||||
|
exports.closeVerifyBar = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicketReason")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Primary)
|
||||||
|
.setEmoji("💬")
|
||||||
|
.setLabel(l.buttons.closeWithReason)
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicketTrue")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setEmoji("✅")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTcloseTicketFalse")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setEmoji("❌")
|
||||||
|
)
|
||||||
|
|
||||||
|
exports.deleteVerifyBar = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicketTrue")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setEmoji("✅")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicketFalse")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setEmoji("❌")
|
||||||
|
)
|
||||||
|
|
||||||
|
exports.delete1VerifyBar = new arb()
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicketTrue1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setEmoji("✅")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new button()
|
||||||
|
.setCustomId("OTdeleteTicketFalse1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(bs.Secondary)
|
||||||
|
.setEmoji("❌")
|
||||||
|
)
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
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 hiddendata = bot.hiddenData
|
||||||
|
const embed = discord.EmbedBuilder
|
||||||
|
const mc = config.main_color
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} addedUser
|
||||||
|
* @param {discord.User} adder
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.addEmbed = (addedUser,adder) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("⬆️ "+l.commands.userAddedTitle.replace("{0}",addedUser.username))
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:adder.tag,iconURL:adder.displayAvatarURL()})
|
||||||
|
.setThumbnail(addedUser.displayAvatarURL({extension:"png"}))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} removedUser
|
||||||
|
* @param {discord.User} remover
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.removeEmbed = (removedUser,remover) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("⬇️ "+l.commands.userRemovedTitle.replace("{0}",removedUser.username))
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:remover.tag,iconURL:remover.displayAvatarURL()})
|
||||||
|
.setThumbnail(removedUser.displayAvatarURL({extension:"png"}))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} closer
|
||||||
|
* @param {String} description
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.closeEmbed = (closer,description) => {
|
||||||
|
const embd = new embed()
|
||||||
|
.setTitle("🔒 "+l.commands.closeTitle)
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:closer.tag,iconURL:closer.displayAvatarURL()})
|
||||||
|
|
||||||
|
if (description) embd.setDescription(description)
|
||||||
|
return embd
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} deleter
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.deleteEmbed = (deleter) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("❌ "+l.commands.deleteTitle)
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:deleter.tag,iconURL:deleter.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} renamer
|
||||||
|
* @param {String} newname
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.renameEmbed = (renamer,newname) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("🔄 "+l.commands.renameTitle.replace("{0}",newname))
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:renamer.tag,iconURL:renamer.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} reopener
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.reopenEmbed = (reopener) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("🔓 "+l.commands.reopenTitle)
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:reopener.tag,iconURL:reopener.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} claimer
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.claimEmbed = (claimer,user) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("📌 "+l.commands.claimTitle.replace("{0}",claimer.username))
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:user.tag,iconURL:user.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} unclaimer
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.unclaimEmbed = (unclaimer) => {
|
||||||
|
return new embed()
|
||||||
|
.setTitle("🆓 "+l.commands.unclaimTitle)
|
||||||
|
.setColor(mc)
|
||||||
|
.setFooter({text:unclaimer.tag,iconURL:unclaimer.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {Boolean} done
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} author
|
||||||
|
* @returns {discord.EmbedBuilder}
|
||||||
|
*/
|
||||||
|
exports.sendTranscriptEmbed = (done,channel,author) => {
|
||||||
|
if (done){
|
||||||
|
return new embed()
|
||||||
|
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
||||||
|
.setColor(mc)
|
||||||
|
.setDescription("Ticket: "+channel.name)
|
||||||
|
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
||||||
|
}else{
|
||||||
|
return new embed()
|
||||||
|
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
||||||
|
.setColor(mc)
|
||||||
|
.setDescription("Loading...")
|
||||||
|
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
//CLOSE
|
||||||
|
var closeTicketButtonChecker = false
|
||||||
|
client.on("interactionCreate",async interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTcloseTicketTrue") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
if (closeTicketButtonChecker == true) return
|
||||||
|
closeTicketButtonChecker = true
|
||||||
|
|
||||||
|
const firstcomponents = interaction.message.components
|
||||||
|
|
||||||
|
if (config.system.closeMode == "adminonly"){
|
||||||
|
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
||||||
|
permissionChecker.sendChannelNoPerms(interaction.channel,interaction.user)
|
||||||
|
}
|
||||||
|
interaction.message.edit({components:[firstcomponents]})
|
||||||
|
closeTicketButtonChecker = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
const name = interaction.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
||||||
|
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
||||||
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
//DELETE
|
||||||
|
var deleteTicketButtonChecker = false
|
||||||
|
client.on("interactionCreate",async interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTdeleteTicketTrue") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
if (deleteTicketButtonChecker == true) return
|
||||||
|
deleteTicketButtonChecker = true
|
||||||
|
|
||||||
|
const firstcomponents = bot.buttons.close.openRowNormal
|
||||||
|
|
||||||
|
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
||||||
|
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
||||||
|
}
|
||||||
|
await interaction.message.edit({components:[firstcomponents]})
|
||||||
|
deleteTicketButtonChecker = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
const name = interaction.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||||
|
await interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
||||||
|
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
||||||
|
deleteTicketButtonChecker = false
|
||||||
|
})
|
||||||
|
|
||||||
|
//DELETE NO TRANSCRIPT
|
||||||
|
var deleteTicketButtonChecker1 = false
|
||||||
|
client.on("interactionCreate",async interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTdeleteTicketTrue1") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
if (deleteTicketButtonChecker1 == true) return
|
||||||
|
deleteTicketButtonChecker1 = true
|
||||||
|
|
||||||
|
const firstcomponents = bot.buttons.close.closeCommandRow
|
||||||
|
|
||||||
|
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
|
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
||||||
|
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
||||||
|
}
|
||||||
|
await interaction.message.edit({components:[firstcomponents]})
|
||||||
|
deleteTicketButtonChecker1 = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
const name = interaction.channel.name
|
||||||
|
var prefix = ""
|
||||||
|
const tickets = config.options
|
||||||
|
tickets.forEach((ticket) => {
|
||||||
|
if (name.startsWith(ticket.channelprefix)){
|
||||||
|
prefix = ticket.channelprefix
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
||||||
|
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"deletenotranscript",false,true)
|
||||||
|
deleteTicketButtonChecker1 = false
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
//REOPEN
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTreopenTicket") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
||||||
|
require("../../../ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
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 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 = () => {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
module.exports = () => {
|
||||||
|
require("./firstmsg")()
|
||||||
|
require("./sendTranscript")()
|
||||||
|
require("./verifyBars")()
|
||||||
|
|
||||||
|
//accepted
|
||||||
|
require("./accepted/closing")()
|
||||||
|
require("./accepted/reopening")()
|
||||||
|
require("./accepted/deleting")()
|
||||||
|
require("./accepted/closingReason")()
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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 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{}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
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 storage = bot.storage
|
||||||
|
const hiddendata = bot.hiddenData
|
||||||
|
const embed = discord.EmbedBuilder
|
||||||
|
const mc = config.main_color
|
||||||
|
|
||||||
|
const button = discord.ButtonBuilder
|
||||||
|
const arb = discord.ActionRowBuilder
|
||||||
|
const bs = discord.ButtonStyle
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
//CLOSE
|
||||||
|
client.on("interactionCreate",interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTcloseTicket") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
||||||
|
|
||||||
|
})
|
||||||
|
client.on("interactionCreate",interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTcloseTicketFalse") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
||||||
|
})
|
||||||
|
|
||||||
|
//DELETE
|
||||||
|
client.on("interactionCreate",interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTdeleteTicket") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
||||||
|
|
||||||
|
})
|
||||||
|
client.on("interactionCreate",interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTdeleteTicketFalse") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
||||||
|
})
|
||||||
|
|
||||||
|
//DELETE NO TRANSCRIPT
|
||||||
|
client.on("interactionCreate",interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTdeleteTicket1") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
||||||
|
|
||||||
|
})
|
||||||
|
client.on("interactionCreate",interaction => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (interaction.customId != "OTdeleteTicketFalse1") return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
const index = require("../index")
|
||||||
|
|
||||||
|
if (index.developerConfig){
|
||||||
|
var config = require("../devConfig.json")
|
||||||
|
}else{var config = require("../config.json")}
|
||||||
|
|
||||||
|
|
||||||
|
var localLanguage = require("../language/english.json")
|
||||||
|
if (config.languagefile.startsWith("custom")) localLanguage = require("../language/custom.json")
|
||||||
|
else if (config.languagefile.startsWith("dutch")) localLanguage = require("../language/dutch.json")
|
||||||
|
else if (config.languagefile.startsWith("english")) localLanguage = require("../language/english.json")
|
||||||
|
else if (config.languagefile.startsWith("german")) localLanguage = require("../language/german.json")
|
||||||
|
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
||||||
|
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
||||||
|
else if (config.languagefile.startsWith("arabic")) localLanguage = require("../language/arabic.json")
|
||||||
|
else if (config.languagefile.startsWith("spanish")) localLanguage = require("../language/spanish.json")
|
||||||
|
else if (config.languagefile.startsWith("portuguese")) localLanguage = require("../language/portuguese.json")
|
||||||
|
else if (config.languagefile.startsWith("italian")) localLanguage = require("../language/italian.json")
|
||||||
|
|
||||||
|
|
||||||
|
const errorLog = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
console.log(chalk.red("Something went wrong when loading the language!")+"\nCheck the config file or create a ticket in our server!")
|
||||||
|
}
|
||||||
|
|
||||||
|
const successLog = async (language) => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
console.log(chalk.green("loaded language "+language+"..."))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!localLanguage){
|
||||||
|
const runError = async () => {
|
||||||
|
await errorLog()
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
runError()
|
||||||
|
}else{
|
||||||
|
exports.language = localLanguage
|
||||||
|
successLog(config.languagefile)
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
const storage = bot.storage
|
||||||
|
|
||||||
|
const APIEvents = require("./api/modules/events")
|
||||||
|
|
||||||
|
module.exports = async () => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isButton()) return
|
||||||
|
if (!interaction.customId.startsWith("newR")) return
|
||||||
|
|
||||||
|
interaction.deferUpdate()
|
||||||
|
|
||||||
|
if (interaction.customId.startsWith("newR")){
|
||||||
|
const optionid = interaction.customId.split("newR")[1]
|
||||||
|
if (!optionid){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.roleDoesntExist)]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
const option = require("./utils/getButton").getOption(optionid)
|
||||||
|
/**@type {"add"|"remove"|"add&remove"} */
|
||||||
|
const mode = option.mode
|
||||||
|
const user = interaction.member
|
||||||
|
|
||||||
|
if (mode == "add"){
|
||||||
|
option.roles.forEach((role) => {
|
||||||
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||||
|
|
||||||
|
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
|
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||||
|
APIEvents.onReactionRole("add","add",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
}else if (mode == "remove"){
|
||||||
|
option.roles.forEach((role) => {
|
||||||
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
||||||
|
|
||||||
|
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
|
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||||
|
APIEvents.onReactionRole("remove","remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
}else if (mode == "add&remove"){
|
||||||
|
option.roles.forEach((role) => {
|
||||||
|
if (interaction.guild.members.cache.find(u => u.id == user.id).roles.cache.has(role)){
|
||||||
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
||||||
|
|
||||||
|
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
|
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||||
|
APIEvents.onReactionRole("add","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
}else {
|
||||||
|
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
||||||
|
|
||||||
|
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
||||||
|
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
||||||
|
APIEvents.onReactionRole("remove","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch{
|
||||||
|
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrong)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
const discord = require("discord.js")
|
||||||
|
const bot = require("../../index")
|
||||||
|
const client = require("../../index").client
|
||||||
|
const config = bot.config
|
||||||
|
|
||||||
|
module.exports = async () => {
|
||||||
|
const chalk = (await import("chalk")).default
|
||||||
|
|
||||||
|
console.log(chalk.red("\nINSTRUCTIONS:\n\n1: Run the command you want to delete in discord.\n2: You get the message 'This command is now deleted!'\n3: There is also a message in the console that says the command is deleted.\n4: reload your discord."))
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isChatInputCommand()) return console.log("this isn't a command!")
|
||||||
|
|
||||||
|
interaction.reply({content:"This command is now deleted!"})
|
||||||
|
|
||||||
|
try {
|
||||||
|
client.application.commands.delete(interaction.commandId,interaction.guild.id).then(() => {
|
||||||
|
console.log("deleted the command",chalk.blue(interaction.commandName),"(id:",interaction.commandId+")")
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
console.log(chalk.red("something went wrong by the deleting of this command!"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
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 chalk = (await import("chalk")).default
|
||||||
|
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})
|
||||||
|
})
|
||||||
|
|
||||||
|
var readystats = 0
|
||||||
|
|
||||||
|
//process.stdout.write("[status] there are "+chalk.blue("0 out of 10")+" commands ready! (this can take up to 40 seconds)")
|
||||||
|
setInterval(() => {
|
||||||
|
process.stdout.cursorTo(0)
|
||||||
|
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 12")+" commands ready! (this can take up to 40 seconds)")
|
||||||
|
if (readystats >= 12){
|
||||||
|
console.log(chalk.green("\nready!"))
|
||||||
|
console.log(chalk.blue("you can now start the bot with "+chalk.bgBlue("'npm start'")+"!"))
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
},100)
|
||||||
|
|
||||||
|
//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).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
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).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//help
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"help",
|
||||||
|
description:"View the available commands.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.help,
|
||||||
|
type:act.ChatInput
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
//close
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"close",
|
||||||
|
description:"Close the current ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
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(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//delete
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"delete",
|
||||||
|
description:"Delete the current ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.delete,
|
||||||
|
type:act.ChatInput
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//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).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//add
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"add",
|
||||||
|
description:"Add people to this ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.add,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.User,
|
||||||
|
name:"user",
|
||||||
|
description:"The user to add.",
|
||||||
|
required:true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//remove
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"remove",
|
||||||
|
description:"Remove people from this ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.remove,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.User,
|
||||||
|
name:"user",
|
||||||
|
description:"The user to remove.",
|
||||||
|
required:true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//rename
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"rename",
|
||||||
|
description:"Rename this ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.rename,
|
||||||
|
type:act.ChatInput,
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
type:acot.String,
|
||||||
|
name:"name",
|
||||||
|
description:"The new name (without prefix).",
|
||||||
|
required:true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},sid).then(() => {
|
||||||
|
readystats++
|
||||||
|
})
|
||||||
|
|
||||||
|
//reopen
|
||||||
|
client.application.commands.create({
|
||||||
|
name:"reopen",
|
||||||
|
description:"Reopen this ticket.",
|
||||||
|
defaultPermission:true,
|
||||||
|
descriptionLocalizations:ST.reopen,
|
||||||
|
type:act.ChatInput
|
||||||
|
},sid).then(() => {
|
||||||
|
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++
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
Executable
+345
@@ -0,0 +1,345 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
const storage = bot.storage
|
||||||
|
const permsChecker = require("../utils/permisssionChecker")
|
||||||
|
|
||||||
|
const pendingDelete = []
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.GuildMember} member
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {String} prefix
|
||||||
|
* @param {"delete"|"close"|"deletenotranscript"} mode
|
||||||
|
* @param {Boolean} nomessage
|
||||||
|
* @param {String} reason only when closing, not when deleting!
|
||||||
|
*/
|
||||||
|
exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) => {
|
||||||
|
const guild = channel.guild
|
||||||
|
const user = member.user
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
const channelmessages = await channel.messages.fetch()
|
||||||
|
|
||||||
|
const newReason = reason ? reason : l.messages.none
|
||||||
|
|
||||||
|
//start code
|
||||||
|
|
||||||
|
//FIX CHANNEL COULD BE CLOSED AFTER DELETE:
|
||||||
|
if (pendingDelete.includes(channel.id)) return false
|
||||||
|
|
||||||
|
//remove ot bot from transcript
|
||||||
|
channelmessages.sweep((msgSweep) => {return msgSweep.author.id == client.user.id})
|
||||||
|
|
||||||
|
/**@type {String}*/
|
||||||
|
const channelname = channel.name
|
||||||
|
const ticketOpenerChannelName = channelname.split(prefix)[1]
|
||||||
|
|
||||||
|
//get user that opened the ticket
|
||||||
|
var getuserID = storage.get("userTicketStorage",channel.id)
|
||||||
|
try {
|
||||||
|
var ticketOpener = client.users.cache.find(u => u.id === getuserID)
|
||||||
|
var isDatabaseError = false
|
||||||
|
}catch{var isDatabaseError = true}
|
||||||
|
|
||||||
|
if (!ticketOpener){
|
||||||
|
console.log(chalk.red("[database error]"),"something went wrong when getting the data in the database.\nNo panic, this error fixes itself!")
|
||||||
|
var isDatabaseError = true
|
||||||
|
}
|
||||||
|
|
||||||
|
var enableTranscript = true
|
||||||
|
var deleteRequired = false
|
||||||
|
|
||||||
|
if (mode == "delete"){
|
||||||
|
//delete
|
||||||
|
//check perms
|
||||||
|
if (!guild) return
|
||||||
|
if (!permsChecker.command(user.id,guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//start delete proccess
|
||||||
|
deleteRequired = true
|
||||||
|
if (!nomessage){
|
||||||
|
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||||
|
}
|
||||||
|
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||||
|
pendingDelete.push(channel.id)
|
||||||
|
|
||||||
|
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||||
|
|
||||||
|
//getID & send DM & send api event
|
||||||
|
await channel.messages.fetchPinned().then(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").value.value
|
||||||
|
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})
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
|
|
||||||
|
}else if (mode == "close"){
|
||||||
|
//close
|
||||||
|
//check perms
|
||||||
|
if (config.system.closeMode == "adminonly"){
|
||||||
|
if (!guild) return
|
||||||
|
if (!permsChecker.command(user.id,guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//set new permissions
|
||||||
|
var permissionArray = []
|
||||||
|
const pfb = discord.PermissionFlagsBits
|
||||||
|
|
||||||
|
if (!isDatabaseError) permissionArray.push({
|
||||||
|
id:ticketOpener,
|
||||||
|
type:"member",
|
||||||
|
allow:[pfb.ViewChannel],
|
||||||
|
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
||||||
|
})
|
||||||
|
|
||||||
|
permissionArray.push({
|
||||||
|
id:guild.roles.everyone,
|
||||||
|
type:"role",
|
||||||
|
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
|
||||||
|
//add main adminroles
|
||||||
|
config.main_adminroles.forEach((role,index) => {
|
||||||
|
try {
|
||||||
|
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||||
|
if (!adminrole) return
|
||||||
|
|
||||||
|
permissionArray.push({
|
||||||
|
id:adminrole,
|
||||||
|
type:"role",
|
||||||
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//add ticket adminroles
|
||||||
|
await channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||||
|
|
||||||
|
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[]}
|
||||||
|
*/
|
||||||
|
const ticketadmin = ticketData.adminroles
|
||||||
|
ticketadmin.forEach((role,index) => {
|
||||||
|
if (!config.main_adminroles.includes(role)){
|
||||||
|
try {
|
||||||
|
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||||
|
if (!adminrole) return
|
||||||
|
|
||||||
|
permissionArray.push({
|
||||||
|
id:adminrole,
|
||||||
|
type:"role",
|
||||||
|
allow:[pfb.AddReactions,pfb.ViewChannel],
|
||||||
|
deny:[pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
channel.permissionOverwrites.set(permissionArray)
|
||||||
|
|
||||||
|
if (!nomessage){
|
||||||
|
//message
|
||||||
|
var closeButtonRow = new discord.ActionRowBuilder()
|
||||||
|
.addComponents(
|
||||||
|
new discord.ButtonBuilder()
|
||||||
|
.setCustomId("OTdeleteTicket1")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(discord.ButtonStyle.Danger)
|
||||||
|
.setLabel(l.buttons.delete)
|
||||||
|
.setEmoji("✖️")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.ButtonBuilder()
|
||||||
|
.setCustomId("OTsendTranscript")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(discord.ButtonStyle.Secondary)
|
||||||
|
.setLabel(l.buttons.sendTranscript)
|
||||||
|
.setEmoji("📄")
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new discord.ButtonBuilder()
|
||||||
|
.setCustomId("OTreopenTicket")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(discord.ButtonStyle.Success)
|
||||||
|
.setLabel(l.buttons.reopen)
|
||||||
|
.setEmoji("✔")
|
||||||
|
)
|
||||||
|
|
||||||
|
const embed = new discord.EmbedBuilder()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
||||||
|
.setDescription(l.messages.closedDescription)
|
||||||
|
channel.send({embeds:[embed],components:[closeButtonRow]})
|
||||||
|
}
|
||||||
|
|
||||||
|
log("system","closed a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||||
|
|
||||||
|
|
||||||
|
//getID & send DM & send api event
|
||||||
|
await channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||||
|
|
||||||
|
require("../api/modules/events").onTicketClose(user,channel,guild,new Date(),{name:channel.name,status:"closed",ticketOptions:ticketData},newReason)
|
||||||
|
|
||||||
|
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||||
|
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
member.send({embeds:[bot.errorLog.custom(l.messages.closedTicketDmTitle,l.messages.closedTicketDmDescription+"\n\n**reason:** "+newReason,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}else if (mode == "deletenotranscript"){
|
||||||
|
//delete with no transcript
|
||||||
|
//check perms
|
||||||
|
if (!guild) return
|
||||||
|
if (!permsChecker.command(user.id,guild.id)){
|
||||||
|
permsChecker.sendUserNoPerms(user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//start delete proccess
|
||||||
|
enableTranscript = false
|
||||||
|
deleteRequired = true
|
||||||
|
if (!nomessage){
|
||||||
|
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
||||||
|
}
|
||||||
|
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
||||||
|
|
||||||
|
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
||||||
|
|
||||||
|
//getID & send DM & send api event
|
||||||
|
await channel.messages.fetchPinned().then(msglist => {
|
||||||
|
var firstmsg = msglist.last()
|
||||||
|
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
||||||
|
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
||||||
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
||||||
|
|
||||||
|
require("../api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
||||||
|
|
||||||
|
const id = hiddendata.data.find(d => d.key == "openerid").value
|
||||||
|
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (enableTranscript == true && mode != "deletenotranscript"){
|
||||||
|
|
||||||
|
const transcriptReason = (mode == "close") ? "**"+l.messages.reason+":** "+newReason : "**"+l.messages.reason+":** "+l.messages.none
|
||||||
|
const closedByPrefix = (mode.startsWith("delete")) ? l.messages.deletedby : l.messages.closedby
|
||||||
|
|
||||||
|
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
||||||
|
var fileattachment = await require("../transcript").createTranscript(channelmessages,channel)
|
||||||
|
|
||||||
|
if (fileattachment == false){log("system","internal error: transcript is not created!");return}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.system.enable_transcript && !require("../api/api.json").disable.transcripts.server){
|
||||||
|
const transcriptEmbed = new discord.EmbedBuilder()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
||||||
|
.setDescription(transcriptReason)
|
||||||
|
.setFooter({text:closedByPrefix+": "+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 && !require("../api/api.json").disable.transcripts.dm){
|
||||||
|
const transcriptEmbed = new discord.EmbedBuilder()
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
||||||
|
.setDescription(transcriptReason)
|
||||||
|
.setFooter({text:closedByPrefix+": "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
||||||
|
|
||||||
|
if (!isDatabaseError) ticketOpener.send({
|
||||||
|
embeds:[transcriptEmbed],
|
||||||
|
files:[fileattachment]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (deleteRequired){
|
||||||
|
//const timer = () => {return new Promise((resolve,reject) => {
|
||||||
|
// setTimeout(() => {resolve(true)},7000)
|
||||||
|
//})}
|
||||||
|
//await timer()
|
||||||
|
|
||||||
|
setTimeout(async () => {
|
||||||
|
pendingDelete.shift()
|
||||||
|
await channel.delete()
|
||||||
|
},6000)
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+214
@@ -0,0 +1,214 @@
|
|||||||
|
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 configParser = require("../utils/configParser")
|
||||||
|
const storage = bot.storage
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
//dropdown placeholder
|
||||||
|
client.on("interactionCreate",(interaction) => {
|
||||||
|
if (!interaction.isSelectMenu()) return
|
||||||
|
if (interaction.customId != "OTdropdownMenu") return
|
||||||
|
if (interaction.values.includes("OTChooseTicket")) interaction.deferUpdate()
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
var closeButton = bot.buttons.firstmsg.firstmsgRowNormal
|
||||||
|
|
||||||
|
//ticket button click / create ticket
|
||||||
|
client.on("interactionCreate",async (interaction) => {
|
||||||
|
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
||||||
|
var customId = "OTnewT"+interaction.options.getString("type")
|
||||||
|
}else if (interaction.isButton()){
|
||||||
|
var customId = interaction.customId
|
||||||
|
}else if (interaction.isSelectMenu() && (interaction.customId == "OTdropdownMenu")){
|
||||||
|
var customId = interaction.values[0]
|
||||||
|
|
||||||
|
}else return
|
||||||
|
|
||||||
|
if (interaction.isButton()){
|
||||||
|
if (interaction.customId.startsWith("OTnewT")){
|
||||||
|
const optionid = interaction.customId.split("OTnewT")[1]
|
||||||
|
if (!optionid){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (configParser.getTicketValuesArray("id").includes(customId)){
|
||||||
|
|
||||||
|
//ticketoptions from config
|
||||||
|
const currentTicketOptions = configParser.getTicketById(customId)
|
||||||
|
|
||||||
|
if (currentTicketOptions == false) return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
||||||
|
|
||||||
|
if (interaction.isButton()){
|
||||||
|
interaction.deferUpdate()
|
||||||
|
}else if (interaction.isChatInputCommand()){
|
||||||
|
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
||||||
|
}else if (interaction.isSelectMenu()){
|
||||||
|
await interaction.deferUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (storage.get("ticketStorage",interaction.member.id) == null || storage.get("ticketStorage",interaction.member.id) == "false"|| Number(storage.get("ticketStorage",interaction.member.id)) < config.system.max_allowed_tickets){
|
||||||
|
|
||||||
|
try{
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
|
||||||
|
|
||||||
|
//update storage
|
||||||
|
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
||||||
|
var ticketNumber = interaction.member.user.username
|
||||||
|
|
||||||
|
//set ticketName
|
||||||
|
var ticketName = currentTicketOptions.channelprefix+ticketNumber
|
||||||
|
var logsname = currentTicketOptions.name
|
||||||
|
|
||||||
|
//category
|
||||||
|
if (currentTicketOptions.category.length < 16 || currentTicketOptions.category.length > 20){
|
||||||
|
var newTicketCategory = null
|
||||||
|
}else{
|
||||||
|
var newTicketCategory = currentTicketOptions.category
|
||||||
|
}
|
||||||
|
|
||||||
|
var permissionsArray = []
|
||||||
|
const pfb = discord.PermissionFlagsBits
|
||||||
|
const guild = client.guilds.cache.find(g => g.id == interaction.guild.id)
|
||||||
|
|
||||||
|
//set everyone allowed
|
||||||
|
if (config.system['has@everyoneaccess']){
|
||||||
|
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
var everyoneDenyPerms = []
|
||||||
|
}else{
|
||||||
|
var everyoneAllowPerms = []
|
||||||
|
var everyoneDenyPerms = [pfb.ViewChannel]
|
||||||
|
}
|
||||||
|
permissionsArray.push({
|
||||||
|
id:interaction.guild.roles.everyone,
|
||||||
|
type:"role",
|
||||||
|
allow:everyoneAllowPerms,
|
||||||
|
deny:everyoneDenyPerms
|
||||||
|
})
|
||||||
|
|
||||||
|
//add the user that created the ticket
|
||||||
|
permissionsArray.push({
|
||||||
|
id:interaction.member.user,
|
||||||
|
type:"member",
|
||||||
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
|
||||||
|
//add main adminroles
|
||||||
|
config.main_adminroles.forEach((role,index) => {
|
||||||
|
try {
|
||||||
|
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||||
|
if (!adminrole) return
|
||||||
|
|
||||||
|
permissionsArray.push({
|
||||||
|
id:adminrole,
|
||||||
|
type:"role",
|
||||||
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//add ticket adminroles
|
||||||
|
/**
|
||||||
|
* @type {String[]}
|
||||||
|
*/
|
||||||
|
const ticketadmin = currentTicketOptions.adminroles
|
||||||
|
ticketadmin.forEach((role,index) => {
|
||||||
|
if (!config.main_adminroles.includes(role)){
|
||||||
|
try {
|
||||||
|
const adminrole = guild.roles.cache.find(r => r.id == role)
|
||||||
|
if (!adminrole) return
|
||||||
|
|
||||||
|
permissionsArray.push({
|
||||||
|
id:adminrole,
|
||||||
|
type:"role",
|
||||||
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//add member role
|
||||||
|
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
||||||
|
try {
|
||||||
|
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
||||||
|
if (!userrole) return
|
||||||
|
permissionsArray.push({
|
||||||
|
id:userrole,
|
||||||
|
type:"role",
|
||||||
|
deny:[pfb.ViewChannel]
|
||||||
|
})
|
||||||
|
}catch{
|
||||||
|
log("system","invalid role! At 'config.json => system/member_role")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//create the channel
|
||||||
|
interaction.guild.channels.create({
|
||||||
|
name:ticketName,
|
||||||
|
type:discord.ChannelType.GuildText,
|
||||||
|
parent:newTicketCategory,
|
||||||
|
reason:"A new ticket is created",
|
||||||
|
permissionOverwrites:permissionsArray
|
||||||
|
|
||||||
|
}).then((ticketChannel) => {
|
||||||
|
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
||||||
|
|
||||||
|
const hiddendata = bot.hiddenData.writeHiddenData("ticketdata",[{key:"type",value:currentTicketOptions.id},{key:"openerid",value:interaction.user.id},{key:"createdms",value:new Date().getTime()}])
|
||||||
|
|
||||||
|
var ticketEmbed = new discord.EmbedBuilder()
|
||||||
|
//.setAuthor({name:interaction.user.id})
|
||||||
|
.setColor(config.main_color)
|
||||||
|
.setTitle(currentTicketOptions.name)
|
||||||
|
//.setFooter({text:"Ticket Type: "+currentTicketOptions.id})
|
||||||
|
if (currentTicketOptions.ticketmessage.length > 0){
|
||||||
|
ticketEmbed.setDescription(currentTicketOptions.ticketmessage+hiddendata)
|
||||||
|
}else{
|
||||||
|
ticketEmbed.setDescription(hiddendata)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentTicketOptions.thumbnail.enable) ticketEmbed.setThumbnail(currentTicketOptions.thumbnail.url)
|
||||||
|
|
||||||
|
ticketChannel.send({
|
||||||
|
content:"<@"+interaction.member.id+"> @here",
|
||||||
|
embeds:[ticketEmbed],
|
||||||
|
components:[closeButton]
|
||||||
|
|
||||||
|
}).then(firstmsg => {
|
||||||
|
firstmsg.pin()
|
||||||
|
})
|
||||||
|
|
||||||
|
log("system","created new ticket",[{key:"ticket",value:ticketName},{key:"user",value:interaction.user.tag}])
|
||||||
|
require("../api/modules/events").onTicketOpen(interaction.user,ticketChannel,interaction.guild,new Date(),{name:ticketName,status:"open",ticketOptions:currentTicketOptions})
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
try {
|
||||||
|
if (config.system.enable_DM_Messages){
|
||||||
|
interaction.member.send({embeds:[bot.errorLog.warning(l.errors.maxAmountTitle,l.errors.maxAmountDescription)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
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
|
||||||
Executable
+75
@@ -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
|
||||||
|
|
||||||
|
/** @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.getHours()+":"+cd.getMinutes()+":"+cd.getSeconds()
|
||||||
|
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,187 @@
|
|||||||
|
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}, 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[], enableTicketExplaination: boolean, enableMaxTicketsWarning: boolean}} OTConfigMessage*/
|
||||||
|
|
||||||
|
//StringOptions
|
||||||
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDmOnOpen"|"ticketmessage"|"thumbnail"|"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 = {}
|
||||||
|
|
||||||
|
|
||||||
|
//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}, url:String, closedCategory:{enable:Boolean,id:String}}} OTAllOptions */
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.optionExists = (id) => {
|
||||||
|
var result = false
|
||||||
|
config.options.forEach((option) => {
|
||||||
|
if (option.id == id){
|
||||||
|
result = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
const discord = require("discord.js")
|
||||||
|
const bot = require("../../index")
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||||
|
const getColor = (color) => {
|
||||||
|
const b = discord.ButtonStyle
|
||||||
|
if (color.toLowerCase() == "red"){
|
||||||
|
return b.Danger
|
||||||
|
}else if (color.toLowerCase() == "green"){
|
||||||
|
return b.Success
|
||||||
|
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
||||||
|
return b.Primary
|
||||||
|
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
||||||
|
return b.Secondary
|
||||||
|
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
||||||
|
return color
|
||||||
|
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
||||||
|
return b.Secondary
|
||||||
|
}else return b.Secondary
|
||||||
|
}
|
||||||
|
|
||||||
|
const getOption = (id) => {
|
||||||
|
const result = config.options.find((option) => option.id == id)
|
||||||
|
if (!result){return false}else return result
|
||||||
|
}
|
||||||
|
exports.getOption = getOption
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id
|
||||||
|
* @returns {discord.ButtonBuilder|false}
|
||||||
|
*/
|
||||||
|
exports.getButton = (id) => {
|
||||||
|
const option = getOption(id)
|
||||||
|
if (!option) return false
|
||||||
|
if (option.type == "ticket"){
|
||||||
|
var button = new discord.ButtonBuilder()
|
||||||
|
.setCustomId("OTnewT"+option.id)
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(getColor(option.color))
|
||||||
|
|
||||||
|
if (option.label){button.setLabel(option.label)}
|
||||||
|
if (option.icon){button.setEmoji(option.icon)}
|
||||||
|
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||||
|
|
||||||
|
}else if (option.type == "website"){
|
||||||
|
var button = new discord.ButtonBuilder()
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(discord.ButtonStyle.Link)
|
||||||
|
.setURL(option.url)
|
||||||
|
|
||||||
|
if (option.label){button.setLabel(option.label)}
|
||||||
|
if (option.icon){button.setEmoji(option.icon)}
|
||||||
|
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||||
|
|
||||||
|
}else if (option.type == "role"){
|
||||||
|
var button = new discord.ButtonBuilder()
|
||||||
|
.setCustomId("newR"+option.id)
|
||||||
|
.setDisabled(false)
|
||||||
|
.setStyle(getColor(option.color))
|
||||||
|
|
||||||
|
if (option.label){button.setLabel(option.label)}
|
||||||
|
if (option.icon){button.setEmoji(option.icon)}
|
||||||
|
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return button
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
exports.rawButtonData = class {
|
||||||
|
constructor() {
|
||||||
|
this.id = ""
|
||||||
|
this.name = ""
|
||||||
|
this.description = ""
|
||||||
|
this.icon = ""
|
||||||
|
this.label = ""
|
||||||
|
this.type = ""
|
||||||
|
|
||||||
|
this.color = ""
|
||||||
|
this.enableDmOnOpen = true
|
||||||
|
this.url = ""
|
||||||
|
this.roles = ["",""]
|
||||||
|
this.mode = ""
|
||||||
|
this.adminroles = ["",""]
|
||||||
|
this.channelprefix = ""
|
||||||
|
this.category = ""
|
||||||
|
this.message = ""
|
||||||
|
this.ticketmessage = ""
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
const discord = require("discord.js")
|
||||||
|
const bot = require("../../index")
|
||||||
|
const config = bot.config
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
const configParser = require("./configParser")
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String[]} ids
|
||||||
|
* @returns {discord.SelectMenuBuilder|false}
|
||||||
|
*/
|
||||||
|
exports.getDropdown = (ids) => {
|
||||||
|
const dropdown = new discord.SelectMenuBuilder()
|
||||||
|
.setCustomId("OTdropdownMenu")
|
||||||
|
.setDisabled(false)
|
||||||
|
.setMaxValues(1)
|
||||||
|
.setMinValues(1)
|
||||||
|
.setPlaceholder(l.messages.chooseATicket)
|
||||||
|
.addOptions(
|
||||||
|
new discord.SelectMenuOptionBuilder()
|
||||||
|
.setDefault(true)
|
||||||
|
.setLabel(l.messages.chooseATicket)
|
||||||
|
.setValue("OTChooseTicket")
|
||||||
|
)
|
||||||
|
|
||||||
|
ids.forEach((id) => {
|
||||||
|
const option = configParser.getTicketById(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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
return dropdown
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const getButton = require("./getButton")
|
||||||
|
const l = bot.language
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} id the id from an open-ticket embed
|
||||||
|
* @returns {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}} discord embed
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
exports.createEmbed = (id) => {
|
||||||
|
//-----------------------------------
|
||||||
|
//general importing
|
||||||
|
const data = require("./configParser").getConfigMessage(id)
|
||||||
|
/**@type {discord.ButtonBuilder[]}*/
|
||||||
|
var buttons = []
|
||||||
|
/**@type {getButton.rawButtonData[]} */
|
||||||
|
var buttonData = []
|
||||||
|
|
||||||
|
data.options.forEach((option) => {
|
||||||
|
var button = getButton.getButton(option)
|
||||||
|
var localButtonData = getButton.getOption(option)
|
||||||
|
if (button) buttons.push(button)
|
||||||
|
if (localButtonData) buttonData.push(localButtonData)
|
||||||
|
})
|
||||||
|
//-----------------------------------
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
//create the embed
|
||||||
|
const embed = new discord.EmbedBuilder()
|
||||||
|
.setTitle(data.name)
|
||||||
|
if (data.enableFooter) embed.setFooter({text:data.footer})
|
||||||
|
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
||||||
|
|
||||||
|
if (data.enableCustomColor){
|
||||||
|
embed.setColor(data.color)
|
||||||
|
}else{
|
||||||
|
embed.setColor(config.main_color)
|
||||||
|
}
|
||||||
|
|
||||||
|
var description = data.description
|
||||||
|
if (data.enableTicketExplaination){
|
||||||
|
description = description+"\n\n__"+l.messages.chooseCategory+"__\n"
|
||||||
|
|
||||||
|
var ticketExplainations = []
|
||||||
|
buttonData.forEach((button) => {
|
||||||
|
var explaination = button.icon+" **"+button.name+":**\n"+button.description
|
||||||
|
ticketExplainations.push(explaination)
|
||||||
|
})
|
||||||
|
|
||||||
|
description = description+ticketExplainations.join("\n\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.enableMaxTicketsWarning){
|
||||||
|
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (description) embed.setDescription(description)
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
//create the components IF DROPDOWN IS FALSE
|
||||||
|
if (!data.dropdown){
|
||||||
|
var AmountOfRows = Math.ceil(buttons.length / 4)
|
||||||
|
var currentRow = 0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {discord.MessageActionRow[]}
|
||||||
|
*/
|
||||||
|
var componentRows = []
|
||||||
|
|
||||||
|
for (let i = AmountOfRows; i > 0; i--){
|
||||||
|
|
||||||
|
componentRows.push(new discord.ActionRowBuilder())
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.forEach((button,index) => {
|
||||||
|
componentRows[currentRow].addComponents([button])
|
||||||
|
|
||||||
|
if (index == 3 || index == 7 || index == 11 || index == 15 || index == 19 || index == 23 || index == 27 || index == 31 || index == 35 || index == 39){
|
||||||
|
currentRow = currentRow + 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//create the component IF DROPDOWN is true
|
||||||
|
}else{
|
||||||
|
const ids = data.options
|
||||||
|
const dropdown = require("./getDropdown").getDropdown(ids)
|
||||||
|
var componentRows = [
|
||||||
|
new discord.ActionRowBuilder()
|
||||||
|
.setComponents(dropdown)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
//-----------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//return everything
|
||||||
|
/**
|
||||||
|
* @type {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}}
|
||||||
|
*/
|
||||||
|
const returnedData = {embed:embed,componentRows:componentRows}
|
||||||
|
return returnedData
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
|
||||||
|
/**@typedef {{type:String,data:[{key:String,value:String}]}} hiddenData */
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} messageContent
|
||||||
|
* @returns {hiddenData}
|
||||||
|
*/
|
||||||
|
|
||||||
|
exports.readHiddenData = (messageContent) => {
|
||||||
|
//ticketdata//type:123|userid:456)
|
||||||
|
const rawhidden = messageContent.split("[ ](OTDATA|")[1]
|
||||||
|
const rawhidden2 = rawhidden.split("//")
|
||||||
|
|
||||||
|
const datatype = rawhidden2[0]
|
||||||
|
var rawhiddendata = rawhidden2[1]
|
||||||
|
var rawhiddendataArray = rawhiddendata.split("")
|
||||||
|
rawhiddendataArray.pop()
|
||||||
|
|
||||||
|
rawhiddendata = rawhiddendataArray.join("")
|
||||||
|
|
||||||
|
const splittedData = rawhiddendata.split("|")
|
||||||
|
|
||||||
|
const resultData = []
|
||||||
|
splittedData.forEach((data) => {
|
||||||
|
// type:123
|
||||||
|
const dataresult = data.split(":")
|
||||||
|
|
||||||
|
resultData.push({key:dataresult[0],value:dataresult[1]})
|
||||||
|
})
|
||||||
|
|
||||||
|
return {type:datatype,data:resultData}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} type
|
||||||
|
* @param {[{key:String,value:String}]} data
|
||||||
|
* @returns {String}
|
||||||
|
*/
|
||||||
|
exports.writeHiddenData = (type,data) => {
|
||||||
|
const dataValues = []
|
||||||
|
data.forEach((d) => {
|
||||||
|
dataValues.push(d.key+":"+d.value)
|
||||||
|
})
|
||||||
|
|
||||||
|
const datastring = dataValues.join("|")
|
||||||
|
|
||||||
|
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
const discord = require('discord.js')
|
||||||
|
const bot = require('../../index')
|
||||||
|
const client = bot.client
|
||||||
|
const config = bot.config
|
||||||
|
const log = bot.errorLog.log
|
||||||
|
const l = bot.language
|
||||||
|
const storage = bot.storage
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {String} memberid
|
||||||
|
* @param {String} guildid
|
||||||
|
* @returns {Boolean} has permissions?
|
||||||
|
*/
|
||||||
|
exports.command = (memberid,guildid) => {
|
||||||
|
const permsmember = client.guilds.cache.find(g => g.id == guildid).members.cache.find(m => m.id == memberid)
|
||||||
|
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
||||||
|
return false
|
||||||
|
}else {return true}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.sendUserNoPerms = (user) => {
|
||||||
|
try {
|
||||||
|
user.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
||||||
|
return true
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.sendUserNoTicket = (user) => {
|
||||||
|
try {
|
||||||
|
user.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
return true
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.sendUserNoDelete = (user) => {
|
||||||
|
try {
|
||||||
|
user.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
||||||
|
return true
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.sendChannelNoPerms = (channel,user) => {
|
||||||
|
try {
|
||||||
|
channel.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
||||||
|
return true
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.sendChannelNoTicket = (channel,user) => {
|
||||||
|
try {
|
||||||
|
channel.send({embeds:[bot.errorLog.notInATicket]})
|
||||||
|
return true
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {discord.TextChannel} channel
|
||||||
|
* @param {discord.User} user
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
exports.sendChannelNoDelete = (channel,user) => {
|
||||||
|
try {
|
||||||
|
channel.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
||||||
|
return true
|
||||||
|
}catch{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
# changelog
|
|
||||||
|
|
||||||
## v1.3.2
|
|
||||||
### added:
|
|
||||||
- an alias for !resetdatabase: !resetdb
|
|
||||||
- you need the "chalk" library now!
|
|
||||||
- checker.js
|
|
||||||
- "enabled" option for status
|
|
||||||
- better console logs
|
|
||||||
- enable logs option to config
|
|
||||||
### fixed
|
|
||||||
- a bug that crashed the bot on using the command !resetdatabase
|
|
||||||
- "member_role" in config is optional but not recommended
|
|
||||||
- fixed crash on startup
|
|
||||||
- fixed bug where the bot crashes by using transcripts
|
|
||||||
- changed package.json
|
|
||||||
### removed
|
|
||||||
- "canvas" library is not longer required
|
|
||||||
- removed "server_icon" & "server_name" from config
|
|
||||||
|
|
||||||
## v1.3.1
|
|
||||||
### added:
|
|
||||||
- Q&A in the README.md
|
|
||||||
- v1.4.0 announcement
|
|
||||||
### fixed
|
|
||||||
- a bug that happend when you created too much tickets
|
|
||||||
- deprecation warnings (setAuthor & setFooter)
|
|
||||||
- the logo in README.md is smaller now
|
|
||||||
- markdown files relocated
|
|
||||||
- fixed a bug that some messages appeared in Dutch
|
|
||||||
### removed
|
|
||||||
- nothing
|
|
||||||
|
|
||||||
## v1.3.0
|
|
||||||
### added:
|
|
||||||
- now its possible to create 6 tickets instead of 4
|
|
||||||
- you can edit the number of tickets per user now
|
|
||||||
- you can edit & enable/disable all messages
|
|
||||||
- all embeds are now editable
|
|
||||||
- the color of the button can be changed
|
|
||||||
- updated config.json
|
|
||||||
- updated README.md
|
|
||||||
- a new type of button is here: website links
|
|
||||||
### fixed
|
|
||||||
- nothing at the moment :)
|
|
||||||
### removed
|
|
||||||
- nothing
|
|
||||||
|
|
||||||
## v1.2.2
|
|
||||||
### added:
|
|
||||||
- nothing
|
|
||||||
### fixed:
|
|
||||||
- a bug that caused the `warn "message" event deprecated` to be displayed every time you start the bot in the console.
|
|
||||||
- a visual bug that caused the categories from `!ticket msg` to be displayed in a wrong pattern.
|
|
||||||
### removed:
|
|
||||||
- nothing
|
|
||||||
|
|
||||||
## v1.2.1
|
|
||||||
### added:
|
|
||||||
- you can disable credits in config.json
|
|
||||||
### fixed:
|
|
||||||
- a bug that crashed the bot on startup
|
|
||||||
### removed
|
|
||||||
- nothing
|
|
||||||
|
|
||||||
## v1.2.0
|
|
||||||
### added:
|
|
||||||
- the bot is in english now
|
|
||||||
- you can choose your own ticket options now
|
|
||||||
- added !resetdatabase
|
|
||||||
- updated README.md
|
|
||||||
### fixed:
|
|
||||||
- the first bugs
|
|
||||||
### removed:
|
|
||||||
- some useless commands
|
|
||||||
|
|
||||||
## v1.1.1
|
|
||||||
### added:
|
|
||||||
- added "status" options in config.json
|
|
||||||
### fixed:
|
|
||||||
- fixed a bug where the bot's status could be "playing highmt".
|
|
||||||
### removed:
|
|
||||||
- nothing
|
|
||||||
|
|
||||||
## v1.1.0
|
|
||||||
### added:
|
|
||||||
- option to choose your own prefix
|
|
||||||
- enable/disable transcripts
|
|
||||||
- enable/disable categories
|
|
||||||
### fixed:
|
|
||||||
- the bot crashed sometimes
|
|
||||||
### removed:
|
|
||||||
- credits
|
|
||||||
|
|
||||||
## v1.0.0
|
|
||||||
- initial release
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
# config file
|
|
||||||
[](https://discord.com/invite/26vT9wt3n3)
|
|
||||||
[](https://github.com/DJj123dj/open-ticket/releases/tag/v1.3.2)
|
|
||||||
[](#packages)
|
|
||||||
[](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE)
|
|
||||||
|
|
||||||
In this file you find all the information about commands in the config.json file
|
|
||||||
|
|
||||||
|
|
||||||
- bot_name ➜ the name from the bot _**type: string**_
|
|
||||||
- main_color ➜ the color used in embeds _**type: hex color (#000000)**_
|
|
||||||
- auth_token ➜ your bot's token _**type: string**_
|
|
||||||
- botperms_role ➜ this role can do all admin commands from the bot _**type: discord role id**_
|
|
||||||
- prefix ➜ the prefix _**type: string**_
|
|
||||||
- logs ➜ enable logs _**type: boolean**_
|
|
||||||
- credits ➜ disable the credits _**type: boolean**_
|
|
||||||
|
|
||||||
## status: (the status from the bot)
|
|
||||||
- enabled ➜ enable status _**type: boolean**_
|
|
||||||
- type ➜ set the status type _**type: string (PLAYING | LISTENING | WATCHING | CUSTOM)**
|
|
||||||
- text ➜ set the status text _**type: string**_
|
|
||||||
|
|
||||||
## system: (the configuration for the ticket system)
|
|
||||||
- ticket_channel ➜ channel where you are going to set `!ticket msg` _**type: discord channel id**_
|
|
||||||
- max_allowed_tickets ➜ the maximum allowed tickets per person _**type: number**_
|
|
||||||
- enable_DM_Messages ➜ enable DM messages _**type: boolean**_
|
|
||||||
- enable_category ➜ enable category _**type: boolean**_
|
|
||||||
- ticket_category ➜ the category id _**type: discord category id**_
|
|
||||||
- has@everyoneaccess ➜ when enabled everyone has acces to the tickets _**type: boolean**_
|
|
||||||
- member_role ➜ this role doesn't have access to tickets _**type: discord role id**_
|
|
||||||
- enable_transcript ➜ enable the transcript _**type: boolean**_
|
|
||||||
- transcript_channel ➜ the transcript channel id _**type: discord channel id**_
|
|
||||||
|
|
||||||
## messages: (general, dm, ticket)
|
|
||||||
- nopermissions ➜ the message when someone doesn't have permissions _**type: string**_
|
|
||||||
- alreadyCreated ➜ if you have too much tickets open _**type: string**_
|
|
||||||
- newTicket ➜ when you create a new ticket _**type: string**_
|
|
||||||
- closeTicket ➜ when you close a ticket _**type: string**_
|
|
||||||
- newTicketEmbed ➜ the first message in the ticket channel _**type: string**
|
|
||||||
|
|
||||||
## layout: (ticketEmbed, ticketMsg, transcript)
|
|
||||||
`transcript` doesn't have all the options
|
|
||||||
|
|
||||||
- customColorEnabled ➜ custom embed color enabled _**type: boolean**
|
|
||||||
- customColor ➜ the custom color _**type: hex color (#000000)**
|
|
||||||
- footerEnabled ➜ custom footer enabled _**type: boolean**
|
|
||||||
- footer ➜ the custom footer _**type: string**
|
|
||||||
- thumbnailEnabled ➜ custom thumbnail enabled _**type: boolean**
|
|
||||||
- thumbnailURL ➜ the image _**type: string**
|
|
||||||
|
|
||||||
## options: (per ticket)
|
|
||||||
color is not needed when `isURL` is `true`
|
|
||||||
|
|
||||||
- enabled ➜ enable this ticket _**type: boolean**
|
|
||||||
- icon ➜ the button emoji _**type: emoji or custom emoji**
|
|
||||||
- description ➜ ticket description _**type: string**
|
|
||||||
- name ➜ ticket name _**type: string**
|
|
||||||
- channel_prefix ➜ ticket prefix _**type: string**
|
|
||||||
- color ➜ button color _**type: string (red|green|blue|gray|none)**
|
|
||||||
- isURL ➜ create link to a website instead of a normal ticket _**type: boolean**
|
|
||||||
- url ➜ the website to go to _**type: string**
|
|
||||||
|
|
||||||
# thanks for using open-ticket
|
|
||||||
I didn't know that open-tickets was going to be so much used. I will be creating more updates in the future!
|
|
||||||
|
|
||||||
If you have an idea for new updates you can always say it in my discord server!
|
|
||||||
|
|
||||||
open-tickets v1.3.2
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
# Question & Answer
|
|
||||||
## How to install node.js 16?
|
|
||||||
You can install the latest version of node.js on their [website](https://nodejs.org/en/download/). You also need `npm`!
|
|
||||||
|
|
||||||
## How to install all the npm packages?
|
|
||||||
If you installed node.js successful, you can run `npm install` in the command prompt and all the required modules will be installed.
|
|
||||||
|
|
||||||
## Where is the config file documentation?
|
|
||||||
You can find it [here](...)
|
|
||||||
|
|
||||||
**How to start the bot?**
|
|
||||||
If you successfully installed all the npm modules (see above), you can run `npm start`
|
|
||||||
|
|
||||||
## Do I need to know discord.js?
|
|
||||||
Technically not, but it is useful to know if there is an error.
|
|
||||||
|
|
||||||
## Why do I get this error?
|
|
||||||
**Invalid token:**
|
|
||||||
|
|
||||||
_Your discord token is not correct, try to look in the config.json file if it's the correct token._
|
|
||||||
|
|
||||||
**Privileged intent provided is not enabled or whitelisted:**
|
|
||||||
|
|
||||||
_You must enable all the **Gateaway Intents** in the developer panel in the "bot" tab_
|
|
||||||
|
|
||||||
### Report other errors to the discord server!
|
|
||||||
@@ -1,37 +1,243 @@
|
|||||||
const discord = require('discord.js')
|
// __________ __________ ___________ ____ ____
|
||||||
const config = require('./config.json')
|
// / ____ \ / ______ \ / | | \ | |
|
||||||
const intents = discord.Intents
|
// | / \ | | | | | | |_______| | \ | |
|
||||||
const client = new discord.Client({intents:[intents.FLAGS.GUILDS,intents.FLAGS.GUILD_MESSAGES,intents.FLAGS.GUILD_MEMBERS]})
|
// | | | | | |____| | | | | |\ \ | |
|
||||||
exports.client = client
|
// | | | | | ________/ | |______ | | \ \ | |
|
||||||
|
// | | | | | | | _____| | | \ \ | |
|
||||||
|
// | | | | | | | | | | \ \ | |
|
||||||
|
// | | | | | | | |________ | | \ \| |
|
||||||
|
// | \____/ | | | | | | | \ |
|
||||||
|
// \__________/ |__| \__________| |__| \___|
|
||||||
|
|
||||||
require("./checker")()
|
const discord = require("discord.js")
|
||||||
|
const fs = require('fs')
|
||||||
|
const {GatewayIntentBits,Partials} = discord
|
||||||
|
const APIBase = require("./core/api/modules/base")
|
||||||
|
if (APIBase.embeddedMode){
|
||||||
|
var tempClient = APIBase.clientLocation
|
||||||
|
}else{
|
||||||
|
var tempClient = new discord.Client({
|
||||||
|
intents:[
|
||||||
|
GatewayIntentBits.DirectMessages,
|
||||||
|
GatewayIntentBits.GuildInvites,
|
||||||
|
GatewayIntentBits.GuildMembers,
|
||||||
|
GatewayIntentBits.GuildMessages,
|
||||||
|
GatewayIntentBits.Guilds,
|
||||||
|
GatewayIntentBits.MessageContent
|
||||||
|
],
|
||||||
|
partials:[Partials.Channel,Partials.Message]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**@type {discord.Client} */
|
||||||
|
const client = tempClient
|
||||||
|
exports.client = client
|
||||||
|
client.setMaxListeners(50)
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","created client")
|
||||||
|
|
||||||
|
var tempconfig = require("./config.json")
|
||||||
|
/**@type {Boolean} */
|
||||||
|
var isDevConfig = false
|
||||||
|
|
||||||
|
if (process.argv.some((v) => v == "--devconfig")){
|
||||||
|
async function logFLAGS(){
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
console.log(chalk.blue("[FLAGS] => used dev config instead of normal config"))
|
||||||
|
}; logFLAGS()
|
||||||
|
isDevConfig = true
|
||||||
|
try{
|
||||||
|
tempconfig = require("./devConfig.json")
|
||||||
|
}catch{tempconfig = require("./config.json")}
|
||||||
|
}else{
|
||||||
|
tempconfig = require("./config.json")
|
||||||
|
}
|
||||||
|
if (process.argv.some((v) => v == "--nochecker")){
|
||||||
|
async function logFLAGS(){
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
console.log(chalk.blue("[FLAGS] => disabled checker.js"))
|
||||||
|
}; logFLAGS()
|
||||||
|
}
|
||||||
|
if (process.argv.some((v) => v == "--debug")){
|
||||||
|
async function logFLAGS(){
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
console.log(chalk.blue("[FLAGS] => enabled DEBUG mode"))
|
||||||
|
}; logFLAGS()
|
||||||
|
}
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded flags")
|
||||||
|
|
||||||
|
exports.developerConfig = isDevConfig
|
||||||
|
const language = require("./core/languageManager").language
|
||||||
|
exports.language = language
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded language")
|
||||||
|
|
||||||
|
const config = tempconfig
|
||||||
|
exports.config = config
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded config")
|
||||||
|
exports.storage = require('./core/dynamicdatabase/storage')
|
||||||
|
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded storage")
|
||||||
|
|
||||||
|
exports.errorLog = require("./core/errorLogSystem")
|
||||||
|
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")
|
||||||
|
this.errorLog.log("debug","loaded hiddendataTM")
|
||||||
|
|
||||||
|
exports.embeds = {
|
||||||
|
commands:require("./core/interactionHandlers/embeds/commands")
|
||||||
|
}
|
||||||
|
exports.buttons = {
|
||||||
|
close:require("./core/interactionHandlers/buttons/close"),
|
||||||
|
firstmsg:require("./core/interactionHandlers/buttons/firstmsg"),
|
||||||
|
verifybars:require("./core/interactionHandlers/buttons/verifyBars")
|
||||||
|
}
|
||||||
|
this.errorLog.log("debug","loaded buttons & embeds")
|
||||||
|
|
||||||
client.on('ready',async () => {
|
client.on('ready',async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
this.errorLog.log("debug","client logged in")
|
||||||
console.log(chalk.green("open-ticket ready!"))
|
var statusSet = false
|
||||||
if (config.logs){chalk.white("\n\nlogs:\n============")}
|
const setStatus = (type,text) => {
|
||||||
if (config.status.enabled){
|
if (statusSet == true) return
|
||||||
client.user.setActivity(config.status.text,{type:config.status.type})
|
const getTypeEnum = (text) => {
|
||||||
|
if (text.toLowerCase() == "playing") return discord.ActivityType.Playing
|
||||||
|
else if (text.toLowerCase() == "listening") return discord.ActivityType.Listening
|
||||||
|
else if (text.toLowerCase() == "watching") return discord.ActivityType.Watching
|
||||||
|
else return discord.ActivityType.Listening
|
||||||
|
}
|
||||||
|
client.user.setActivity(text,{type:getTypeEnum(type)})
|
||||||
|
statusSet = true
|
||||||
|
log("system","loaded status",[{key:"type",value:type},{key:"text",value:text}])
|
||||||
}
|
}
|
||||||
|
this.errorLog.log("debug","bot status loaded")
|
||||||
|
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
|
if (!process.argv[2]){
|
||||||
|
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
||||||
|
this.errorLog.log("debug","loaded console interface")
|
||||||
|
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
||||||
|
require("./core/utils/liveStatus")()
|
||||||
|
|
||||||
|
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
||||||
|
if (config.status.enabled){
|
||||||
|
setStatus(config.status.type,config.status.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
log("system","bot logged in!")
|
||||||
|
|
||||||
|
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv[2] == "d"){
|
||||||
|
if (config.status.enabled){
|
||||||
|
setStatus(config.status.type,config.status.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!process.argv[2].startsWith("slash")){
|
||||||
|
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
||||||
|
this.errorLog.log("debug","loaded console interface")
|
||||||
|
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
||||||
|
require("./core/utils/liveStatus")()
|
||||||
|
|
||||||
|
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
||||||
|
if (config.status.enabled){
|
||||||
|
setStatus(config.status.type,config.status.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
log("system","bot logged in!")
|
||||||
|
|
||||||
|
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||||
|
}else{
|
||||||
|
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
||||||
|
this.errorLog.log("debug","slashmode activated")
|
||||||
|
console.log("logs:\n================")
|
||||||
|
console.log("client logged in...")
|
||||||
|
console.log("loading files...")
|
||||||
|
if (process.argv[3] == "enable"){
|
||||||
|
console.log(chalk.green("switching to slashEnable.js"))
|
||||||
|
require("./core/slashSystem/slashEnable")()
|
||||||
|
}else if (process.argv[3] == "disable"){
|
||||||
|
console.log(chalk.green("switching to slashDisable.js"))
|
||||||
|
require("./core/slashSystem/slashDisable")()
|
||||||
|
}else{
|
||||||
|
console.log(chalk.red("Internal Error: unknown slash mode!"))
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//load plugins
|
||||||
|
require("./core/api/pluginlauncher")()
|
||||||
|
this.errorLog.log("debug","loading plugins")
|
||||||
|
})
|
||||||
|
if (!require("./core/api/api.json").disable.checkerjs.all) require("./core/checker").checker()
|
||||||
|
this.errorLog.log("debug","loading checker.js")
|
||||||
|
this.errorLog.log("debug","checking config...")
|
||||||
|
|
||||||
|
if (process.argv[2] && process.argv[2].startsWith("slash")){
|
||||||
|
//do nothing
|
||||||
|
}else{
|
||||||
|
|
||||||
|
this.errorLog.log("debug","LOADING COMMANDS")
|
||||||
|
//commands
|
||||||
|
require('./commands/ticket')()
|
||||||
|
require("./commands/help")()
|
||||||
|
require("./commands/close")()
|
||||||
|
require("./commands/delete")()
|
||||||
|
require("./commands/rename")()
|
||||||
|
require("./commands/add")()
|
||||||
|
require("./commands/remove")()
|
||||||
|
require("./commands/reopen")()
|
||||||
|
require("./commands/claim")()
|
||||||
|
require("./commands/unclaim")()
|
||||||
|
|
||||||
|
this.errorLog.log("debug","LOADING CORE")
|
||||||
|
//core
|
||||||
|
require('./core/ticketActions/ticketOpener')()
|
||||||
|
require("./core/reactionRoles")()
|
||||||
|
|
||||||
|
this.errorLog.log("debug","LOADING INTERACTION HANDLERS")
|
||||||
|
//InteractionHandlers
|
||||||
|
require("./core/interactionHandlers/handlers/handlers")()
|
||||||
|
|
||||||
|
//require("./test")()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.errorLog.log("debug","loading api")
|
||||||
|
const APIEvents = require("./core/api/modules/events")
|
||||||
|
const APIConfig = require("./core/api/api.json")
|
||||||
|
|
||||||
|
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=========================="
|
||||||
|
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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=========================="
|
||||||
|
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.errorLog.log("debug","OT error system loaded successfully")
|
||||||
|
|
||||||
|
client.on("debug", async (message) => {
|
||||||
|
if (message.startsWith("Provided token:")){
|
||||||
|
debugLog("Provided token: ***********bot token is invisible**************...")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
debugLog(message)
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on("uncaughtException",async (error,origin) => {
|
||||||
|
const chalk = await (await import("chalk")).default
|
||||||
|
console.log(chalk.red("\nOPEN TICKET ERROR: ")+error+"\n"+chalk.green("\nCreate a ticket in our support server for more information!\nIf you do this, you might help us to avoid a future bug!\n"))
|
||||||
|
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
||||||
|
|
||||||
|
APIEvents.onError(error.name+": "+error.message,new Date())
|
||||||
})
|
})
|
||||||
|
|
||||||
var storage = require('./storage/storage')
|
if (!APIBase.embeddedMode) client.login(config.auth_token)
|
||||||
exports.TicketStorage = storage.ticketStorage
|
this.errorLog.log("debug","login with token")
|
||||||
exports.userTicketStorage = storage.userTicketStorage
|
|
||||||
exports.transcriptStorage = storage.transcriptStorage
|
|
||||||
exports.ticketNumberStorage = storage.ticketNumberStorage
|
|
||||||
|
|
||||||
var ticket = require('./commands/ticket')
|
|
||||||
ticket()
|
|
||||||
|
|
||||||
var ticketSystem = require('./commands/ticketSystem')
|
|
||||||
ticketSystem()
|
|
||||||
|
|
||||||
var ticketExtra = require("./commands/ticketExtra")
|
|
||||||
ticketExtra()
|
|
||||||
|
|
||||||
var database = require('./commands/database')
|
|
||||||
database()
|
|
||||||
|
|
||||||
|
|
||||||
client.login(config.auth_token)
|
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors": {
|
||||||
|
"missingArgsTitle": "قيمة غير صالحة!",
|
||||||
|
"missingArgsDescription": "قيمة مفقودة",
|
||||||
|
"noPermsTitle": "ليس لديك برمشنات !",
|
||||||
|
"noPermsDescription": "أنت بحاجة الى برمشن `ADMINISTRATOR` او أن تكون في قائمة المسموح بهم!",
|
||||||
|
"noPermsDelete": "فقط الإداريين يمكنهم حذف التكت!",
|
||||||
|
"chooseFromListTitle": "Invalid ID",
|
||||||
|
"chooseFromListDescription": "قم بأختيار أحد من الأيديات من الأسفل:",
|
||||||
|
"boterror": "خلل في البوت !",
|
||||||
|
"notInTicketTitle": "انت لست في تكت!",
|
||||||
|
"notInTicketDescription": "هذا الأمر لا يعمل خارج التكت!",
|
||||||
|
"ticketDoesntExist": "هذا التكت لم يعد فعال!",
|
||||||
|
"roleDoesntExist": "خطاً ,لم تعد الرتبة موجوده!",
|
||||||
|
"anotherOption": "هذا الخيار ليس التكت و لكنه شيء أخر!",
|
||||||
|
"maxAmountTitle": "خطأ , تم الوصول الى الحد الأقصى!",
|
||||||
|
"maxAmountDescription": "لقد وصلت الى الحد الأقصى لعدد التكتات المسموحة بها!\nSo لا يمكنك فتح واحدة أخرى!",
|
||||||
|
"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!",
|
||||||
|
|
||||||
|
"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": "إعادة فتح التكت",
|
||||||
|
"sendTranscript": "طبع التكت",
|
||||||
|
"closeWithReason":"close with reason"
|
||||||
|
},
|
||||||
|
"messages": {
|
||||||
|
"reopenTitle": "تم إعادة فتح التكت بنجاح!",
|
||||||
|
"reopenDescription": "لا تتردد في فتح التكت مرة أخرى , حظاً موفقاً!",
|
||||||
|
"closedTitle": "تم إغلاق التكت!",
|
||||||
|
"closedDescription": "فقط الأداريين يمكنهم التحدث في هذا التكت الأن!\n\n*أضغط على الزر بالأسفل لحذف التكت او إعادة فتحة مجدداً!*",
|
||||||
|
"createdTitle": "تم إنشاء تكت!",
|
||||||
|
"createdDescription": "تم أنشاء تكت , قم بأنتظار الدعم في الطريق!",
|
||||||
|
|
||||||
|
"newTicketDmTitle": "تكت جديد!",
|
||||||
|
"closedTicketDmTitle": "تم إغلاق التكت!",
|
||||||
|
"deletedTicketDmTitle": "تم حذف التكت!",
|
||||||
|
"closedTicketDmDescription": "تم أغلاق تذكرتك من قبل إداري",
|
||||||
|
"deletedTicketDmDescription": "تم حذف تذكرتك من قبل إداري!",
|
||||||
|
"reopenTicketDmTitle": "تم إعادة فتح تذكرتك!",
|
||||||
|
"reopenTicketDmDescription": "تم إعادة فتح التكت!",
|
||||||
|
"newTranscriptTitle": "توجد نسخة تكت جديدة هنا!",
|
||||||
|
"hereIsTheTranscript": "هذا هي النسخة:",
|
||||||
|
|
||||||
|
"chooseCategory": "أختر الكتقاجوري:",
|
||||||
|
"gettingdeleted": "يتم حذف التكت...",
|
||||||
|
|
||||||
|
"none": "لا يوجد",
|
||||||
|
"reason": "سبب",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Invalid Arguments!",
|
||||||
|
"missingArgsDescription":"Missing Argument",
|
||||||
|
"noPermsTitle":"No Permissions!",
|
||||||
|
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||||
|
"noPermsDelete":"Only admins can delete a ticket!",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Choose one of the id's below:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"You are not in a ticket!",
|
||||||
|
"notInTicketDescription":"This command doesn't work outside tickets!",
|
||||||
|
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
||||||
|
"roleDoesntExist":"This role doesn't exist anymore!",
|
||||||
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
|
"maxAmountTitle":"Max amount reached!",
|
||||||
|
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
||||||
|
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!",
|
||||||
|
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Added {0} to this ticket!",
|
||||||
|
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||||
|
"renameTitle":"Changed the name to {0}!",
|
||||||
|
"closeTitle":"Closed this ticket!",
|
||||||
|
"deleteTitle":"Deleting this ticket...",
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"The embed is in the message below!",
|
||||||
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Available Commands:",
|
||||||
|
"header1":"**Go to {0} to create a ticket!**\n\n",
|
||||||
|
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
||||||
|
"renameCmd":"Rename a ticket. (no spaces)",
|
||||||
|
"closeCmd":"Close a ticket.",
|
||||||
|
"deleteCmd":"Delete a ticket.",
|
||||||
|
"addCmd":"Add a user to the ticket.",
|
||||||
|
"removeCmd":"Remove a user from the ticket.",
|
||||||
|
"reopenCmd":"Re-Open a ticket after it was closed."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Close Ticket",
|
||||||
|
"delete":"Delete Ticket",
|
||||||
|
"reopen":"Re-Open Ticket",
|
||||||
|
"sendTranscript":"Transcript",
|
||||||
|
"closeWithReason":"close with reason"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"reopenDescription":"Feel free to talk again!",
|
||||||
|
"closedTitle":"Closed this ticket!",
|
||||||
|
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
||||||
|
"createdTitle":"Ticket Created!",
|
||||||
|
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"New Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket Closed!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Deleted!",
|
||||||
|
"closedTicketDmDescription":"Your ticket is closed!",
|
||||||
|
"deletedTicketDmDescription":"Your ticket is deleted!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Re-opened!",
|
||||||
|
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
||||||
|
"newTranscriptTitle":"A new transcript is here!",
|
||||||
|
"hereIsTheTranscript":"Here is the transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"choose a category:",
|
||||||
|
"gettingdeleted":"Ticket is getting deleted...",
|
||||||
|
|
||||||
|
"none":"none",
|
||||||
|
"reason":"reason",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Neplatné argumenty",
|
||||||
|
"missingArgsDescription":"Chybí argumenty",
|
||||||
|
"noPermsTitle":"Nemáš práva!",
|
||||||
|
"noPermsDescription":"Nemáš dostatečné práva na tento příkaz!\n Potřebuješ ADMINISTRATOR aby jsi mohl provést příkaz!",
|
||||||
|
"noPermsDelete":"Pouze admin může smazat ticket!",
|
||||||
|
"chooseFromListTitle":"Neplatné ID",
|
||||||
|
"chooseFromListDescription":"Vyber si z těchto ID:",
|
||||||
|
"boterror":"Error!",
|
||||||
|
"notInTicketTitle":"Nejsi v ticketu!",
|
||||||
|
"notInTicketDescription":"Tento příkaz nefunguje mimo tickety!",
|
||||||
|
"ticketDoesntExist":"Tento ticket už bohužel neexistuje!",
|
||||||
|
"roleDoesntExist":"Tato role bohužel neexistuje!",
|
||||||
|
"anotherOption":"Tato možnost není ticket ale něco jiného!",
|
||||||
|
"maxAmountTitle":"Maximální počet ticketů dosažen!",
|
||||||
|
"maxAmountDescription":"Dosáhl jsi maximálního povoleného počtu ticketů!\n Nemůžeš si vytvořit nový!",
|
||||||
|
"somethingWentWrong":"**Něco je špatně**\nProsím zkus to příště znovu!",
|
||||||
|
"somethingWentWrongTranscript":"Něco je špatně s transcriptem!**\nProsím zkus to příště znovu!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"{0} byl přidán do ticketu!",
|
||||||
|
"userRemovedTitle":"{0} byl odebrám z ticketu!",
|
||||||
|
"renameTitle":"Jméno bylo změněno!",
|
||||||
|
"closeTitle":"Zavři tento ticket!",
|
||||||
|
"deleteTitle":"Smaž tento ticket!",
|
||||||
|
"reopenTitle":"Znovu otevři ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"The embed is in the message below!",
|
||||||
|
"maxTicketWarning":"**Varovaní:** _Můžeš si vytvořit použe {0} ticket(s) v jednu chvíli!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Příkazy:",
|
||||||
|
"header1":"**Běž {0} vytvořit si ticket!**\n\n",
|
||||||
|
"header2":"**Použij příkaz `/new` nebo `/ticket` k vytvoření ticketu!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Vytvoř možnost otevírat tickety přes tlačítko. (ADMIN)",
|
||||||
|
"renameCmd":"Přejmenovat ticket. (Žádné mezery)",
|
||||||
|
"closeCmd":"Zavři ticket.",
|
||||||
|
"deleteCmd":"Smaž ticket.",
|
||||||
|
"addCmd":"Přidej člena do ticketu.",
|
||||||
|
"removeCmd":"Odebere člena z ticketu.",
|
||||||
|
"reopenCmd":"Znovu otevři ticket po uzavření."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Zavři ticket",
|
||||||
|
"delete":"Smaž ticket",
|
||||||
|
"reopen":"Znovu otevři ticket",
|
||||||
|
"sendTranscript":"Odešli log ticketu",
|
||||||
|
"closeWithReason":"close with reason"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Ticket znovu otevřen!",
|
||||||
|
"reopenDescription":"Cítím se skvěle že si můžeme zase povídat!",
|
||||||
|
"closedTitle":"Zavřený ticket!",
|
||||||
|
"closedDescription":"Pouze admin team zde může nyní komunikovat!\n\n*Klikni na tlačítko níže pro smazání nebo znovu otevření ticketu!*",
|
||||||
|
"createdTitle":"Ticket vytvořen!",
|
||||||
|
"createdDescription":"Váš tiket je vytvořen, můžete ho zjistit pomocí pingu!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Nový ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket uzavřen!",
|
||||||
|
"deletedTicketDmTitle":"Ticket smazán!",
|
||||||
|
"closedTicketDmDescription":"Tvůj ticket byl uzavřen!",
|
||||||
|
"deletedTicketDmDescription":"Tvůj ticket byl smazán!",
|
||||||
|
"reopenTicketDmTitle":"Ticket znovu otevřen!",
|
||||||
|
"reopenTicketDmDescription":"Tvůj ticket byl znovu otevřen!",
|
||||||
|
"newTranscriptTitle":"Nový log ticketu je zde!",
|
||||||
|
"hereIsTheTranscript":"Zde je log:",
|
||||||
|
|
||||||
|
"chooseCategory":"Vyber kategorii:",
|
||||||
|
"gettingdeleted":"Ticket bude smazán",
|
||||||
|
|
||||||
|
"none":"nic",
|
||||||
|
"reason":"důvod",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Onjuiste parameters!",
|
||||||
|
"missingArgsDescription":"Er missen parameters",
|
||||||
|
"noPermsTitle":"Geen permissies!",
|
||||||
|
"noPermsDescription":"Je hebt de `ADMINISTRATOR` permissie nodig of je moet in de lijst van toegestane users staan!",
|
||||||
|
"noPermsDelete":"Alleen admins kunnen een ticket verwijderen!",
|
||||||
|
"chooseFromListTitle":"Onjuist ID",
|
||||||
|
"chooseFromListDescription":"Kies een van de id's hier onder:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"Je bent niet in een ticket!",
|
||||||
|
"notInTicketDescription":"Deze command werkt niet buiten tickets!",
|
||||||
|
"ticketDoesntExist":"Dit ticket bestaat niet meer!",
|
||||||
|
"roleDoesntExist":"Deze rol bestaat niet meer!",
|
||||||
|
"anotherOption":"Deze optie is niet een ticket, maar een ander type!",
|
||||||
|
"maxAmountTitle":"Maximum numer bereikt!",
|
||||||
|
"maxAmountDescription":"Je hebt het maximum aantal openstaande tickets bereikt!\nDus je kan geen nieuwe meer maken!",
|
||||||
|
"somethingWentWrong":"**Iets ging fout!**\nProbeer een andere keer opnieuw!",
|
||||||
|
"somethingWentWrongTranscript":"Iets ging fout terwijl het transcript gemaakt werd!**\nProbeer een andere keer opnieuw!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"{0} is toegevoegd aan dit ticket!",
|
||||||
|
"userRemovedTitle":"{0} is verwijderd van dit ticket!",
|
||||||
|
"renameTitle":"De naam is veranderd naar {0}!",
|
||||||
|
"closeTitle":"Ticket gesloten!",
|
||||||
|
"deleteTitle":"Ticket aan het verwijderen...",
|
||||||
|
"reopenTitle":"Ticket heropend!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"De embed is in het bericht hier onder!",
|
||||||
|
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd maken!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Beschikbare Commands:",
|
||||||
|
"header1":"**Ga naar {0} om een ticket te maken!**\n\n",
|
||||||
|
"header2":"**Run de command `/new` of `/ticket` om een ticket te maken!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Spawn een embed met knoppen. (alleen admins)",
|
||||||
|
"renameCmd":"Hernoem een ticket. (geen spaties)",
|
||||||
|
"closeCmd":"Sluit een ticket.",
|
||||||
|
"deleteCmd":"Verijder een ticket.",
|
||||||
|
"addCmd":"Voeg een user aan een ticket.",
|
||||||
|
"removeCmd":"Verwijder een user van een ticket.",
|
||||||
|
"reopenCmd":"Heropen een ticket nadat het gesloten is."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Sluit Ticket",
|
||||||
|
"delete":"Verwijder Ticket",
|
||||||
|
"reopen":"Heropen Ticket",
|
||||||
|
"sendTranscript":"Transcript",
|
||||||
|
"closeWithReason":"sluit met reden"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Ticket heropend!",
|
||||||
|
"reopenDescription":"Voel vrij om weer te praten!",
|
||||||
|
"closedTitle":"Ticket gesloten!",
|
||||||
|
"closedDescription":"Alleen admins kunnen nog praten.\n\n*Klik op de knoppen hieronder voor meer acties!*",
|
||||||
|
"createdTitle":"Ticket Aangemaakt!",
|
||||||
|
"createdDescription":"U ticket is gemaakt, je kan het detecteren bij een ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Nieuw Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket Gesloten!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Verwijderd!",
|
||||||
|
"closedTicketDmDescription":"Je ticket is gesloten!",
|
||||||
|
"deletedTicketDmDescription":"Je ticket is verwijderd!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Heropend!",
|
||||||
|
"reopenTicketDmDescription":"Je ticket is heropend!",
|
||||||
|
"newTranscriptTitle":"Er is een nieuw transcript!",
|
||||||
|
"hereIsTheTranscript":"Hier is het transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"kies een categorie:",
|
||||||
|
"gettingdeleted":"Ticket wordt verwijderd...",
|
||||||
|
|
||||||
|
"none":"geen",
|
||||||
|
"reason":"reden",
|
||||||
|
|
||||||
|
"deletedby":"verwijderd door",
|
||||||
|
"closedby":"gesloten door",
|
||||||
|
"modalreason":"Wat is de reden om dit ticket te sluiten?",
|
||||||
|
"chooseATicket": "Kies een ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Invalid Arguments!",
|
||||||
|
"missingArgsDescription":"Missing Argument",
|
||||||
|
"noPermsTitle":"No Permissions!",
|
||||||
|
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||||
|
"noPermsDelete":"Only admins can delete a ticket!",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Choose one of the id's below:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"You are not in a ticket!",
|
||||||
|
"notInTicketDescription":"This command doesn't work outside tickets!",
|
||||||
|
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
||||||
|
"roleDoesntExist":"This role doesn't exist anymore!",
|
||||||
|
"anotherOption":"This option is not a ticket but another type!",
|
||||||
|
"maxAmountTitle":"Max amount reached!",
|
||||||
|
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
||||||
|
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!",
|
||||||
|
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Added {0} to this ticket!",
|
||||||
|
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||||
|
"renameTitle":"Changed the name to {0}!",
|
||||||
|
"closeTitle":"Closed this ticket!",
|
||||||
|
"deleteTitle":"Deleting this ticket...",
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"The embed is in the message below!",
|
||||||
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Available Commands:",
|
||||||
|
"header1":"**Go to {0} to create a ticket!**\n\n",
|
||||||
|
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
||||||
|
"renameCmd":"Rename a ticket. (no spaces)",
|
||||||
|
"closeCmd":"Close a ticket.",
|
||||||
|
"deleteCmd":"Delete a ticket.",
|
||||||
|
"addCmd":"Add a user to the ticket.",
|
||||||
|
"removeCmd":"Remove a user from the ticket.",
|
||||||
|
"reopenCmd":"Re-Open a ticket after it was closed."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Close Ticket",
|
||||||
|
"delete":"Delete Ticket",
|
||||||
|
"reopen":"Re-Open Ticket",
|
||||||
|
"sendTranscript":"Transcript",
|
||||||
|
"closeWithReason":"close with reason"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"reopenDescription":"Feel free to talk again!",
|
||||||
|
"closedTitle":"Closed this ticket!",
|
||||||
|
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
||||||
|
"createdTitle":"Ticket Created!",
|
||||||
|
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"New Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket Closed!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Deleted!",
|
||||||
|
"closedTicketDmDescription":"Your ticket is closed!",
|
||||||
|
"deletedTicketDmDescription":"Your ticket is deleted!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Re-opened!",
|
||||||
|
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
||||||
|
"newTranscriptTitle":"A new transcript is here!",
|
||||||
|
"hereIsTheTranscript":"Here is the transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"choose a category:",
|
||||||
|
"gettingdeleted":"Ticket is getting deleted...",
|
||||||
|
|
||||||
|
"none":"none",
|
||||||
|
"reason":"reason",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Arguments invalides!",
|
||||||
|
"missingArgsDescription":"Argument manquant",
|
||||||
|
"noPermsTitle":"Pas de permissions!",
|
||||||
|
"noPermsDescription":"Vous avez besoin de la permission `ADMINISTRATOR` ou être dans la liste des rôles autorisés!",
|
||||||
|
"noPermsDelete":"Seuls les administrateurs peuvent supprimer un ticket!",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Choisissez l'un des identifiants ci-dessous:",
|
||||||
|
"boterror":"Bot Error!",
|
||||||
|
"notInTicketTitle":"Vous n'êtes pas dans un ticket!",
|
||||||
|
"notInTicketDescription":"Cette commande ne fonctionne pas en dehors des tickets!",
|
||||||
|
"ticketDoesntExist":"Ce ticket n'existe plus!",
|
||||||
|
"roleDoesntExist":"Ce rôle n'existe plus!",
|
||||||
|
"anotherOption":"Cette option n'est pas un ticket mais un autre type!",
|
||||||
|
"maxAmountTitle":"Montant maximum atteint!",
|
||||||
|
"maxAmountDescription":"Vous avez atteint le nombre maximum de tickets autorisés!\nVous ne pouvez donc pas en créer un nouveau!",
|
||||||
|
"somethingWentWrong":"**Quelque chose s'est mal passé!**\nVeuillez réessayer une autre fois!",
|
||||||
|
"somethingWentWrongTranscript":"Une erreur s'est produite lors de la création de la transcription!**\nVeuillez réessayer une autre fois!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"{0} a été ajouté à ce ticket!",
|
||||||
|
"userRemovedTitle":"Supprimé {0} de ce ticket!",
|
||||||
|
"renameTitle":"Changement du nom en {0}!",
|
||||||
|
"closeTitle":"Fermé ce ticket!",
|
||||||
|
"deleteTitle":"Suppression de ce ticket...",
|
||||||
|
"reopenTitle":"A rouvert ce ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"L'intégration est dans le message ci-dessous!",
|
||||||
|
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} ticket(s) à la fois !_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Commandes disponibles :",
|
||||||
|
"header1":"**Allez à {0} pour créer un ticket !**\n\n",
|
||||||
|
"header2":"**Exécutez la commande `/new` ou `/ticket` pour créer un ticket !**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Faire apparaître une intégration avec des boutons. (administrateurs uniquement)",
|
||||||
|
"renameCmd":"Renommer un ticket. (sans espaces)",
|
||||||
|
"closeCmd":"Fermer un ticket.",
|
||||||
|
"deleteCmd":"Supprimer un billet.",
|
||||||
|
"addCmd":"Ajouter un utilisateur au ticket.",
|
||||||
|
"removeCmd":"Supprimer un utilisateur du ticket.",
|
||||||
|
"reopenCmd":"Rouvrir un ticket après sa clôture."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Fermer le ticket",
|
||||||
|
"delete":"Supprimer le billet",
|
||||||
|
"reopen":"Billet de réouverture",
|
||||||
|
"sendTranscript":"Transcript",
|
||||||
|
"closeWithReason":"fermer avec une raison"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"A rouvert ce ticket!",
|
||||||
|
"reopenDescription":"N'hésitez pas à reparler!",
|
||||||
|
"closedTitle":"Fermé ce ticket!",
|
||||||
|
"closedDescription":"Seuls les administrateurs peuvent parler dans ce ticket maintenant !\n\n*Cliquez sur le bouton ci-dessous pour supprimer ou rouvrir ce ticket !*",
|
||||||
|
"createdTitle":"Ticket créé !",
|
||||||
|
"createdDescription":"Votre ticket est créé, vous pouvez le détecter par un ping !",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Nouveau billet!",
|
||||||
|
"closedTicketDmTitle":"Billet fermé!",
|
||||||
|
"deletedTicketDmTitle":"Billet supprimé !",
|
||||||
|
"closedTicketDmDescription":"Votre billet est fermé !",
|
||||||
|
"deletedTicketDmDescription":"Votre billet est supprimé !",
|
||||||
|
"reopenTicketDmTitle":"Billet rouvert!",
|
||||||
|
"reopenTicketDmDescription":"Votre billet est rouvert !",
|
||||||
|
"newTranscriptTitle":"Une nouvelle transcription est ici!",
|
||||||
|
"hereIsTheTranscript":"Voici la transcription :",
|
||||||
|
|
||||||
|
"chooseCategory":"choisissez une catégorie:",
|
||||||
|
"gettingdeleted":"Le ticket est en cours de suppression...",
|
||||||
|
|
||||||
|
"none":"rien",
|
||||||
|
"reason":"raison",
|
||||||
|
|
||||||
|
"deletedby":"supprimé par",
|
||||||
|
"closedby":"fermé par",
|
||||||
|
"modalreason":"Qu’elle est la raison pour fermer ce ticket?",
|
||||||
|
"chooseATicket": "Choisir un ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Ungültiges Argument!",
|
||||||
|
"missingArgsDescription":"Fehlendes Argument!",
|
||||||
|
"noPermsTitle":"Du hast keine Rechte!",
|
||||||
|
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||||
|
"noPermsDelete":"Only admins can delete a ticket!",
|
||||||
|
"chooseFromListTitle":"Ungültige ID",
|
||||||
|
"chooseFromListDescription":"Wählen Sie eine der folgenden ID:",
|
||||||
|
"boterror":"Bot Fehler!",
|
||||||
|
"notInTicketTitle":"Du bist ein kein Ticket!",
|
||||||
|
"notInTicketDescription":"Der Befehl funktioniert nicht außerhalb eines Tickets!",
|
||||||
|
"ticketDoesntExist":"Das Ticket Exisitert nicht mehr!",
|
||||||
|
"roleDoesntExist":"Die Rolle Exisitiert nicht mehr!",
|
||||||
|
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
||||||
|
"maxAmountTitle":"Das Limit wurde erreicht!",
|
||||||
|
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neue erstellen.!",
|
||||||
|
"somethingWentWrong":"**Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
||||||
|
"somethingWentWrongTranscript":"Bei der Erstellung der Transcript ist etwas schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Added {0} to this ticket!",
|
||||||
|
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||||
|
"renameTitle":"Changed the name to {0}!",
|
||||||
|
"closeTitle":"Closed this ticket!",
|
||||||
|
"deleteTitle":"Deleting this ticket...",
|
||||||
|
"reopenTitle":"Re-Opened this ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"The embed is in the message below!",
|
||||||
|
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Available Commands:",
|
||||||
|
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
||||||
|
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Eine Einbettung mit Schaltflächen erzeugen. (nur admins)",
|
||||||
|
"renameCmd":"Ein Ticket umbenennen. (keine Leerzeichen)",
|
||||||
|
"closeCmd":"Schließen Sie ein Ticket.",
|
||||||
|
"deleteCmd":"Ein Ticket löschen.",
|
||||||
|
"addCmd":"Fügen Sie dem Ticket einen Benutzer hinzu.",
|
||||||
|
"removeCmd":"Entfernen eines Benutzers aus dem Ticket.",
|
||||||
|
"reopenCmd":"Öffnen Sie ein Ticket erneut, nachdem es geschlossen wurde."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Ticket schließen",
|
||||||
|
"delete":"Ticket löschen",
|
||||||
|
"reopen":"Ticket wieder öffnen",
|
||||||
|
"sendTranscript":"Transcript-Datei senden",
|
||||||
|
"closeWithReason":"Geschlossen mit dem Grund"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Dieses Ticket wiedereröffnet!",
|
||||||
|
"reopenDescription":"Sie können gerne weiterreden!",
|
||||||
|
"closedTitle":"Dieses Ticket geschlossen!",
|
||||||
|
"closedDescription":"Nur Admins können jetzt in diesem Ticket sprechen!\n\n*Klicken Sie auf die Schaltfläche unten, um dieses Ticket zu löschen oder erneut zu öffnen!*",
|
||||||
|
"createdTitle":"Ticket erstellt!",
|
||||||
|
"createdDescription":"Ihr Ticket ist erstellt, Sie können es durch einen Ping erkennen!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Neues Ticket!",
|
||||||
|
"closedTicketDmTitle":"Ticket schließen!",
|
||||||
|
"deletedTicketDmTitle":"Ticket löschen!",
|
||||||
|
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
||||||
|
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
||||||
|
"reopenTicketDmTitle":"Ticket neu Eröffnen!",
|
||||||
|
"reopenTicketDmDescription":"Dein Ticket ist Neu eröffnet!",
|
||||||
|
"newTranscriptTitle":"Eine neue Transscript finden Sie hier!",
|
||||||
|
"hereIsTheTranscript":"Hier ist das Transscript:",
|
||||||
|
|
||||||
|
"chooseCategory":"Wähle eine Kategorie:",
|
||||||
|
"gettingdeleted":"Ticket wird gelöscht...",
|
||||||
|
|
||||||
|
"none":"none",
|
||||||
|
"reason":"reason",
|
||||||
|
|
||||||
|
"deletedby":"Gelöscht von",
|
||||||
|
"closedby":"Geschlossen von",
|
||||||
|
"modalreason":"Was ist der Grund für das schließen des Tickets?",
|
||||||
|
"chooseATicket": "Wähle ein Ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Argomenti non validi!",
|
||||||
|
"missingArgsDescription":"Argomento mancante",
|
||||||
|
"noPermsTitle":"Permessi mancanti!",
|
||||||
|
"noPermsDescription":"Hai bisogno del permesso `ADMINISTRATOR` e essere nella lista dei ruoli accettati!",
|
||||||
|
"noPermsDelete":"Solo gli amministratori possono chiudere un ticket!",
|
||||||
|
"chooseFromListTitle":"ID non valido",
|
||||||
|
"chooseFromListDescription":"Scegli uno degli ID sotto:",
|
||||||
|
"boterror":"Errore del bot!",
|
||||||
|
"notInTicketTitle":"Non sei in un ticket!",
|
||||||
|
"notInTicketDescription":"Questo comando non funziona fuori da un ticket!",
|
||||||
|
"ticketDoesntExist":"Questo ticket non esiste più!",
|
||||||
|
"roleDoesntExist":"Questo ruolo non esiste più!",
|
||||||
|
"anotherOption":"Questa opzione non è di un ticket!",
|
||||||
|
"maxAmountTitle":"Massimo numero raggiunto!",
|
||||||
|
"maxAmountDescription":"Hai raggiunto il massimo numero di ticket consentiti!\nNon puoi crearne altri!",
|
||||||
|
"somethingWentWrong":"**Qualcosa è andato storto!**\nPerfavore riprova un'altra volta!",
|
||||||
|
"somethingWentWrongTranscript":"Qualcosa è andata storta durante la trascrizione!**\nPerfavore riprova un'altra volta!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Aggiunto {0} al ticket!",
|
||||||
|
"userRemovedTitle":"Rimosso {0} da questo ticket!",
|
||||||
|
"renameTitle":"Cambia il nome in {0}!",
|
||||||
|
"closeTitle":"Chiudo questo ticket!",
|
||||||
|
"deleteTitle":"Eliminando questo ticket...",
|
||||||
|
"reopenTitle":"Ri-Aperto questo ticket!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"L'embed è nel messaggio sotto!",
|
||||||
|
"maxTicketWarning":"**Attenzione:** _Tu puoi creare solo {0} ticket(s) per 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 pulsanti. (solo amministratori)",
|
||||||
|
"renameCmd":"Rinomina un ticket. (senza spazi)",
|
||||||
|
"closeCmd":"Chiudi un ticket.",
|
||||||
|
"deleteCmd":"Elimina un ticket.",
|
||||||
|
"addCmd":"Aggiungi un membro al ticket.",
|
||||||
|
"removeCmd":"Rimuovi un membro dal ticket.",
|
||||||
|
"reopenCmd":"Riapri un ticket dopo averlo chiuso."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Chiudi il ticket",
|
||||||
|
"delete":"Elimina il ticket",
|
||||||
|
"reopen":"Riapri il ticket",
|
||||||
|
"sendTranscript":"Trascrizione",
|
||||||
|
"closeWithReason":"chiudi con un motivo"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Riaperto questo ticket!",
|
||||||
|
"reopenDescription":"Sentiti libero di parlare di nuovo!",
|
||||||
|
"closedTitle":"Chiudo questo ticket!",
|
||||||
|
"closedDescription":"Solo gli amministratori possono parlare in questo ticket ora!\n\n*Clicca sul bottone sotto per chiudere o riaprire 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 è stato eliminato!",
|
||||||
|
"reopenTicketDmTitle":"Ticket riaperto!",
|
||||||
|
"reopenTicketDmDescription":"Il tuo ticket è stato riaperto!",
|
||||||
|
"newTranscriptTitle":"Un nuova trascrizione è qui!",
|
||||||
|
"hereIsTheTranscript":"Qui è la trascrizione:",
|
||||||
|
|
||||||
|
"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 il ticket?",
|
||||||
|
"chooseATicket": "Scegli un ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"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!",
|
||||||
|
"somethingWentWrongTranscript":"Algo deu errado ao fazer a transcrição!**\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!",
|
||||||
|
|
||||||
|
"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",
|
||||||
|
"sendTranscript":"Transcrição",
|
||||||
|
"closeWithReason":"close with reason"
|
||||||
|
},
|
||||||
|
"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!",
|
||||||
|
"newTranscriptTitle":"Uma nova transcrição está aqui!",
|
||||||
|
"hereIsTheTranscript":"Aqui está a transcrição:",
|
||||||
|
|
||||||
|
"chooseCategory":"Escolha a categoria:",
|
||||||
|
"gettingdeleted":"Ticket está sendo deletado...",
|
||||||
|
|
||||||
|
"none":"none",
|
||||||
|
"reason":"reason",
|
||||||
|
|
||||||
|
"deletedby":"deleted by",
|
||||||
|
"closedby":"closed by",
|
||||||
|
"modalreason":"What is the reason for closing this ticket?",
|
||||||
|
"chooseATicket": "Choose a ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"Argumente Invalide",
|
||||||
|
"missingArgsDescription":"Argument Lipsa",
|
||||||
|
"noPermsTitle":"Nu ai permisiunea necesara!",
|
||||||
|
"noPermsDescription":"Ai nevoie de permisiunea de `ADMINISTRATOR`!",
|
||||||
|
"noPermsDelete":"Doar adminii pot inchide un ticket!",
|
||||||
|
"chooseFromListTitle":"Invalid ID",
|
||||||
|
"chooseFromListDescription":"Alege unul dintre id-urile urmatoare:",
|
||||||
|
"boterror":"Eroare bot!",
|
||||||
|
"notInTicketTitle":"Nu esti intr-un ticket!",
|
||||||
|
"notInTicketDescription":"Aceasta comanda nu merge inafara unui ticket!",
|
||||||
|
"ticketDoesntExist":"Acest ticket nu mai exista!",
|
||||||
|
"roleDoesntExist":"Acest rol nu mai exista!",
|
||||||
|
"anotherOption":"Aceasta optiune este altceva decat un tip de ticket!",
|
||||||
|
"maxAmountTitle":"Limita atinsa!",
|
||||||
|
"maxAmountDescription":"Ai atins limita de tickets!\nAsa ca nu mai poti creea altele noi!",
|
||||||
|
"somethingWentWrong":"**Ceva nu a mers bine!**\nTe rugam sa incerci mai tarziu!",
|
||||||
|
"somethingWentWrongTranscript":"Ceva nu aa mers bine in timpul creeari transcript-ului!**\nTe rugam sa incerci mai tarziu!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"{0} a fost adaugat in acest ticket!",
|
||||||
|
"userRemovedTitle":"{0} a fost scos din acest ticket!",
|
||||||
|
"renameTitle":"Nume schimbat in {0}!",
|
||||||
|
"closeTitle":"Ticket inchis!",
|
||||||
|
"deleteTitle":"Se sterge ticket-ul...",
|
||||||
|
"reopenTitle":"Ticket Re-deschis!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"Embed-ul se afla in mesajul de mai jos!",
|
||||||
|
"maxTicketWarning":"**Avertizare:** _Poti creea doar {0} tickete active!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Comenzi disponibile:",
|
||||||
|
"header1":"**Mergi la {0} pentru a creea un ticket!**\n\n",
|
||||||
|
"header2":"**Ruleaza comanda `/new` ori `/ticket` pentru a creea un ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Trimite embed-ul cu tickete. (doar admini)",
|
||||||
|
"renameCmd":"Redenumeste un ticket. (fara spatii)",
|
||||||
|
"closeCmd":"Inchide un ticket.",
|
||||||
|
"deleteCmd":"Sterge un ticket.",
|
||||||
|
"addCmd":"Adauga un utilizator in ticket.",
|
||||||
|
"removeCmd":"Sterge un utilizator din ticket.",
|
||||||
|
"reopenCmd":"Re-deschide un ticket dupa ce a fost deschis."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Inchide ticket-ul",
|
||||||
|
"delete":"Sterge ticket-ul",
|
||||||
|
"reopen":"Re-deschide un ticket",
|
||||||
|
"sendTranscript":"Transcript",
|
||||||
|
"closeWithReason":"Inchide cu motiv"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"Ticket Re-deschis!",
|
||||||
|
"reopenDescription":"Poti vorbi din nou!",
|
||||||
|
"closedTitle":"Ticket inchis!",
|
||||||
|
"closedDescription":"Doar adminii pot vorbi in acest ticket acum!\n\n*Apasa pe butonul de mai jos pentru a re-deschide ori sterge ticket-ul!*",
|
||||||
|
"createdTitle":"Ticket Creat!",
|
||||||
|
"createdDescription":"Ticket-ul tau a fost creat, poti sa il vezi in canalul pe care ai fost mentionat!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"Ticket nou!",
|
||||||
|
"closedTicketDmTitle":"Ticket Inchis!",
|
||||||
|
"deletedTicketDmTitle":"Ticket Sters!",
|
||||||
|
"closedTicketDmDescription":"Ticket-ul tau este inchis!",
|
||||||
|
"deletedTicketDmDescription":"Ticket-ul tau este sters!",
|
||||||
|
"reopenTicketDmTitle":"Ticket Re-deschis!",
|
||||||
|
"reopenTicketDmDescription":"Ticket-ul tau este re-deschis!",
|
||||||
|
"newTranscriptTitle":"Un nou transcript este aici!",
|
||||||
|
"hereIsTheTranscript":"Aici este transcriptul:",
|
||||||
|
|
||||||
|
"chooseCategory":"Alege o categorie:",
|
||||||
|
"gettingdeleted":"Ticket-ul se sterge...",
|
||||||
|
|
||||||
|
"none":"niciunul",
|
||||||
|
"reason":"Motiv",
|
||||||
|
|
||||||
|
"deletedby":"Sters de",
|
||||||
|
"closedby":"Inchis de",
|
||||||
|
"modalreason":"Care este motivul pentru inchiderea acestui ticket?",
|
||||||
|
"chooseATicket": "Alege un ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
{
|
||||||
|
"examples":{
|
||||||
|
"en-GB":"english",
|
||||||
|
"en-US":"english",
|
||||||
|
"nl":"dutch",
|
||||||
|
"ro":"romanian",
|
||||||
|
"de":"german",
|
||||||
|
"cs":"czech",
|
||||||
|
"fr":"french",
|
||||||
|
"es-ES":"spanish",
|
||||||
|
"it":"italian",
|
||||||
|
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
},
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"claim":{
|
||||||
|
"en-GB":"",
|
||||||
|
"en-US":"",
|
||||||
|
"nl":"",
|
||||||
|
"ro":"",
|
||||||
|
"de":"",
|
||||||
|
"cs":"",
|
||||||
|
"fr":"",
|
||||||
|
"es-ES":"",
|
||||||
|
"it":""
|
||||||
|
},
|
||||||
|
"unclaim":{
|
||||||
|
"en-GB":"",
|
||||||
|
"en-US":"",
|
||||||
|
"nl":"",
|
||||||
|
"ro":"",
|
||||||
|
"de":"",
|
||||||
|
"cs":"",
|
||||||
|
"fr":"",
|
||||||
|
"es-ES":"",
|
||||||
|
"it":""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"errors":{
|
||||||
|
"missingArgsTitle":"¡Argumentos inválidos!",
|
||||||
|
"missingArgsDescription":"Argumento faltante.",
|
||||||
|
"noPermsTitle":"¡Sin permisos!",
|
||||||
|
"noPermsDescription":"Necesitas el permiso de `ADMINISTRADOR` o estar en la lista de roles permitidos!",
|
||||||
|
"noPermsDelete":"Solo los administradores pueden eliminar un ticket.!",
|
||||||
|
"chooseFromListTitle":"ID Invalida",
|
||||||
|
"chooseFromListDescription":"Elije una de las ID de abajo:",
|
||||||
|
"boterror":"¡Error del bot!",
|
||||||
|
"notInTicketTitle":"¡No te encuentras en un ticket!",
|
||||||
|
"notInTicketDescription":"¡Este comando no funciona fuera de los tickets!",
|
||||||
|
"ticketDoesntExist":"¡Este ticket no existe!",
|
||||||
|
"roleDoesntExist":"¡Este rol no existe!",
|
||||||
|
"anotherOption":"¡Esta opción no es un ticket, si no otra cosa!",
|
||||||
|
"maxAmountTitle":"¡Máxima cantidad alcanzada!",
|
||||||
|
"maxAmountDescription":"¡Has alcanzado la máxima cantidad de tickets permitida!\n¡Por lo que no puedes crear otro!",
|
||||||
|
"somethingWentWrong":"**¡Algo salió mal!**\n¡Prueba dentro de un rato!",
|
||||||
|
"somethingWentWrongTranscript":"**¡Algo salió mal al hacer el transcript!**\n¡Prueba en otro momento!"
|
||||||
|
},
|
||||||
|
"commands":{
|
||||||
|
"userAddedTitle":"Se agregó {0} al ticket!",
|
||||||
|
"userRemovedTitle":"Se eliminó {0} del ticket!",
|
||||||
|
"renameTitle":"Cambió el nombre a {0}!",
|
||||||
|
"closeTitle":"Cerró este ticket!",
|
||||||
|
"deleteTitle":"Eliminando este ticket...",
|
||||||
|
"reopenTitle":"Re-abrió este boleto!",
|
||||||
|
"claimTitle":"This ticket is now claimed to {0}",
|
||||||
|
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||||
|
|
||||||
|
"ticketWarning":"La inserción está en el mensaje a continuación!",
|
||||||
|
"maxTicketWarning":"**Advertencia:** _Solo puedes crear {0} ticket(s) a la vez!_"
|
||||||
|
},
|
||||||
|
"helpMenu":{
|
||||||
|
"title":"Comandos disponibles:",
|
||||||
|
"header1":"**¡Dirígete a {0} para crear un nuevo ticket!**\n\n",
|
||||||
|
"header2":"**¡Ejecuta el comando `/new` o `/ticket` para crear un ticket!**\n\n",
|
||||||
|
|
||||||
|
"msgCmd":"Generar un embed con botones. (Solo admins)",
|
||||||
|
"renameCmd":"Renombrar un ticket. (Sin espacios)",
|
||||||
|
"closeCmd":"Cerrar un ticket.",
|
||||||
|
"deleteCmd":"Eliminar un ticket.",
|
||||||
|
"addCmd":"Agregar un usuario al ticket.",
|
||||||
|
"removeCmd":"Eliminar un usuario del ticket.",
|
||||||
|
"reopenCmd":"Re-Abre un ticket después de que este se vea cerrado."
|
||||||
|
},
|
||||||
|
"buttons":{
|
||||||
|
"close":"Cerrar ticket.",
|
||||||
|
"delete":"Eliminar ticket",
|
||||||
|
"reopen":"Re-Abrir ticket",
|
||||||
|
"sendTranscript":"Obtener transcript.",
|
||||||
|
"closeWithReason":"cerrar con razón"
|
||||||
|
},
|
||||||
|
"messages":{
|
||||||
|
"reopenTitle":"¡Ticket Re-Abierto!",
|
||||||
|
"reopenDescription":"¡Siéntete libre de hablar de nuevo!",
|
||||||
|
"closedTitle":"¡Ticket cerrado!",
|
||||||
|
"closedDescription":"¡Solo admins pueden hablar ahora en este ticket!\n\n*¡Presiona en el botón de abajo para eliminar o re-abrir el ticket!*",
|
||||||
|
"createdTitle":"¡Ticket creado!",
|
||||||
|
"createdDescription":"¡Ticket creado, también te he mencionado en él!",
|
||||||
|
|
||||||
|
"newTicketDmTitle":"¡Nuevo ticket!",
|
||||||
|
"closedTicketDmTitle":"¡Ticket cerrado!",
|
||||||
|
"deletedTicketDmTitle":"¡Ticket eliminado!",
|
||||||
|
"closedTicketDmDescription":"¡Tu ticket fué cerrado!",
|
||||||
|
"deletedTicketDmDescription":"¡Tu ticket fué eliminado!",
|
||||||
|
"reopenTicketDmTitle":"¡Ticket re-abierto!",
|
||||||
|
"reopenTicketDmDescription":"¡Tu ticket se vió abierto de nuevo!",
|
||||||
|
"newTranscriptTitle":"¡Un nuevo transcript está aquí!",
|
||||||
|
"hereIsTheTranscript":"Aquí está el transcript:",
|
||||||
|
|
||||||
|
"chooseCategory":"Elije una categoría:",
|
||||||
|
"gettingdeleted":"El ticket se está viendo eliminado...",
|
||||||
|
|
||||||
|
"none":"Ninguna.",
|
||||||
|
"reason":"Razón",
|
||||||
|
|
||||||
|
"deletedby":"eliminado por",
|
||||||
|
"closedby":"cerrado por",
|
||||||
|
"modalreason":"Cúal es la razón para cerrar este ticket?",
|
||||||
|
"chooseATicket": "Elije un ticket"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 136 KiB |
+7
-3
@@ -1,17 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "open-ticket",
|
"name": "open-ticket",
|
||||||
"version": "1.3.2",
|
"version": "3.0.0",
|
||||||
"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": {
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "node index.js d",
|
||||||
|
"slashEnable": "node index.js slash enable",
|
||||||
|
"slashDisable": "node index.js slash disable",
|
||||||
|
"cleardata": "node ./core/dynamicdatabase/cleardata.js"
|
||||||
},
|
},
|
||||||
"author": "DJdj Development",
|
"author": "DJdj Development",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"axios": "^0.27.2",
|
||||||
"chalk": "^5.0.1",
|
"chalk": "^5.0.1",
|
||||||
"discord.js": "^13.6.0",
|
"discord.js": "^14.0.2",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"node": "^16.10.0",
|
"node": "^16.10.0",
|
||||||
"node-localstorage": "^2.2.1"
|
"node-localstorage": "^2.2.1"
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const discord = require("discord.js")
|
||||||
|
const api = require("../core/api/api.js")
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
const {client,config,events,utils,actions} = api
|
||||||
|
|
||||||
|
//this code will run when the bot starts!
|
||||||
|
|
||||||
|
//in this example, we will say "hello" in the console when someone opens a ticket!
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
events.onTicketOpen((user,channel,guild,date,ticketdata) => {
|
||||||
|
console.log("hello, someone opened a ticket!")
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
}
|
||||||
Vendored
BIN
Binary file not shown.
@@ -1,14 +0,0 @@
|
|||||||
const LocalStorage = require("node-localstorage")
|
|
||||||
|
|
||||||
const ticketStorage = new LocalStorage.LocalStorage("./storage/tickets")
|
|
||||||
exports.ticketStorage = ticketStorage
|
|
||||||
|
|
||||||
const userTicketStorage = new LocalStorage.LocalStorage("./storage/userTickets")
|
|
||||||
exports.userTicketStorage = userTicketStorage
|
|
||||||
|
|
||||||
const transcriptStorage = new LocalStorage.LocalStorage("./storage/transcripts")
|
|
||||||
exports.transcriptStorage = transcriptStorage
|
|
||||||
|
|
||||||
//const ticketNumberStorage = new LocalStorage.LocalStorage("./storage/ticketNumbers")
|
|
||||||
//exports.ticketNumberStorage = ticketNumberStorage
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user