bastisawesome / guessinggame_ttv

A Twitch bot to play a word guessing game
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Automate Syncing User Account Renaming #40

Open bastisawesome opened 1 year ago

bastisawesome commented 1 year ago

Currently, when a user renames themselves the bot will require the streamer to manually invoke a command to migrate the user's score/tokens. There is a Twitch API endpoint that triggers when a user renames themselves on Twitch, so we can use that to automate the task of migrating a user's scores to the new username.

bastisawesome commented 1 year ago

Update on this issue: it's a little bit more complex than I first understood. There are a few steps to make here, which may be broken up into multiple issues in the future if there's reason to.

  1. Build a cache of viewers including their Twitch IDs
  2. Run a lookup on the Twitch get_users API
  3. Compare old username in database with new username from API
  4. Update entries in the database

Some things to note:

Some ideas for how to implement this:

Naturally, this does require a database update, and may be pushed back until a much later release, depending on the complexity. Other database changes will take priority.