dvillavicencio / riven-bot

Discord Bot for Destiny 2 that retrieves statistics regarding Raid and Dungeon activities through Discord chat
2 stars 0 forks source link

Raid Stats | Improve and revamp user input digestion and validation #114

Closed dvillavicencio closed 2 months ago

dvillavicencio commented 3 months ago

This task is to improve on the initial design for capturing the input for the /raid_stats command. There are a couple of improvements that need to be made for this command:

  1. The initial autocomplete should not rely solely on the Bungie.net API for making valid options that the users will send to the bot. Decouple the membershipId and membershipType from the autocomplete options and allow the user to send the input as username#userTag. That way, even if the autocomplete fails to give the user the correct options, the user can still rely on using their username and tag to get a response from the bot.
  2. There are certain cases where the user will have a privacy option set to true, in this case we need to handle that gracefully. In the main method we need to create a custom exception for PrivateUserException.class and send the appropriate response when a user tries to fetch stats for a private Destiny 2 user.
  3. Additionally, if the user does not send the input as expected in the format username#tag then we need to handle this gracefully, either by sending the list of possible users with the given prefix. If however, the user sends incorrect input, for example, only the tag portion, then we need to be able to send the appropriate error message in the response.