reset reconnecting factory's internal delay

This commit is contained in:
InspectorCaracal 2022-12-13 21:13:53 -07:00 committed by GitHub
parent ca94d0136f
commit 8c16252a4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,6 +195,9 @@ class DiscordWebsocketServerFactory(WebSocketClientFactory, protocol.Reconnectin
else:
# we don't know where to reconnect to! we'll start from the beginning
self.url = None
# reset the internal delay, since this is a deliberate disconnect
self.delay = self.initialDelay
# disconnect to allow the reconnection process to kick in
self.bot.sendClose()
self.sessionhandler.server_disconnect(self.bot)