Closed DMcP89 closed 1 year ago
We call this function to set the correct yahoo credentials before each command in the Yahoo cog:
async def set_yahoo_from_interaction( self, interaction: discord.Interaction ): guild = Guild.get(Guild.guild_id == str(interaction.guild_id)) self.yahoo_api = Yahoo( OAuth2( self.KEY, self.SECRET, store_file=False, **model_to_dict(guild) ), guild.league_id, guild.league_type, ) return
This should be refactored to a decorator that is attached to each command.
https://github.com/Rapptz/discord.py/discussions/8372 has an example of how to implement decorators for app commands.
We call this function to set the correct yahoo credentials before each command in the Yahoo cog:
This should be refactored to a decorator that is attached to each command.