Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
739ad81f3f | ||
|
|
a6f67a9452 | ||
|
|
56a6540663 | ||
|
|
5f8812d261 | ||
|
|
7a3dcf4c42 | ||
|
|
7cebd4dd6a | ||
|
|
27912a0c37 | ||
|
|
67871d885a | ||
|
|
1bd0d013ed | ||
|
|
a074a17519 | ||
|
|
67af96ef5c | ||
|
|
a041f28cf7 | ||
|
|
a8c9c2ea8d |
+42
-3
@@ -1,3 +1,42 @@
|
|||||||
# comming soon
|
# Contributing
|
||||||
For now on, you can create a ticket in our server:
|
## Translation
|
||||||
https://discord.dj-dj.be
|
### Step 1: checking
|
||||||
|
1. [Check if the language isn't already in open ticket!](/language/)
|
||||||
|
2. Check if the current translation is up-to-date!
|
||||||
|
3. Can you edit/write JSON?
|
||||||
|
|
||||||
|
If there is translation missing & you can write json, then go to the next step!
|
||||||
|
|
||||||
|
### Step 2: translating
|
||||||
|
**RULES:**
|
||||||
|
- Always upload to the [__`dev` branch!__](https://github.com/DJj123dj/open-ticket/tree/dev)
|
||||||
|
- Don't change anything else, except the translation you are adding!
|
||||||
|
- Translations are checked before uploading, so don't write things that aren't specified in the json file
|
||||||
|
- Always start translating from `english.json` or `custom.json`! Never from another language.
|
||||||
|
|
||||||
|
If you translate, you need to change 2 files! The first one is required, the other one is optional & will be added by us if you don't do it!
|
||||||
|
1. add `yourlanguage.json` to the `/language/` directory
|
||||||
|
2. (OPTIONAL) add your discord name & tag in the translator table in `README.md`
|
||||||
|
|
||||||
|
### Step 3: waiting
|
||||||
|
Translations will always be added in the **next version** of Open Ticket! They will never be added to the `main` branch directly without anything else! This means that it can take some time before your translation is in the official version!
|
||||||
|
|
||||||
|
## Writing plugins
|
||||||
|
We are going to create an official repository for plugins soon!
|
||||||
|
But don't worry! You can already write some plugins!
|
||||||
|
|
||||||
|
**RULES:**
|
||||||
|
- Always specify the versions that the plugin is compatible with!
|
||||||
|
- If extra npm dependencies are needed, then they also need to be specified!
|
||||||
|
- If there are errors while you write a plugin/edit the code in some way. Then we can't help you with fixing the bug. We only fix bugs that are part of an unedited version of Open Ticket!
|
||||||
|
|
||||||
|
## Other versions of contributing
|
||||||
|
If you want to contribute in another way, feel free to join [our discord server](https://discord.dj-dj.be) & talk about how you are going to do it. We will always help you!
|
||||||
|
|
||||||
|
<br>
|
||||||
|
CONTRIBUTING GUIDELINES - Last updated: 23/3/2023<br>
|
||||||
|
© DJdj Development<br><br>
|
||||||
|
Website: https://www.dj-dj.be <br>
|
||||||
|
Discord: https://discord.dj-dj.be <br>
|
||||||
|
Email: support@dj-dj.be <br>
|
||||||
|
Open Ticket website: https://openticket.dj-dj.be
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve Open Ticket
|
about: Report bugs to help us improve open ticket!
|
||||||
title: "[BUG] your bug"
|
title: "[BUG] your bug"
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: ''
|
assignees: DJj123dj
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Plugin
|
name: Plugin
|
||||||
about: Show your open ticket plugins here!
|
about: Show your plugin to the developers from open ticket!
|
||||||
title: "[PLUGIN] your plugin"
|
title: "[PLUGIN] your plugin"
|
||||||
labels: plugin
|
labels: plugin
|
||||||
assignees: ''
|
assignees: DJj123dj
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Support for Open Ticket is only available for the versions specified below!
|
||||||
|
|
||||||
|
✅ Supported
|
||||||
|
🟧 Partially Supported
|
||||||
|
❌ Not Supported
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 3.3.3 | :white_check_mark: |
|
||||||
|
| 3.3.0 | 🟧 |
|
||||||
|
| 3.2.2 | 🟧 |
|
||||||
|
| < 3.2.2 | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
You can report Vulnerabilities, errors & bugs in the following ways:
|
||||||
|
|
||||||
|
- Creating an issue on github
|
||||||
|
- Creating a ticket in our discord server
|
||||||
|
- Reporting the bug in DM on discord (DJj123dj#1706)
|
||||||
|
- Emailing support@dj-dj.be
|
||||||
|
|
||||||
|
If your report an error, be clear about what is going on.
|
||||||
|
Specify the version & language of the bot together with when the error happend. (for example: when I click the close button)
|
||||||
|
Send screenshots from the error if possible, and send openticketdebug.txt (or a screenshot of it) to us.
|
||||||
|
Don't just report the error and never reply again! It can be possible that we need you for more information!
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
Visit [Contributing.md](/.github/CONTRIBUTING.md) for rules about translating & adding features!
|
||||||
|
|
||||||
|
<br>
|
||||||
|
SECURITY POLICY - Last updated: 23/3/2023<br>
|
||||||
|
© DJdj Development<br><br>
|
||||||
|
Website: https://www.dj-dj.be <br>
|
||||||
|
Discord: https://discord.dj-dj.be <br>
|
||||||
|
Email: support@dj-dj.be <br>
|
||||||
|
Open Ticket website: https://openticket.dj-dj.be
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<img src="https://www.dj-dj.be/wp-content/uploads/2023/02/open-ticket-cropped.png" alt="Open Ticket" width="600px">
|
<img src="https://www.dj-dj.be/wp-content/uploads/2023/02/open-ticket-cropped.png" alt="Open Ticket" width="600px">
|
||||||
|
|
||||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.3.1) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.3.3) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
||||||
|
|
||||||
### Open Ticket
|
### Open Ticket
|
||||||
Open Ticket is of the most customisable discord ticket bots of all time!
|
Open Ticket is of the most customisable discord ticket bots of all time!
|
||||||
@@ -62,7 +62,7 @@ Translators
|
|||||||
|Slovenian |n1kkec#5341 |
|
|Slovenian |n1kkec#5341 |
|
||||||
|
|
||||||
## links
|
## links
|
||||||
current version: _v3.3.1_
|
current version: _v3.3.3_
|
||||||
</br>changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
</br>changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
||||||
</br>documentation: [click here](https://docs.openticket.dj-dj.be/quick-start)
|
</br>documentation: [click here](https://docs.openticket.dj-dj.be/quick-start)
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -34,11 +34,11 @@ module.exports = () => {
|
|||||||
const hiddendata = hdraw.hiddenData
|
const hiddendata = hdraw.hiddenData
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
hiddendata.data.push({key:"claimedby",value:interaction.user.id})
|
hiddendata.data.push({key:"claimedby",value:claimingUser.id})
|
||||||
storage.set("claimData",interaction.channel.id,interaction.user.id)
|
storage.set("claimData",msg.channel.id,claimingUser.id)
|
||||||
|
|
||||||
const newEmbed = new embed(firstmsg.embeds[0].data)
|
const newEmbed = new embed(firstmsg.embeds[0].data)
|
||||||
.setFooter({text:"claimed by: "+interaction.user.tag,iconURL:interaction.user.displayAvatarURL()})
|
.setFooter({text:"claimed by: "+msg.author.tag,iconURL:msg.author.displayAvatarURL()})
|
||||||
.setDescription(hdraw.description+bot.hiddenData.writeHiddenData(hiddendata.type,hiddendata.data))
|
.setDescription(hdraw.description+bot.hiddenData.writeHiddenData(hiddendata.type,hiddendata.data))
|
||||||
|
|
||||||
if (firstmsg.components[0].components[1] && firstmsg.components[0].components[1].disabled){
|
if (firstmsg.components[0].components[1] && firstmsg.components[0].components[1].disabled){
|
||||||
@@ -66,8 +66,7 @@ module.exports = () => {
|
|||||||
if (!interaction.guild) return
|
if (!interaction.guild) return
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
permsChecker.sendUserNoPerms(interaction.user)
|
||||||
interaction.reply({content:":x: "+l.errors.noPermsTitle,ephemeral:true})
|
return interaction.reply({content:":x: "+l.errors.noPermsTitle,ephemeral:true})
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
@@ -80,8 +79,8 @@ module.exports = () => {
|
|||||||
const hiddendata = hdraw.hiddenData
|
const hiddendata = hdraw.hiddenData
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
hiddendata.data.push({key:"claimedby",value:interaction.user.id})
|
hiddendata.data.push({key:"claimedby",value:user.id})
|
||||||
storage.set("claimData",interaction.channel.id,interaction.user.id)
|
storage.set("claimData",interaction.channel.id,user.id)
|
||||||
|
|
||||||
const newEmbed = new embed(firstmsg.embeds[0].data)
|
const newEmbed = new embed(firstmsg.embeds[0].data)
|
||||||
.setFooter({text:"claimed by: "+user.tag,iconURL:user.displayAvatarURL()})
|
.setFooter({text:"claimed by: "+user.tag,iconURL:user.displayAvatarURL()})
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ module.exports = () => {
|
|||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
||||||
|
|
||||||
hiddendata.data.push({key:"claimedby",value:"false"})
|
hiddendata.data.push({key:"claimedby",value:"false"})
|
||||||
storage.set("claimData",interaction.channel.id,"false")
|
storage.set("claimData",msg.channel.id,"false")
|
||||||
|
|
||||||
const newEmbed = new embed(firstmsg.embeds[0].data)
|
const newEmbed = new embed(firstmsg.embeds[0].data)
|
||||||
.setDescription(hdraw.description+bot.hiddenData.writeHiddenData(hiddendata.type,hiddendata.data))
|
.setDescription(hdraw.description+bot.hiddenData.writeHiddenData(hiddendata.type,hiddendata.data))
|
||||||
|
|||||||
+10
-3
@@ -40,8 +40,9 @@
|
|||||||
|
|
||||||
"color":"gray",
|
"color":"gray",
|
||||||
"adminroles":["role id"],
|
"adminroles":["role id"],
|
||||||
|
"readonlyAdminroles":["role id"],
|
||||||
"channelprefix":"question-",
|
"channelprefix":"question-",
|
||||||
"category":"category id",
|
"category":"category id (or leave empty)",
|
||||||
"message":"You created a ticket!",
|
"message":"You created a ticket!",
|
||||||
"enableDmOnOpen":true,
|
"enableDmOnOpen":true,
|
||||||
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*",
|
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*",
|
||||||
@@ -101,11 +102,17 @@
|
|||||||
"dropdown":false,
|
"dropdown":false,
|
||||||
|
|
||||||
"enableFooter":false,
|
"enableFooter":false,
|
||||||
"footer":"Open Ticket v3.3.1 - I'm a footer!",
|
"footer":"Open Ticket v3.3.3 - I'm a footer!",
|
||||||
|
|
||||||
|
"enableFooterImage":false,
|
||||||
|
"footerImage":"https://www.example.com/catmemes/cat.png",
|
||||||
|
|
||||||
"enableThumbnail":false,
|
"enableThumbnail":false,
|
||||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||||
|
|
||||||
|
"enableImage":false,
|
||||||
|
"image":"https://www.example.com/catmemes/cat.png",
|
||||||
|
|
||||||
"enableCustomColor":false,
|
"enableCustomColor":false,
|
||||||
"color":"#ffffff",
|
"color":"#ffffff",
|
||||||
|
|
||||||
@@ -130,4 +137,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ module.exports = () => {
|
|||||||
}else{
|
}else{
|
||||||
firstmsg.edit({components:[bot.buttons.firstmsg.firstmsgRowNormalNoClaim],embeds:[newEmbed]})
|
firstmsg.edit({components:[bot.buttons.firstmsg.firstmsgRowNormalNoClaim],embeds:[newEmbed]})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interaction.channel.send({embeds:[bot.embeds.commands.claimEmbed(interaction.user,interaction.user)]})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ module.exports = () => {
|
|||||||
if (interaction.customId != "OTcloseTicketTrue") return
|
if (interaction.customId != "OTcloseTicketTrue") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
|
|
||||||
if (closeTicketButtonChecker == true) return
|
if (closeTicketButtonChecker == true) return
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicketTrue") return
|
if (interaction.customId != "OTdeleteTicketTrue") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
|
|
||||||
if (deleteTicketButtonChecker == true) return
|
if (deleteTicketButtonChecker == true) return
|
||||||
deleteTicketButtonChecker = true
|
deleteTicketButtonChecker = true
|
||||||
@@ -62,7 +62,7 @@ module.exports = () => {
|
|||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicketTrue1") return
|
if (interaction.customId != "OTdeleteTicketTrue1") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
|
|
||||||
if (deleteTicketButtonChecker1 == true) return
|
if (deleteTicketButtonChecker1 == true) return
|
||||||
deleteTicketButtonChecker1 = true
|
deleteTicketButtonChecker1 = true
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ const bs = discord.ButtonStyle
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
//REOPEN
|
//REOPEN
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",async (interaction) => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTreopenTicket") return
|
if (interaction.customId != "OTreopenTicket") return
|
||||||
|
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
||||||
require("../../../ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
require("../../../ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -16,22 +16,22 @@ const bs = discord.ButtonStyle
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
//CLOSE
|
//CLOSE
|
||||||
client.on("interactionCreate",interaction => {
|
client.on("interactionCreate",async interaction => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTcloseTicket") return
|
if (interaction.customId != "OTcloseTicket") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
||||||
|
|
||||||
})
|
})
|
||||||
client.on("interactionCreate",interaction => {
|
client.on("interactionCreate",async interaction => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTcloseTicketFalse") return
|
if (interaction.customId != "OTcloseTicketFalse") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
|
|
||||||
if (interaction.message.pinned && interaction.message.author.id == client.user.id){
|
if (interaction.message.pinned && interaction.message.author.id == client.user.id){
|
||||||
@@ -47,22 +47,22 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
//DELETE
|
//DELETE
|
||||||
client.on("interactionCreate",interaction => {
|
client.on("interactionCreate",async interaction => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicket") return
|
if (interaction.customId != "OTdeleteTicket") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
||||||
|
|
||||||
})
|
})
|
||||||
client.on("interactionCreate",interaction => {
|
client.on("interactionCreate",async interaction => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicketFalse") return
|
if (interaction.customId != "OTdeleteTicketFalse") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
|
|
||||||
if (interaction.message.pinned && interaction.message.author.id == client.user.id){
|
if (interaction.message.pinned && interaction.message.author.id == client.user.id){
|
||||||
@@ -78,22 +78,22 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
//DELETE NO TRANSCRIPT
|
//DELETE NO TRANSCRIPT
|
||||||
client.on("interactionCreate",interaction => {
|
client.on("interactionCreate",async interaction => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicket1") return
|
if (interaction.customId != "OTdeleteTicket1") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
||||||
|
|
||||||
})
|
})
|
||||||
client.on("interactionCreate",interaction => {
|
client.on("interactionCreate",async interaction => {
|
||||||
if (!interaction.isButton()) return
|
if (!interaction.isButton()) return
|
||||||
if (interaction.customId != "OTdeleteTicketFalse1") return
|
if (interaction.customId != "OTdeleteTicketFalse1") return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const APIEvents = require("./api/modules/events")
|
|||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
const chalk = await (await import("chalk")).default
|
const chalk = await (await import("chalk")).default
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",async (interaction) => {
|
||||||
if (!interaction.isButton() && !interaction.isStringSelectMenu()) return
|
if (!interaction.isButton() && !interaction.isStringSelectMenu()) return
|
||||||
if (interaction.isButton() && !interaction.customId.startsWith("newR")) return
|
if (interaction.isButton() && !interaction.customId.startsWith("newR")) return
|
||||||
if (interaction.isStringSelectMenu() && !(interaction.customId == "OTdropdownMenu")) return
|
if (interaction.isStringSelectMenu() && !(interaction.customId == "OTdropdownMenu")) return
|
||||||
@@ -32,7 +32,7 @@ module.exports = async () => {
|
|||||||
return
|
return
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
} catch{}
|
} catch{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,12 @@ const storage = bot.storage
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
//dropdown placeholder
|
//dropdown placeholder
|
||||||
client.on("interactionCreate",(interaction) => {
|
client.on("interactionCreate",async (interaction) => {
|
||||||
if (!interaction.isStringSelectMenu()) return
|
if (!interaction.isStringSelectMenu()) return
|
||||||
if (interaction.customId != "OTdropdownMenu") return
|
if (interaction.customId != "OTdropdownMenu") return
|
||||||
if (interaction.values.includes("OTChooseTicket")){
|
if (interaction.values.includes("OTChooseTicket")){
|
||||||
interaction.deferUpdate()
|
await interaction.deferUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +36,7 @@ module.exports = () => {
|
|||||||
if (interaction.customId.startsWith("OTnewT")){
|
if (interaction.customId.startsWith("OTnewT")){
|
||||||
const optionid = interaction.customId.split("OTnewT")[1]
|
const optionid = interaction.customId.split("OTnewT")[1]
|
||||||
if (!optionid){
|
if (!optionid){
|
||||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
await interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,12 +47,11 @@ module.exports = () => {
|
|||||||
|
|
||||||
//ticketoptions from config
|
//ticketoptions from config
|
||||||
const currentTicketOptions = configParser.getTicketById(customId)
|
const currentTicketOptions = configParser.getTicketById(customId)
|
||||||
|
|
||||||
if (currentTicketOptions == false) return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
if (currentTicketOptions == false) return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
||||||
|
|
||||||
if (interaction.isButton()){
|
if (interaction.isButton()){
|
||||||
try {
|
try {
|
||||||
if (config.system.answerInEphemeralOnOpen) await interaction.deferReply({ephemeral:true})
|
await interaction.deferReply({ephemeral:config.system.answerInEphemeralOnOpen})
|
||||||
} catch{}
|
} catch{}
|
||||||
}else if (interaction.isChatInputCommand()){
|
}else if (interaction.isChatInputCommand()){
|
||||||
await interaction.deferReply({ephemeral:config.system.answerInEphemeralOnOpen})
|
await interaction.deferReply({ephemeral:config.system.answerInEphemeralOnOpen})
|
||||||
@@ -110,9 +108,7 @@ module.exports = () => {
|
|||||||
type:"role",
|
type:"role",
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
})
|
})
|
||||||
}catch{
|
}catch{}
|
||||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
//add ticket adminroles
|
//add ticket adminroles
|
||||||
@@ -131,9 +127,28 @@ module.exports = () => {
|
|||||||
type:"role",
|
type:"role",
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
||||||
})
|
})
|
||||||
}catch{
|
}catch{}
|
||||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
}
|
||||||
}
|
})
|
||||||
|
|
||||||
|
//add ticket adminroles
|
||||||
|
/**
|
||||||
|
* @type {String[]}
|
||||||
|
*/
|
||||||
|
const readonlyTicketadmin = currentTicketOptions.readonlyAdminroles
|
||||||
|
readonlyTicketadmin.forEach((role,index) => {
|
||||||
|
if (!config.adminRoles.includes(role) && !currentTicketOptions.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.ViewChannel],
|
||||||
|
deny:[pfb.SendMessages,pfb.AttachFiles,pfb.EmbedLinks]
|
||||||
|
})
|
||||||
|
}catch{}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -148,9 +163,7 @@ module.exports = () => {
|
|||||||
deny:[pfb.ViewChannel]
|
deny:[pfb.ViewChannel]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}catch{
|
}catch{}
|
||||||
log("system","invalid role! At 'config.json => system/memberRole")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//create the channel
|
//create the channel
|
||||||
@@ -166,7 +179,7 @@ module.exports = () => {
|
|||||||
if (currentTicketOptions.autoclose.enable) storage.set("autocloseTickets",ticketChannel.id,currentTicketOptions.autoclose.inactiveHours)
|
if (currentTicketOptions.autoclose.enable) storage.set("autocloseTickets",ticketChannel.id,currentTicketOptions.autoclose.inactiveHours)
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData.writeHiddenData("ticketdata",[{key:"type",value:currentTicketOptions.id},{key:"openerid",value:interaction.user.id},{key:"createdms",value:new Date().getTime()}])
|
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()
|
var ticketEmbed = new discord.EmbedBuilder()
|
||||||
//.setAuthor({name:interaction.user.id})
|
//.setAuthor({name:interaction.user.id})
|
||||||
.setColor(config.color)
|
.setColor(config.color)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version":"1.0.0",
|
"version":"1.0.0",
|
||||||
"otversion":"3.3.1",
|
"otversion":"3.3.3",
|
||||||
"style":{
|
"style":{
|
||||||
"enableCustomBackground":false,
|
"enableCustomBackground":false,
|
||||||
"backgroundModus":"color OR image",
|
"backgroundModus":"color OR image",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const l = bot.language
|
|||||||
//==================
|
//==================
|
||||||
|
|
||||||
//OTTicketOptions
|
//OTTicketOptions
|
||||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color: "red"|"green"|"blue"|"gray",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, image:{enable:Boolean,url:String}, closedCategory:{enable:Boolean,id:String}, autoclose:{enable:Boolean,inactiveHours:Number} }} OTTicketOptions */
|
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color: "red"|"green"|"blue"|"gray",adminroles: String[], readonlyAdminroles: String[], channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, image:{enable:Boolean,url:String}, closedCategory:{enable:Boolean,id:String}, autoclose:{enable:Boolean,inactiveHours:Number} }} OTTicketOptions */
|
||||||
|
|
||||||
//OTRoleOptions
|
//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 */
|
/**@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 */
|
||||||
@@ -16,13 +16,13 @@ const l = bot.language
|
|||||||
|
|
||||||
|
|
||||||
//OTConfigMessage
|
//OTConfigMessage
|
||||||
/**@typedef {{id: string, name: string, description: string, dropdown: boolean, enableFooter: boolean, footer: string, enableThumbnail: boolean, thumbnail: string, enableCustomColor: boolean, color: string, options: string[], other:{enableTicketExplaination: boolean, enableMaxTicketsWarning: boolean, customDropdownPlaceholder:{enable:Boolean,text:String}, customCategoryText:{enable:Boolean,text:String}, embedTitleURL:{enable:Boolean,url:String} } }} OTConfigMessage*/
|
/**@typedef {{id: string, name: string, description: string, dropdown: boolean, enableFooter: boolean, footer: string, enableFooterImage: boolean, footerImage: string, enableThumbnail: boolean, thumbnail: string, enableImage: boolean, image: string, enableCustomColor: boolean, color: string, options: string[], other:{enableTicketExplaination: boolean, enableMaxTicketsWarning: boolean, customDropdownPlaceholder:{enable:Boolean,text:String}, customCategoryText:{enable:Boolean,text:String}, embedTitleURL:{enable:Boolean,url:String} } }} OTConfigMessage*/
|
||||||
|
|
||||||
//OTAllOptions
|
//OTAllOptions
|
||||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, image:{enable:Boolean,url:String}, url:String, closedCategory:{enable:Boolean,id:String}, autoclose:{enable:Boolean,inactiveHours:Number}}} OTAllOptions */
|
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, image:{enable:Boolean,url:String}, url:String, closedCategory:{enable:Boolean,id:String}, autoclose:{enable:Boolean,inactiveHours:Number}, readonlyAdminroles: String[]}} OTAllOptions */
|
||||||
|
|
||||||
//StringOptions
|
//StringOptions
|
||||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDmOnOpen"|"ticketmessage"|"thumbnail"|"image"|"closedCategory"} OTTicketStringOptions */
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDmOnOpen"|"ticketmessage"|"thumbnail"|"image"|"closedCategory"|"adminroles"|"autoclose"} OTTicketStringOptions */
|
||||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDmOnOpen"} OTRoleStringOptions */
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDmOnOpen"} OTRoleStringOptions */
|
||||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} OTWebsiteStringOptions */
|
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} OTWebsiteStringOptions */
|
||||||
|
|
||||||
|
|||||||
+16
-2
@@ -40,11 +40,25 @@ exports.createEmbed = (id) => {
|
|||||||
//create the embed
|
//create the embed
|
||||||
const embed = new discord.EmbedBuilder()
|
const embed = new discord.EmbedBuilder()
|
||||||
.setTitle(data.name)
|
.setTitle(data.name)
|
||||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
|
||||||
|
try {
|
||||||
|
const footerimg = (data.enableFooter && data.enableFooterImage) ? data.footerImage : undefined
|
||||||
|
if (data.enableFooter) embed.setFooter({text:data.footer,iconURL:footerimg})
|
||||||
|
}catch{
|
||||||
|
bot.errorLog.log("info","FOOTER FAILED TO LOAD, probably invalid url!")
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
||||||
}catch{bot.errorLog.log("info","THUMBNAIL FAILED TO LOAD, probably invalid url!")}
|
}catch{
|
||||||
|
bot.errorLog.log("info","THUMBNAIL FAILED TO LOAD, probably invalid url!")
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (data.enableImage) embed.setImage(data.image)
|
||||||
|
}catch{
|
||||||
|
bot.errorLog.log("info","IMAGE FAILED TO LOAD, probably invalid url!")
|
||||||
|
}
|
||||||
|
|
||||||
if (data.enableCustomColor){
|
if (data.enableCustomColor){
|
||||||
embed.setColor(data.color)
|
embed.setColor(data.color)
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
exports.readHiddenData = (messageContent) => {
|
exports.readHiddenData = (messageContent) => {
|
||||||
//ticketdata//type:123|userid:456)
|
//ticketdata//type:123|userid:456)
|
||||||
if (!messageContent.includes("[ ](OTDATA|")) return {type:"",data:[],status:false}
|
if (!messageContent.includes("[ ](https://OTDATA|")) return {type:"",data:[],status:false}
|
||||||
const rawhidden = messageContent.split("[ ](OTDATA|")[1]
|
const rawhidden = messageContent.split("[ ](https://OTDATA|")[1]
|
||||||
const rawhidden2 = rawhidden.split("//")
|
const rawhidden2 = rawhidden.split("//")
|
||||||
|
|
||||||
const datatype = rawhidden2[0]
|
const datatype = rawhidden2[0]
|
||||||
@@ -47,7 +47,7 @@ exports.writeHiddenData = (type,data) => {
|
|||||||
|
|
||||||
const datastring = dataValues.join("|")
|
const datastring = dataValues.join("|")
|
||||||
|
|
||||||
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
const result = "[ ](https://OTDATA|"+type+"//"+datastring+")"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
@@ -58,10 +58,10 @@ exports.writeHiddenData = (type,data) => {
|
|||||||
* @returns {{description:String,hiddenData:hiddenData}}
|
* @returns {{description:String,hiddenData:hiddenData}}
|
||||||
*/
|
*/
|
||||||
exports.removeHiddenData = (description) => {
|
exports.removeHiddenData = (description) => {
|
||||||
if (!description.includes("[ ](OTDATA|")) return {description:description,hiddenData:[]}
|
if (!description.includes("[ ](https://OTDATA|")) return {description:description,hiddenData:[]}
|
||||||
|
|
||||||
const hiddenData = this.readHiddenData(description)
|
const hiddenData = this.readHiddenData(description)
|
||||||
const splitted = description.split("[ ](OTDATA")
|
const splitted = description.split("[ ](https://OTDATA")
|
||||||
const original = splitted[0]
|
const original = splitted[0]
|
||||||
|
|
||||||
return {description:original,hiddenData:hiddenData}
|
return {description:original,hiddenData:hiddenData}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
INFORMATION:
|
INFORMATION:
|
||||||
============
|
============
|
||||||
Open Ticket v3.3.1 - © DJdj Development
|
Open Ticket v3.3.3 - © DJdj Development
|
||||||
|
|
||||||
discord: https://discord.dj-dj.be
|
discord: https://discord.dj-dj.be
|
||||||
website: https://www.dj-dj.be
|
website: https://www.dj-dj.be
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "open-ticket",
|
"name": "open-ticket",
|
||||||
"version": "3.3.1",
|
"version": "3.3.3",
|
||||||
"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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user