Skip to content

Commit 04ba4c8

Browse files
committed
chore: Bump version to 3.1.3 and update interaction data structure
1 parent 4a291c5 commit 04ba4c8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-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.1.2"
4+
__version__ = "3.1.3"
55

66
from .client import *

discordanalytics/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, client: discord.Client, api_key: str, debug: bool = False, ch
3636
"date": datetime.today().strftime("%Y-%m-%d"),
3737
"guilds": 0,
3838
"users": 0,
39-
"interactions": [], # {name:str, number:int, type:int}[]
39+
"interactions": [], # {name:str, number:int, type:int command_type?:int}[]
4040
"locales": [], # {locale:str, number:int}[]
4141
"guildsLocales": [], # {locale:str, number:int}[]
4242
"guildMembers": {
@@ -236,14 +236,15 @@ def track_interactions(self, interaction: discord.Interaction):
236236

237237
if interaction.type in {InteractionType.application_command, InteractionType.autocomplete}:
238238
interaction_data = next((x for x in self.stats["interactions"]
239-
if x["name"] == interaction.data["name"] and x["type"] == interaction.type.value), None)
239+
if x["name"] == interaction.data["name"] and x["type"] == interaction.type.value and x["command_type"] == interaction.data["type"]), None)
240240
if interaction_data is not None:
241241
interaction_data["number"] += 1
242242
else:
243243
self.stats["interactions"].append({
244244
"name": interaction.data["name"],
245245
"number": 1,
246-
"type": interaction.type.value
246+
"type": interaction.type.value,
247+
"command_type": interaction.data["type"]
247248
})
248249
elif interaction.type in {InteractionType.component, InteractionType.modal_submit}:
249250
interaction_data = next((x for x in self.stats["interactions"]

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.1.2"
8+
version = "3.1.3"
99
authors = [
1010
{name = "ValDesign", email = "valdesign.dev@gmail.com"}
1111
]

0 commit comments

Comments
 (0)