dopamine-framework 2.2.0__tar.gz → 2.2.2__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.
Files changed (29) hide show
  1. {dopamine_framework-2.2.0/src/dopamine_framework.egg-info → dopamine_framework-2.2.2}/PKG-INFO +1 -1
  2. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/pyproject.toml +1 -1
  3. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2/src/dopamine_framework.egg-info}/PKG-INFO +1 -1
  4. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/bot.py +3 -2
  5. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/ext/diagnostics.py +13 -10
  6. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/ext/path.py +4 -2
  7. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/ext/pic.py +1 -1
  8. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/LICENSE +0 -0
  9. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/NOTICE +0 -0
  10. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/README.md +0 -0
  11. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/setup.cfg +0 -0
  12. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamine_framework.egg-info/SOURCES.txt +0 -0
  13. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamine_framework.egg-info/dependency_links.txt +0 -0
  14. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamine_framework.egg-info/requires.txt +0 -0
  15. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamine_framework.egg-info/top_level.txt +0 -0
  16. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/__init__.py +0 -0
  17. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/core/__init__.py +0 -0
  18. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/core/commands_registry.py +0 -0
  19. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/core/dashboard.py +0 -0
  20. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/core/dopamine_commands.py +0 -0
  21. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/core/errors.py +0 -0
  22. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/core/preconditions.py +0 -0
  23. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/ext/__init__.py +0 -0
  24. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/utils/__init__.py +0 -0
  25. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/utils/checks.py +0 -0
  26. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/utils/log.py +0 -0
  27. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/utils/paginator.py +0 -0
  28. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/utils/timeparser.py +0 -0
  29. {dopamine_framework-2.2.0 → dopamine_framework-2.2.2}/src/dopamineframework/utils/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dopamine-framework
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Initialize a production-ready Discord.py bot in just 4 lines of code. Smart and automated command syncing, preconditions (and its presets), easy-to-use in-Discord dashboard, and more. A Dopamine Studios project.
5
5
  Author: dopaminestudios
6
6
  Requires-Python: >=3.12
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dopamine-framework"
7
- version = "2.2.0"
7
+ version = "2.2.2"
8
8
  authors = [{name = "dopaminestudios"}]
9
9
  description = "Initialize a production-ready Discord.py bot in just 4 lines of code. Smart and automated command syncing, preconditions (and its presets), easy-to-use in-Discord dashboard, and more. A Dopamine Studios project."
10
10
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dopamine-framework
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Initialize a production-ready Discord.py bot in just 4 lines of code. Smart and automated command syncing, preconditions (and its presets), easy-to-use in-Discord dashboard, and more. A Dopamine Studios project.
5
5
  Author: dopaminestudios
6
6
  Requires-Python: >=3.12
@@ -21,7 +21,7 @@ class Bot(commands.Bot):
21
21
 
22
22
  """
23
23
  def __init__(self, cogs_path: str = "cogs", log_path: str = None, default_diagnostics: bool = True, status: discord.Status = None, activity: discord.Activity = None, global_cooldown_rate: int = 10,
24
- global_cooldown_per: float = 60.0, minimal_cacheing: bool = False, accent_colour: discord.Colour = discord.Colour(0x944ae8), *args, **kwargs):
24
+ global_cooldown_per: float = 60.0, minimal_cacheing: bool = False, accent_colour: discord.Colour = discord.Colour(0x944ae8), bot_logger: logging.Logger = logging.getLogger("discord"), *args, **kwargs):
25
25
  """Initialize the bot with framework defaults, cooldowns, and extension settings.
26
26
 
27
27
  Args:
@@ -34,6 +34,7 @@ class Bot(commands.Bot):
34
34
  global_cooldown_per: Default global cooldown window in seconds.
35
35
  minimal_cacheing: Whether to minimize member caching for lower memory usage.
36
36
  accent_colour: The colour to be used for accents (and more) in the `/ping` embed, and the `/latency info` graph.
37
+ bot_logger: The logger for the bot process.
37
38
  *args: Additional positional arguments forwarded to the parent implementation.
38
39
  **kwargs: Additional keyword arguments forwarded to the underlying API.
39
40
  """
@@ -70,7 +71,7 @@ class Bot(commands.Bot):
70
71
  self.minimal_cacheing = minimal_cacheing
71
72
  self.accent_colour = accent_colour.to_rgb()
72
73
  self.registry = CommandRegistry(self)
73
- self.logger = None
74
+ self.logger = bot_logger
74
75
  self.start_time = None
75
76
  self.count = None
76
77
  self.total_setup_time = None
@@ -9,7 +9,7 @@ import io
9
9
  from PIL import Image, ImageDraw, ImageFont
10
10
  from collections import deque
11
11
  from .path import framework_version, BOLDFONT_PATH
12
- from ...dopamineframework import dopamine_commands
12
+ from ..core import dopamine_commands
13
13
  import geocoder
14
14
 
15
15
 
@@ -139,16 +139,19 @@ class Diagnostics(commands.Cog):
139
139
  draw = ImageDraw.Draw(img)
140
140
 
141
141
  try:
142
+ # Try loading your custom font
142
143
  title_font = ImageFont.truetype(BOLDFONT_PATH, 18 * scale_factor)
143
- draw.text(
144
- (50, 50),
145
- "Average API Latency - Powered by Dopamine Framework",
146
- fill=(255, 255, 255, 255),
147
- font=title_font
148
- )
149
144
  except Exception as e:
150
- print(f"Font loading error: {e}")
151
- draw.text((50, 50), "Average API Latency - Powered by Dopamine Framework", fill=(255, 255, 255, 255))
145
+ # Fallback to a default system font if Bold.ttf is missing
146
+ print(f"Dopamine Framework: Custom font not found at {BOLDFONT_PATH}. Using default.\n{e}")
147
+ title_font = ImageFont.load_default()
148
+
149
+ draw.text(
150
+ (50, 50),
151
+ "Average API Latency - Powered by Dopamine Framework",
152
+ fill=(255, 255, 255, 255),
153
+ font=title_font
154
+ )
152
155
 
153
156
  data = list(self.latency_cache)
154
157
  num_samples = len(data)
@@ -343,7 +346,7 @@ class Diagnostics(commands.Cog):
343
346
  f"> Memory Usage: `{memory_usage}`\n"
344
347
  f"{battery_status}"
345
348
  ),
346
- color=discord.Colour.from_rgb(self.bot.accent_colour)
349
+ color=discord.Colour.from_rgb(*self.bot.accent_colour)
347
350
  )
348
351
  message = await interaction.original_response()
349
352
  await message.edit(content=None, embed=embed)
@@ -4,9 +4,11 @@ import importlib.resources
4
4
  BASE_PATH = Path(__file__).parent
5
5
 
6
6
  try:
7
+ # Attempting to load as a package resource
7
8
  with importlib.resources.path("dopamineframework.ext", "Bold.ttf") as p:
8
9
  BOLDFONT_PATH = str(p)
9
10
  except Exception:
10
- BOLDFONT_PATH = "Bold.ttf"
11
+ # Fallback: Look for Bold.ttf in the same folder as this script
12
+ BOLDFONT_PATH = str(BASE_PATH / "Bold.ttf")
11
13
 
12
- framework_version = "2.2.0"
14
+ framework_version = "2.2.2"
@@ -2,7 +2,7 @@ import discord
2
2
  from discord import app_commands
3
3
  from discord.ext import commands
4
4
  from ..core.dashboard import OwnerDashboard
5
- from ...dopamineframework import dopamine_commands
5
+ from ..core import dopamine_commands
6
6
 
7
7
  class Pic(commands.Cog):
8
8
  """Owner-only utility cog that exposes dashboard-related commands.