scurrypy 0.3.4.1__py3-none-any.whl → 0.3.4.3__py3-none-any.whl

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.

discord/client.py CHANGED
@@ -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.startup()
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.close()
317
+ await self._close()
318
318
 
319
- async def startup(self):
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 close(self):
338
+ async def _close(self):
338
339
  """Gracefully close HTTP and websocket connections."""
339
- # Close HTTP first since it's more important
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scurrypy
3
- Version: 0.3.4.1
3
+ Version: 0.3.4.3
4
4
  Summary: Discord API Wrapper in Python
5
5
  Author: Furmissile
6
6
  Requires-Python: >=3.10
@@ -1,5 +1,5 @@
1
1
  discord/__init__.py,sha256=cETkxHmm0s9YkSJgn-1daQhnbL96fuD7L9SIg2t5vBg,6823
2
- discord/client.py,sha256=LCK6dzQxt6YEy_JiMNpvaJ0WQPRODS_YVvy1SEPeXt8,13582
2
+ discord/client.py,sha256=JvGKlEgtwIeYAKZEYRB_0nkOdJFTLsQCb-Dz3MQ_Gx8,14013
3
3
  discord/client_like.py,sha256=JyJq0XBq0vKuPBJ_ZnYf5yAAuX1zz_2B1TZBQE-BYbQ,473
4
4
  discord/config.py,sha256=OH1A2mNKhDlGvQYASEsVUx2pNxP1YQ2a7a7z-IM5xFg,200
5
5
  discord/error.py,sha256=AlislRTna554cM6KC0KrwKugzYDYtx_9C8_3QFe4XDc,2070
@@ -48,8 +48,8 @@ discord/resources/guild.py,sha256=Unld1lWY3XynmRHU2FCi3-LA9VNp2thMI2BlILUTTxk,81
48
48
  discord/resources/interaction.py,sha256=mr4kLecQpl3AtgnNeqnj3eZIwQ73Clutdi-gnoSMWVU,5237
49
49
  discord/resources/message.py,sha256=RtvcCRx0lwW-mHPl3aNYoEvGffrvtpLsQ2fVWckywVI,7527
50
50
  discord/resources/user.py,sha256=vk89TnCVi-6ZgbDs_TZTCXrx_NfFS5Q9Wi_itYoaoyg,3085
51
- scurrypy-0.3.4.1.dist-info/licenses/LICENSE,sha256=NtspfRMAlryd1Eev4BYi9EFbKhvdmlCJJ2-ADUoEBoI,426
52
- scurrypy-0.3.4.1.dist-info/METADATA,sha256=n5LZHS1N0dlKDDo6DIGXih1tIty503u8UnmTIqTRQ6I,2956
53
- scurrypy-0.3.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
- scurrypy-0.3.4.1.dist-info/top_level.txt,sha256=fJkrNbR-_8ubMBUcDEJBcfkpECrvSEmMrNKgvLlQFoM,8
55
- scurrypy-0.3.4.1.dist-info/RECORD,,
51
+ scurrypy-0.3.4.3.dist-info/licenses/LICENSE,sha256=NtspfRMAlryd1Eev4BYi9EFbKhvdmlCJJ2-ADUoEBoI,426
52
+ scurrypy-0.3.4.3.dist-info/METADATA,sha256=GshbnJ8_Xw7Xw3BEBlvldCs-n6cyAOHJGQSo8p4S9tQ,2956
53
+ scurrypy-0.3.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ scurrypy-0.3.4.3.dist-info/top_level.txt,sha256=fJkrNbR-_8ubMBUcDEJBcfkpECrvSEmMrNKgvLlQFoM,8
55
+ scurrypy-0.3.4.3.dist-info/RECORD,,