Does anyone know how to get the DiscordClient Uptime in D#+ And how to fix the Connection terminated error?
Basically the Uptime is the time that the bot was on for.
And i wanna make a command that will try to get the bot's uptime and send it in an DiscordEmbed (embed)
A reply would be soo much appreciated thanks!
The easiest way to do this is to add a
DateTimevariable to your main async that connects your bot.You can now call this with the within the allowed scope of your class by using
ClassName.startTimeand get the time since this withDateTime.Now - ClassName.startTime. You can then manipulate the way this is shown however you'd like.