pytexas / pytexas-discord-bot

Discord bot for the PyTexas Discord
1 stars 0 forks source link

Add Caching Mechanism to Discord Bot for User Lookup #10

Closed MasonEgger closed 5 months ago

MasonEgger commented 5 months ago

Currently every execution of the /register command in the Discord bot reaches out to pretix and gets the paginated record of attendees. We should build in a caching mechanism that stores this data (probably in a dict, it doesn't need to persist). If the user isn't found, then do a full lookup via the API. If the user still isn't found, fail the command. We should probably do an initial API call on startup to prepopulate the dict.

MasonEgger commented 5 months ago

@johnlandonwood Took care of this for us at PyCon US 2024 on the first day of sprints!