v3.3.1 push 3 (autoclose spam fix)

This commit is contained in:
DJj123dj
2023-03-21 19:49:12 +01:00
parent 4287c11bf1
commit 0ead037fa8
7 changed files with 64 additions and 42 deletions
+2 -2
View File
@@ -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">
[![discord](https://img.shields.io/badge/discord-join%20our%20server-5865F2.svg?style=flat-square&logo=discord)](https://discord.com/invite/26vT9wt3n3) [![version](https://img.shields.io/badge/version-3.3.0-brightgreen.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/releases/tag/v3.3.0) [![discord.js](https://img.shields.io/badge/discord.js-v14-CB3837.svg?style=flat-square&logo=npm)]() [![license](https://img.shields.io/badge/license-GPL%203.0-important.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [![stars](https://img.shields.io/github/stars/djj123dj/open-ticket?color=yellow&label=stars&logo=github&style=flat-square)](https://docs.openticket.dj-dj.be)
[![discord](https://img.shields.io/badge/discord-join%20our%20server-5865F2.svg?style=flat-square&logo=discord)](https://discord.com/invite/26vT9wt3n3) [![version](https://img.shields.io/badge/version-3.3.1-brightgreen.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/releases/tag/v3.3.1) [![discord.js](https://img.shields.io/badge/discord.js-v14-CB3837.svg?style=flat-square&logo=npm)]() [![license](https://img.shields.io/badge/license-GPL%203.0-important.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [![stars](https://img.shields.io/github/stars/djj123dj/open-ticket?color=yellow&label=stars&logo=github&style=flat-square)](https://docs.openticket.dj-dj.be)
### Open Ticket
Open Ticket is of the most customisable discord ticket bots of all time!
@@ -62,7 +62,7 @@ Translators
|Slovenian |n1kkec#5341 |
## links
current version: _v3.3.0_
current version: _v3.3.1_
</br>changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
</br>documentation: [click here](https://docs.openticket.dj-dj.be/quick-start)
+1 -1
View File
@@ -101,7 +101,7 @@
"dropdown":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,
"thumbnail":"https://www.example.com/catmemes/cat.png",
+9 -2
View File
@@ -8,10 +8,13 @@ const storage = bot.storage
module.exports = () => {
setInterval(async () => {
try{
const tickets = storage.getCategory("autocloseTickets")
if (!tickets) return
tickets.forEach(async (t) => {
if (t.value == "false" || t.value == 0 || typeof t.value != "number") return
try{
const channel = await client.channels.fetch(t.key,{cache:true})
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]})
}
})
},2000)
}catch{
log("system","can't find autoclose channel with ID: "+t.key)
}
})
}catch{}
},120000)
}
@@ -1,6 +1,6 @@
{
"version":"1.0.0",
"otversion":"3.3.0",
"otversion":"3.3.1",
"style":{
"enableCustomBackground":false,
"backgroundModus":"color OR image",
+18 -3
View File
@@ -136,6 +136,9 @@ exports.run = async (pluginData) => {
console.log(final.join("\n\n"))
}
var waitTime = new Date().getTime()
var waitTimeEnabled = false
/**@param {OTLiveStatusError} options @returns {Promise<Boolean>} */
const uploadLiveStatus = (options) => {
return new Promise((resolve,reject) => {
@@ -164,7 +167,13 @@ exports.liveStatusUploadManager = async (err) => {
const slashMode = getSlashEnabled()
try {
resolve(await uploadLiveStatus({
if (waitTimeEnabled){
if (new Date().getTime() < waitTime){
waitTimeEnabled = false
return resolve(false)
}
}
const result = await uploadLiveStatus({
bot:{
id:client.user.id,
name:client.user.tag,
@@ -187,9 +196,15 @@ exports.liveStatusUploadManager = async (err) => {
},
details:{
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)}
}
})
+1 -1
View File
@@ -28,7 +28,7 @@
INFORMATION:
============
Open Ticket v3.3.0 - © DJdj Development
Open Ticket v3.3.1 - © DJdj Development
discord: https://discord.dj-dj.be
website: https://www.dj-dj.be
+1 -1
View File
@@ -1,6 +1,6 @@
{
"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.",
"main": "index.js",
"scripts": {