pytexas / pytexas-discord-bot

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

Refactor /register command to cache emails #11

Closed johnlandonwood closed 4 months ago

johnlandonwood commented 4 months ago

This PR aims to address #10.

It adds the build_attendee_emails_list() method to the PyTexBot client. This method is used to build the list of attendee emails from the pretix API when the bot first starts up. That way, when the /register command is executed, we just check that list instead of getting getting the whole list every time. If the email is not found in the list the first time, then we re-build the list from scratch and try again. If the email is still not found the second time, then we just fail the command.