Skip to content

Fix study role expiration and DM#43

Merged
Gokboru-Omer merged 2 commits into
infernious:ap-bot-3vfrom
pushiscool:pushiscool/fix-study-role-duration
May 26, 2026
Merged

Fix study role expiration and DM#43
Gokboru-Omer merged 2 commits into
infernious:ap-bot-3vfrom
pushiscool:pushiscool/fix-study-role-duration

Conversation

@pushiscool

Copy link
Copy Markdown

Added Task 4.

Root cause:

  • /study stored the Study role expiration time in the database, but removal mostly depended on bot.loop.call_later(...)
  • That timer is only in memory, so it can be lost if the bot restarts, crashes, or redeploys

Changes:

  • Keeps /study limited to 10 minutes through exactly 1 week
  • Allows 168h and blocks anything over 1 week
  • Sends the user a DM with the expected Study role removal time
  • Removes expired Study roles after restart using saved study_expires_at
  • Handles missing Study role
  • Includes CI fix for missing config role IDs

@pushiscool pushiscool force-pushed the pushiscool/fix-study-role-duration branch from 5193d3c to ff95585 Compare May 25, 2026 07:25
@Gokboru-Omer Gokboru-Omer merged commit 14f35a9 into infernious:ap-bot-3v May 26, 2026
1 check passed
pushiscool pushed a commit to pushiscool/APBot that referenced this pull request Jun 20, 2026
…-role-duration

Fix study role expiration and DM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants