Draechen
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
Thank you for all the help, I've come across a workaround by converting the message into an embed, that works for what I need, and I'll just chalk this up to ... ghosts or something. I sincerely appreciate all the time and effort of everyone giving me a helping hand.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
So, I'd like to hopefully restate the problem with more information, and see if it helps to clarify where I'm at.
What reason can anyone think of, that this would work:
and this would post the message in the channel, then the bot would go offline.
Just to assuage fears of values being empty, unassigned or anything else, here is the log of the message variable (in the case where the message fails.
Message variable type string: Message content "LCI draft (3 minutes remaining) - 2 drafters not ready sarkhan6590 draechen"The underlying code is the exact same thing for both messages, one works, and one does not.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
if I send message as is, it hangs and disconnects
if I change nothing else in the code, other than:
if works fine. So I don't understand what the difference is. I tested each of the variables I'm putting in the message and they're all strings, with values.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
That all said, every minute, this function is called:
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
That's the whole function, it gets called every minute, checking the queue in the database to see if the number of voters has been met
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
I don't know what you want me to give you, tbh. I'm sorry for not answering the questions better?
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
.format is also in the query.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
voteStatus is the return from a query to the postgres db. and voteStatus.usersNotReady is an array of usernames
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
What should I be looking out for there then? Everything I'm putting in the message variable is a string. Why would one string cause the bot to crash, but not the other?
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
There weren’t any errors in the pm2 logs either. Is there something I’m doing wrong with just sending a message to a channel? I still don’t understand why sending a simple few words works fine, but the other messages don’t.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
I can reproduce it every time now, in the code above. But I start my bot in production with pm2, my dev bot is just running in a command line instance local to my pc.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
Okay, this is blowing my mind a little bit, but it's working now, with one caveat. The places where the bot got disconnected, it was because of the content of the message?
For example, the clearing users not ready part. It started working when I switched:
to
The same thing with the voters not ready count down (the 5 minute timers) I switched:
to:
and it all works. I have no idea why the message content is breaking it.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
No change in the output in the console. Same 15ish minute pause before it comes back online.
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
Will do!
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
================ Rechecking for active channels (Tuesday, Nov 14, 2023, 10:31 AM) ================ ================ Rechecking for active channels (Tuesday, Nov 14, 2023, 10:31 AM) ================ Hey! 🔥-pod-vote-coordination(1110947498685649046) is no longer active! Readycheck result: false 1/2 Got: false from isvoteReady function [WS => Shard 0] Destroying shard Reason: Got disconnected by Discord Code: 1000 Recover: Reconnect [WS => Shard 0] Connection status during destroy Needs closing: false Ready state: 3 [WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json [WS => Shard 0] Waiting for event hello for 60000ms [WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.5097057277951755; waiting 21025ms [WS => Shard 0] Waiting for identify throttle [WS => Shard 0] Identifying shard id: 0 shard count: 1 intents: 38403 compression: none [WS => Shard 0] Waiting for event ready for 15000ms [WS => Shard 0] Shard received all its guilds. Marking as fully ready. Nope, skipping bot message
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
<here's where the pause occurs>
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
================ Rechecking for active channels (Tuesday, Nov 14, 2023, 10:15 AM) ================ ================ Rechecking for active channels (Tuesday, Nov 14, 2023, 10:15 AM) ================ pod-vote-coordination(1110947498685649046) [voteWhosMissing] Sending 3rd who's missing [isvoteReady] Checking if lci is ready! [voteReady] sending query...SELECT * FROM vote WHERE format = $1; Readycheck result: false 1/2 Got: false from isvoteReady function Nope, skipping bot message [voteWhosMissing] Sending 2nd who's missing [isvoteReady] Checking if lci is ready! [voteReady] sending query...SELECT * FROM vote WHERE format = $1; Readycheck result: false 1/2 Got: false from isvoteReady function Nope, skipping bot message [WS => Shard 0] Heartbeat acknowledged, latency of 34ms. ================ Rechecking for active channels (Tuesday, Nov 14, 2023, 10:16 AM) ================ ================ Rechecking for active channels (Tuesday, Nov 14, 2023, 10:16 AM) ================ pod-vote-coordination(1110947498685649046) [WS => Shard 0] Heartbeat acknowledged, latency of 28ms. [isvoteReady] Checking if lci is ready! [voteReady] sending query...SELECT * FROM vote WHERE format = $1; Readycheck result: false 1/2 [RemoveUsers]Sending query DELETE FROM vote WHERE format = $1 and status != 'ready' with lci [votestatusMessage]Sending query..." SELECT setcode, (SELECT CASE WHEN EXISTS ( SELECT COUNT(discordname) FROM vote WHERE lower(format) = lower(dr.setcode)) THEN (SELECT COUNT(discordname) FROM vote WHERE lower(format) = lower(dr.setcode)) ELSE 0 End as queuecount UNION ALL SELECT 0 WHERE NOT EXISTS (SELECT COUNT(discordname) FROM vote WHERE lower(format) = lower(dr.setcode)) ) FROM voteformat dr WHERE active = true with undefined Nope, skipping bot message
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
(as a precursor I haven't strict-moded the other two files, just the votecommands)
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
Here's the full file:
draebot.js - https://sourceb.in/qfLtkyu6xR
voteCommands.js -https://sourceb.in/nEaiLuV0sj
db.js - https://sourceb.in/LbBNNRrNXX
45 replies
DIAdiscord.js - Imagine an app
•Created by Draechen on 11/6/2023 in #djs-questions
Bot crashing without any errors
BTW thank you so much for your patience and help as I stumble through all this
45 replies