disagreement 0.2.0rc1__py3-none-any.whl → 0.4.0__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.
Files changed (38) hide show
  1. disagreement/__init__.py +2 -4
  2. disagreement/audio.py +42 -5
  3. disagreement/cache.py +43 -4
  4. disagreement/caching.py +121 -0
  5. disagreement/client.py +1682 -1535
  6. disagreement/enums.py +10 -3
  7. disagreement/error_handler.py +5 -1
  8. disagreement/errors.py +1341 -3
  9. disagreement/event_dispatcher.py +3 -5
  10. disagreement/ext/__init__.py +1 -0
  11. disagreement/ext/app_commands/__init__.py +0 -2
  12. disagreement/ext/app_commands/commands.py +0 -2
  13. disagreement/ext/app_commands/context.py +0 -2
  14. disagreement/ext/app_commands/converters.py +2 -4
  15. disagreement/ext/app_commands/decorators.py +5 -7
  16. disagreement/ext/app_commands/handler.py +1 -3
  17. disagreement/ext/app_commands/hybrid.py +0 -2
  18. disagreement/ext/commands/__init__.py +63 -61
  19. disagreement/ext/commands/cog.py +0 -2
  20. disagreement/ext/commands/converters.py +16 -5
  21. disagreement/ext/commands/core.py +728 -563
  22. disagreement/ext/commands/decorators.py +294 -219
  23. disagreement/ext/commands/errors.py +0 -2
  24. disagreement/ext/commands/help.py +0 -2
  25. disagreement/ext/commands/view.py +1 -3
  26. disagreement/gateway.py +632 -586
  27. disagreement/http.py +1362 -1041
  28. disagreement/interactions.py +0 -2
  29. disagreement/models.py +2682 -2263
  30. disagreement/shard_manager.py +0 -2
  31. disagreement/ui/view.py +167 -165
  32. disagreement/voice_client.py +263 -162
  33. {disagreement-0.2.0rc1.dist-info → disagreement-0.4.0.dist-info}/METADATA +33 -6
  34. disagreement-0.4.0.dist-info/RECORD +55 -0
  35. disagreement-0.2.0rc1.dist-info/RECORD +0 -54
  36. {disagreement-0.2.0rc1.dist-info → disagreement-0.4.0.dist-info}/WHEEL +0 -0
  37. {disagreement-0.2.0rc1.dist-info → disagreement-0.4.0.dist-info}/licenses/LICENSE +0 -0
  38. {disagreement-0.2.0rc1.dist-info → disagreement-0.4.0.dist-info}/top_level.txt +0 -0
disagreement/enums.py CHANGED
@@ -1,10 +1,8 @@
1
- # disagreement/enums.py
2
-
3
1
  """
4
2
  Enums for Discord constants.
5
3
  """
6
4
 
7
- from enum import IntEnum, Enum # Import Enum
5
+ from enum import IntEnum, Enum
8
6
 
9
7
 
10
8
  class GatewayOpcode(IntEnum):
@@ -375,6 +373,15 @@ class OverwriteType(IntEnum):
375
373
  MEMBER = 1
376
374
 
377
375
 
376
+ class AutoArchiveDuration(IntEnum):
377
+ """Thread auto-archive duration in minutes."""
378
+
379
+ HOUR = 60
380
+ DAY = 1440
381
+ THREE_DAYS = 4320
382
+ WEEK = 10080
383
+
384
+
378
385
  # --- Component Enums ---
379
386
 
380
387
 
@@ -14,7 +14,11 @@ def setup_global_error_handler(
14
14
  The handler logs unhandled exceptions so they don't crash the bot.
15
15
  """
16
16
  if loop is None:
17
- loop = asyncio.get_event_loop()
17
+ try:
18
+ loop = asyncio.get_running_loop()
19
+ except RuntimeError:
20
+ loop = asyncio.new_event_loop()
21
+ asyncio.set_event_loop(loop)
18
22
 
19
23
  if not logging.getLogger().hasHandlers():
20
24
  setup_logging(logging.ERROR)