You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
while i delete a giveaway from the command provided in the docs :
client.on('interactionCreate',(interaction)=>{if(interaction.isCommand()&&interaction.commandName==='delete'){constmessageId=interaction.options.getString('message_id');client.giveawaysManager.delete(messageId).then(()=>{interaction.channel.send('Success! Giveaway deleted!');}).catch((err)=>{interaction.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);});}});
the deletion leave some random chars on the json Error before the delete
after the delete : 0377088>"} is the random To Reproduce
create a giveaway, then delete it check the json file you will see the error Expected behavior
complete removal of the giveaway without the random chars. Additional context
discord-giveaways version: 5.1.1
discord.js version: 13.6.0
Custom Database (if you use one):
The text was updated successfully, but these errors were encountered:
json unfortunately is a little prone to such "glitches", at least since because of giveaways a lot of stuff has to be saved.
For now it is just recommended to try to fix the "glitch" by yourself/switch to a more reliable db (examples folder).
More for open discussion than an actual proposing:
I read some articles, which lightly suggest imo, that it can occur when the writing of the file does not happen in an orderly fashion, and so conflicts/"glitches" happen cause "two writeFile executions don't wait for one another"/the amount of write requests is to "high"/isn't processed in copletely correct order.
Tho correct me on that if i'm interpreting stuff wrong.
(and ik we are using promises for writeFile already, but idk if it still can happen even with that)
I thought of maybe implementing some kind of "writeTask" array, or maybe using timestamps for the requests or smth in order to reduce the load/make it more orderly.
but i'm really to expert at smth like thinking that stuff out logically, so if anyone is knowing a solution which has provenness, then please feel free to suggest.
btw if needed, feel free to ask me to make this a github discussion
Describe the bug
while i delete a giveaway from the command provided in the docs :
the deletion leave some random chars on the json
Error before the delete
after the delete :
0377088>"}
is the randomTo Reproduce
create a giveaway, then delete it check the json file you will see the error
Expected behavior
complete removal of the giveaway without the random chars.
Additional context
discord-giveaways
version: 5.1.1discord.js
version: 13.6.0The text was updated successfully, but these errors were encountered: