#Restart the bot without disconnecting.

1 messages · Page 1 of 1 (latest)

radiant needle
#

Is there a way to restart the bot without disconnecting from discord?
I know reloading cogs exists, but that doesn't work if you're doing things like changing intents, or changing the database.
I need a way to essentially reload the entire script without it disconnecting from discord as I want to preserve my interactions. I have a channel with a bunch of messages with views on each of them with no timeout, so when I restart the bot all of these would break.
Anyone got any ideas?

radiant needle
#

💀?

#

doesn't that just restart the script whenever you save a file

woeful stirrup
#

oops yeah i misread

#

Sorry lmao

radiant needle
#

it's okay

woeful stirrup
#

so like, for reference, the "Identify" process (the part that actually loads your intents and authenticates with your token) is all one thing

woeful stirrup
neon trail
#

you cannot really restart the bot without a dc

#

but you can reload the cogs

radiant needle
woeful stirrup
#

yep

radiant needle
woeful stirrup
woeful stirrup
woeful stirrup
#

all view elements need a custom id and a timeout of None

radiant needle
#

all I need is a view to work after I restart the bot

radiant needle
woeful stirrup
#

this is how you set persistent views

#

the view

radiant needle
#

alright

#

does the view have to a have a custom id?

neon trail
#

@tawdry rover

woeful stirrup
#

elements have custom ids, not the view itself

tawdry roverBOT
#

Here's the persistent example.

#

Here's the persistent example.

neon trail
#

F

#

xd

woeful stirrup
#

lol

radiant needle
#

thank you <3