fix some bug that doesn't let user to sign in and connect with discord, added some test

This commit is contained in:
Rainy21
2026-04-22 03:44:29 -04:00
parent c6257c5260
commit 0a972f6a3f
13 changed files with 262 additions and 18 deletions
+11 -3
View File
@@ -11,9 +11,7 @@ class LoginCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name="login", description="Link your Riot account")
@app_commands.describe(summoner="Your Riot ID (e.g. Name#TAG)")
async def login(self, interaction: discord.Interaction, summoner: str):
async def _handle_login(self, interaction: discord.Interaction, summoner: str):
await interaction.response.defer(ephemeral=True)
if "#" not in summoner:
@@ -53,6 +51,16 @@ class LoginCog(commands.Cog):
ephemeral=True
)
@app_commands.command(name="login", description="Link your Riot account")
@app_commands.describe(summoner="Your Riot ID (e.g. Name#TAG)")
async def login(self, interaction: discord.Interaction, summoner: str):
await self._handle_login(interaction, summoner)
@app_commands.command(name="signin", description="Link your Riot account")
@app_commands.describe(summoner="Your Riot ID (e.g. Name#TAG)")
async def signin(self, interaction: discord.Interaction, summoner: str):
await self._handle_login(interaction, summoner)
async def setup(bot):
await bot.add_cog(LoginCog(bot))