Skip to content

Commit bf92a1c

Browse files
committed
fix: fixed guild icon key causing an error when guild icon is None
1 parent 2bbdd6c commit bf92a1c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

discordanalytics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__title__ = 'discordanalytics'
22
__author__ = "ValDesign"
33
__license__ = "MIT"
4-
__version__ = "3.0.2"
4+
__version__ = "3.0.3"
55

66
from .client import *

discordanalytics/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,15 @@ def track_interactions(self, interaction: discord.Interaction):
231231
self.stats["guildsLocales"] = guilds
232232

233233
guild_data = next((x for x in self.stats["guildsStats"] if x["guildId"] == str(interaction.guild.id)), None)
234+
guild_icon = interaction.guild.icon.key if interaction.guild.icon else None
234235
if guild_data is not None:
235236
guild_data["interactions"] += 1
237+
guild_data["icon"] = guild_icon
236238
else:
237239
self.stats["guildsStats"].append({
238240
"guildId": str(interaction.guild.id),
239241
"name": interaction.guild.name,
240-
"icon": interaction.guild.icon.key,
242+
"icon": guild_icon,
241243
"members": interaction.guild.member_count,
242244
"interactions": 1
243245
})

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "discordanalytics"
77
description = "A Python package for interacting with Discord Analytics API"
8-
version = "3.0.2"
8+
version = "3.0.3"
99
authors = [
1010
{name = "ValDesign", email = "valdesign.dev@gmail.com"}
1111
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
discord.py==2.4.0
22
requests==2.32.3
3-
setuptools==71.0.3
4-
wheel==0.43.0
3+
setuptools==75.2.0
4+
wheel==0.44.0

0 commit comments

Comments
 (0)