Fozzie
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Sorry, pretty busy atm so I won't be able to spend time on it for another week or so
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Will do, had a brief try yesterday with the unloadAll / clear but it didn't work
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
I guess you could regenerate your token every time you started a new instance, although not sure if there's an API method for that!
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
I did come across this serenity issue which suggests that there is not https://github.com/serenity-rs/serenity/issues/1054
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Unless there is an API method to do that that I don't know about?
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
This could also be avoided if the Discord API just cut off any previous clients when a new one logged in ¯\_(ツ)_/¯
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Yeah, I was just looking through the code, I imagine the issue is somewhere like
container.stores.loadPiece
where it's already loaded26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Yeah I'll have a play around tomorrow. I appreciate your pointers, sounds like a fun weekend project for me 😂
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Fair enough, I did see message events going through, so it does seem to just be that
ApplicationCommandRegistries
initialisation.26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
I appreciate you going through that, that's certainly a much better design. I do wonder how it would handle Kubernetes node failures though if you're limited to the single pod with the API connector. Especially if this is a StatefulSet which I imagine it would be to avoid concurrency issues, then Kubernetes wouldn't automatically reschedule those in the event of node failures. Edit: I guess this might be fine actually, if you just have 3 replicas and load balance messages across them all.
I 100% understand that my solution is a hack (I think all mutexes / locks / elections like these are), but at 20 lines which kinda does work (aside from the applications issue) and with my limited experience of the Discord API, I think it would handle Kubernetes node failures fine. Obviously yours would definitely be better, but I don't have the experience to even attempt that right now.
Is it by design that Sapphire doesn't support re-logging in with the application commands? If not I'm happy to take a look at the repo when I have time to see if it can be solved.
26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 8/9/2024 in #sapphire-support
Issue with application commands after logging in after client#destroy()
Admittedly it is a strange one, and a concept I haven't yet gotten working so it's still all in theory! I want to set up 3 replicas in Kubernetes, but obviously don't want to run 3 instances at the same time. Sharding won't work for me because it's a bot in a single guild. I am trying to setup an election concept where a pod is designated as a "leader". This pod may be demoted and re-promoted many times, hence the
destroy
and the login
. I could just process.exit
when it's demoted, and wait for Kubernetes to restart the pod, but that doesn't seem ideal if the health check still passes so the pod is otherwise still functioning normally.26 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
Well there's a possible match now on the issues page, interestingly I don't get it for discord.js though 😂 https://github.com/getsentry/sentry-javascript/issues/12059
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
Obviously the major version bump for sentry is a red flag, but then it also includes a lot more packages as well
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
It's weird because I don't think sentry should be changing imports at all, maybe with its source mapping? But then I thought that was handled by TypeScript itself. I'll keep digging but it's weird that it only errors with Sapphire
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
Here's the diff, it might not necessarily be sentry but one of the other packages included in the update https://github.com/FozzieHi/FormulaOne/pull/782/files
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
I haven't changed my build system, it's just the update to the package which has changed https://github.com/FozzieHi/FormulaOne/blob/main/Dockerfile
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 5/15/2024 in #sapphire-support
Sapphire "no such file or directory" error
Seems weirdly similar to https://discord.com/channels/737141877803057244/1240322323043844167/1240322323043844167 ?
11 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 6/18/2023 in #sapphire-support
Event before interaction handlers are ran
Maybe something like
InteractionHandlerRun
for some
and InteractionHandlerDenied
for none
?12 replies
SIASapphire - Imagine a framework
•Created by Fozzie on 6/18/2023 in #sapphire-support
Event before interaction handlers are ran
Yup, I was thinking only for
some
specifically for this one, and maybe a different event for none
?12 replies