#Command to stop the bot?
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
await bot.stop()
However personally, I would shut off the bot manually to prevent any possible data corruption if you're using databases or anything of the sort.
And it doesn't close the session, so honestly, just don't shut it down via the bot. Or if you really need to shut it down using OS.
Indeed, every time I force quit, the json file is unreadable...
By shut off the bot manually, do you mean Ctrl+C?
Yep, but I mean, it's not much better than bot.stop.
What do you mean json file is unreadable?
Btw i may not be able to provide amazing support as im new to interactions.py too, however I've tried many other types of python discord bots and this one is the easiest and most powerful one i've found yet especially with easily integradable / commands.
The program will not be able to read locally stored json files at all
This only occurs in Ubuntu environment
if you want to simulate a Ctrl+C in your code, you can raise the KeyboardInterrupt exception
I don't think the bot.stop function should be called to stop the bot, I think it's a private function for the inner workings of the bot
I'm running the bot with nohup on Ubuntu, so it's hard to do Ctrl+C...
Idk what is nohup but I think you misunderstood me
raise the exception, not manually press Ctrl C
?????
no its a public function lmao
if we wanted it private it would be underscored
using it is perfectly fine
v4 was more picky about it, but v5 doesnt care
stop() is the recommended way to do it, because it means you can put cleanup after the eventloop ends
ctrl+C will force-quit on the current line, not allowing cleanup functions to run
(though usually ipy intercepts the first control c and tries to close it gracefully using stop)