webhooks again

Hello dear fellow helpers... i would like to ask another question related to it Context A while back I learnt about webhooks and their usage thanks to yall... I had already tried using internet but without the proper implementation and understanding...which became possible thanks to djs community and bots I was able to understand the underlying concept... Previous webhooks convo The concepts i learnt were - Webhooks are given by d.js api for discord interface - You can only send messages to discord but not the opposite (like sending discord messages to another app) Problem This time it is a bit technical and practical... I am running the bot on self host... by due to some unphortunate events...some instances of bot just crashes due to timeout error while others keep working as intended... idk what is the reason of their failure but it caused me some lost db updates... for instance my Xp system crashed due to it and i lost the progress of peeps who Interacted with the bot previously as well as the conversations happened during that time... Mitigation To mitigate this problem I have few other solutions but idk how to implement them or if they are even possible * hosting it on a vps or other commercial hosts thats a NO due to some privacy and development reasons * running another instance of a different bot that will run as backup for the 1st one and synchronise it when one of them gets available * using something as reverse webhooks to log events that happened when the bot was offline so i could update the bot... even tho the time has passed the events would be updated and hence will show the results...after it will come online.. * Logging is another different thing and something that is not related to what i want
8 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
dragonn
dragonn12mo ago
Question
* using something as reverse webhooks to log events that happened when the bot was offline so i could update the bot... even tho the time has passed the events would be updated and hence will show the results...after it will come online..
Is it possible to do such a thing as reverse webhooking the events... similar to kinda running a reverse shell in linux... or should i use get webhook method to retrieve the lost info... also is it possible to get deleted messages that happened while the bot was sleeping or crashed for mod logs So basically events are native to discord app while webhooks are only to be fetched by bot and not natively... I also want a suggestion on what to do to mitigate this problem... in a case where bot crashes and i am unable to log events that have passed while it happened
Parogo_72
Parogo_7212mo ago
Just dont make your bot crash There isnt any fix apart from not disconnecting your bot
dragonn
dragonn12mo ago
Well thats not a solution My error from such unexpected crashes is Code: UND_ERR CONNECT_TIMEOUT Which is happening frequently on just one file... others are working good... Even if i am able to solve it...that is not what i asķed...tho help is always appreciated
Parogo_72
Parogo_7212mo ago
I also pointed out that there isnt any other fix You cant get data that was already sent
dragonn
dragonn12mo ago
This thing isn't optional... i have to get around this problem... Either creating another silent instance of bot on a vps or might be a different bot altogether... idk how big peeps in companies do to avoid such a thing... unexpected internet, database crashes from server-client side can happen but still thank you...i appreciate
Parogo_72
Parogo_7212mo ago
Perhaps I didnt explain myself properly. There is no way to do what you are asking Either your bot is online to receive the events, or you give up and dont receive them If your main bot crashes how will that make sure that your "silent" one doesnt crash?
dragonn
dragonn12mo ago
Nah mate.. i understood u previously and now... u do have a point but i am asking a better suggestion... it is quite obvious without monitoring them i cant make sure what events happened behind the scenes.. and not just main if anyone of them or both crashes...the data is lost... i gotcha... I know the options are limited but thats why my options came... to duplicate their instances or creation...in this case i only have limited availability of solutions - Choose a good premium vps but it is unphortunately not allowed due to privacy reasons - increase the hardware resources and upgrading bandwidth a costly solution to a minor problem Idk if the big bots like mee6 and yag are self hosted... but they must have came through this typa problem and have mitigated it... i also have previously done sql clustering to avoid database failures... it was damn costly.. This problem needs a creative solution.. Tho i am not sure... if u have any advice/suggestion/mad solution in this regard...u r welcomed... otherwise u can close the topic...i understand i am out of options on this one..Thanks for the help tho U can say I am not allowed to do such a thing atleast on the developmental stages I mean until it gets to production i can't help myself on that... also the thing we re doing is mostly related to hardware and we perform commanding mostly on our isolated environments so it is kinda safe for now... but getting disconnected and loss of data is one thing we re here to mitigate... once put in production we may or may not invest in a dedicated server... coz if this problem persists then it is of no use...
Want results from more Discord servers?
Add your server