aoijs / aoi.js

aoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
https://aoi.js.org
Apache License 2.0
329 stars 130 forks source link

Bug: Timeouts are bugged #616

Closed tavaresmp4 closed 3 weeks ago

tavaresmp4 commented 2 months ago

Bug Type

Function

Bugged Function

... , {
    type: 'interaction',
    prototype: 'button',
    code: `
$interactionReply[${Emojis.Raio}|Caçada **rápida** iniciada! Em \`30 minutos\` você pode usar esse comando de novo e resgatar sua recompensa.;;true]

$editMessage[$interactionData[message.id];{newEmbed:
    {title:$ifAwaited[$getGlobalUserVar[userHuntType]==1;${Emojis.Raio};${Emojis.Barco}]|Caçada em andamento...}
    {description:> Você tem uma caçada **$ifAwaited[$getGlobalUserVar[userHuntType]==1;rápida;longa]** em andamento, volte <t:$truncate[$divide[$getGlobalUserVar[cooldownHunt;$authorID];1000]]:R>!}
    {color:${Cores.Amarelo}}
}{actionRow:
    {button:Ativar lembrete:secondary:huntReminder_$advancedTextSplit[$interactionData[customId];_;2]_$sum[$datestamp;600000]:false:1249838446688731188}
}]

$setTimeout[fastHuntTimeout;1800000;{ "authorID": "$interactionData[author.id]" }]

$setGlobalUserVar[userHuntType;1;$interactionData[author.id]]
$setGlobalUserVar[cooldownHunt;$sum[$datestamp;1800000];$interactionData[author.id]]

$onlyIf[$advancedTextSplit[$interactionData[customId];_;2]==$interactionData[author.id];${Emojis.KiaraRaiva}|Meow! Você não pode usar esse botão! Somente <@$advancedTextSplit[$interactionData[customId];_;2]> pode usar isso!{interaction}{ephemeral}]
$onlyIf[$advancedTextSplit[$interactionData[customId];_;3]>=$datestamp;${Emojis.KiaraSeiLa}|Parece que os dados dessa interação não existem mais. Eu não comi eles! Eu acho...{interaction}{ephemeral}]
$onlyIf[$advancedTextSplit[$interactionData[customId];_;1]==fastHunt;]
    `
}, {
    name: 'fastHuntTimeout',
    type: 'timeout',
    code: `
$setGlobalUserVar[hasHuntReward;true;$timeoutData[authorID]]
    `
} ...

Version of aoi.js

v6.8.0

Version of Node.js

v20.10.0 (LTS)

Excepted Output

VERSION:

What happend:

Relevant log output

Any error on console or chat

Code of Conduct

USERSATOSHI commented 2 months ago

so it didn't set value to true 30 mins??

tavaresmp4 commented 2 months ago

so it didn't set value to true 30 mins??

yeah, if i restart the bot the timeout dont execute, but if i dont restart it work, so timeouts are broken again...

atlasfyber commented 2 months ago

I can confirm, if you restart the bot, then previous timeouts never execute, although you can find the on the database as usual. I also use Mongo (once again)

Mody-0 commented 2 months ago

Yeah, also aoi.db is too slow that even interactions now fail to work cause it takes too much time to get var values

Mody-0 commented 2 months ago

And my database got corrupted all of a sudden.. image image

atlasfyber commented 2 months ago

That's how json works, try switch to mongo, also I think it's off topic for this issue

LaurensTheDev commented 2 months ago

yeah, if i restart the bot the timeout dont execute, but if i dont restart it work, so timeouts are broken again...

i can confirm as well

Faf4a commented 1 month ago

Does this still happen in the dev version?

atlasfyber commented 1 month ago

Does this still happen in the dev version?

It's not working on stable version 6.8, is it fixed on dev? Should I try it on dev?

Faf4a commented 1 month ago

i can't reproduce this at all, so no clue

atlasfyber commented 1 month ago

i can't reproduce this at all, so no clue

Github version or npm (stable)?

Faf4a commented 1 month ago

stable, 6.8.5, works fine for me

Leref commented 3 weeks ago

Seems solved.