scurrypy 0.3.4.1__tar.gz → 0.3.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of scurrypy might be problematic. Click here for more details.
- {scurrypy-0.3.4.1/scurrypy.egg-info → scurrypy-0.3.4.3}/PKG-INFO +1 -1
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/client.py +14 -5
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/pyproject.toml +1 -1
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3/scurrypy.egg-info}/PKG-INFO +1 -1
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/LICENSE +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/README.md +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/__init__.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/client_like.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/config.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/dispatch/__init__.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/dispatch/command_dispatcher.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/dispatch/event_dispatcher.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/dispatch/prefix_dispatcher.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/error.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/__init__.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/channel_events.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/guild_events.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/hello_event.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/interaction_events.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/message_events.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/reaction_events.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/events/ready_event.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/gateway.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/http.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/intents.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/logger.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/model.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/__init__.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/application.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/emoji.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/guild.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/integration.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/interaction.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/member.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/role.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/models/user.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/__init__.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/action_row.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/attachment.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/channel.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/command.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/component_types.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/components_v2.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/embed.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/message.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/modal.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/parts/role.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/__init__.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/application.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/bot_emojis.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/channel.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/guild.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/interaction.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/message.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/discord/resources/user.py +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/scurrypy.egg-info/SOURCES.txt +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/scurrypy.egg-info/dependency_links.txt +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/scurrypy.egg-info/top_level.txt +0 -0
- {scurrypy-0.3.4.1 → scurrypy-0.3.4.3}/setup.cfg +0 -0
|
@@ -298,7 +298,7 @@ class Client(ClientLike):
|
|
|
298
298
|
await self._ws.identify()
|
|
299
299
|
|
|
300
300
|
if not self._is_set_up:
|
|
301
|
-
await self.
|
|
301
|
+
await self._startup()
|
|
302
302
|
self._is_set_up = True
|
|
303
303
|
|
|
304
304
|
await self._listen()
|
|
@@ -314,9 +314,10 @@ class Client(ClientLike):
|
|
|
314
314
|
except Exception as e:
|
|
315
315
|
self._logger.log_error(f"{type(e).__name__} - {e}")
|
|
316
316
|
finally:
|
|
317
|
-
await self.
|
|
317
|
+
await self._close()
|
|
318
318
|
|
|
319
|
-
async def
|
|
319
|
+
async def _startup(self):
|
|
320
|
+
"""Start up bot by registering user-defined hooks and commands."""
|
|
320
321
|
try:
|
|
321
322
|
if self._setup_hooks:
|
|
322
323
|
for hook in self._setup_hooks:
|
|
@@ -334,9 +335,17 @@ class Client(ClientLike):
|
|
|
334
335
|
except Exception:
|
|
335
336
|
raise
|
|
336
337
|
|
|
337
|
-
async def
|
|
338
|
+
async def _close(self):
|
|
338
339
|
"""Gracefully close HTTP and websocket connections."""
|
|
339
|
-
#
|
|
340
|
+
# Run shutdown hooks first
|
|
341
|
+
for hook in self._shutdown_hooks:
|
|
342
|
+
try:
|
|
343
|
+
self._logger.log_info(f"Executing shutdown hook {hook.__name__}")
|
|
344
|
+
await hook(self)
|
|
345
|
+
except Exception as e:
|
|
346
|
+
self._logger.log_error(f"Shutdown hook failed: {type(e).__name__}: {e}")
|
|
347
|
+
|
|
348
|
+
# Close HTTP before gateway since it's more important
|
|
340
349
|
self._logger.log_debug("Closing HTTP session...")
|
|
341
350
|
await self._http.close_session()
|
|
342
351
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|