andersthemagi / Sovereign-of-Chaos

A small-scale bot made in Python, capable of handling several D&D related tasks on Discord. Built using Discord.py and hosted on a Raspberry Pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XP timeout is not being handled correctly

andersthemagi opened this issue · comments

Describe the bug

When determining whether or not the user has had enough time between messages to gain XP, the bot is not always accurate to the last time vs. current time.

From initial research / reproduction attempts, It seems that the database isn't properly updating when the last message has been sent in the chat. I may have to increase the float limits for the last_message column in order to ensure it gets updated properly. Currently it's a float(20,8), but it may need to be increased to a float(30, 15) in order to accommodate for extremes.

Steps To Reproduce

image

Expected behavior

  • A user should be able to gain a set amount of XP per message
  • A user should have a limit of 1 message per 10 seconds to gain XP

Additional context

N/A.

Sure enough, last_message was adjusted to be a double of unspecified constraints. The constraints were actually causing a problem with saving the float properly on most occasions. Closing this out for now.