Skip to content

Commit da6be77

Browse files
committed
fix: Fixed can't subtract offset-naive and offset-aware datetimes
1 parent bf92a1c commit da6be77

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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.3"
4+
__version__ = "3.0.4"
55

66
from .client import *

discordanalytics/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import asyncio
2-
from datetime import datetime
2+
from datetime import datetime, timezone
33
from typing import Literal
44
import discord
55
from discord.enums import InteractionType
@@ -256,7 +256,7 @@ def track_interactions(self, interaction: discord.Interaction):
256256
or interaction.user.guild_permissions.moderate_members
257257
):
258258
self.stats["users_type"]["moderator"] += 1
259-
elif interaction.user.joined_at is not None and (datetime.now() - interaction.user.joined_at).days <= 7:
259+
elif interaction.user.joined_at is not None and (discord.utils.utcnow() - interaction.user.joined_at).days <= 7:
260260
self.stats["users_type"]["new_member"] += 1
261261
else:
262262
self.stats["users_type"]["other"] += 1

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

0 commit comments

Comments
 (0)