From 8325118a2d3e77019862666f130c8270e5455db2 Mon Sep 17 00:00:00 2001 From: phixxy Date: Tue, 5 Nov 2024 18:39:30 -0800 Subject: [PATCH] Declare xp --- cogs/message_xp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/message_xp.py b/cogs/message_xp.py index a36b00b..dc23834 100644 --- a/cogs/message_xp.py +++ b/cogs/message_xp.py @@ -13,6 +13,7 @@ class MessageXP(BotBaseCog): @commands.command() async def stats(self, ctx): author_id = ctx.author.id + xp_data = {} if not os.path.exists(os.path.join(self.data_dir, "xp.json")): create_xp_file(self) try: @@ -39,6 +40,7 @@ class MessageXP(BotBaseCog): if message.author.bot: return else: + xp_data = {} #check if file exists if not os.path.exists(os.path.join(self.data_dir, "xp.json")): create_xp_file(self)