C#C
C#9mo ago
Kyede

BackgroundService Question

Hello :D

I'd like to get some feedback on the Microsoft.Extensions.Hosting's BackgroundService . The issue i'm facing seems to be a race issue between the Discord client initializing and another hosted service being started and inheriting said client before it is properly initialized. The confusing part is that a second hosted service (the main class handling pretty much the registering of commands, modules, and logging) also inherits the DiscordSocketClient but this service is actually receiving the full initialized instance despite being registered right under InteractionManager. I would love some help on this :(

Code: https://paste.mod.gg/acslcflspkxc/0

Thank you!! :3
A tool for sharing your source code with the world!
Was this page helpful?