import discord from ..player import Player from ..bot import DiscordClient class Extension: core: DiscordClient def __init__(self, core: DiscordClient): self.core = core @core.tree.command(name = "profile", description = "Проверить профиль") @discord.app_commands.describe(profile=core.ANY_INPUT) async def check_profile( interaction: discord.Interaction, profile: str = "" ): await interaction.response.defer(thinking=True) player = self.__call__(profile, interaction.user) return await interaction.followup.send(embed=player.embed, ephemeral=False) async def __call__(self, profile:str, discord_user: discord.Member) -> Player: steam64 = await self.core.GetSteam64OfDiscord(discord_user) player = await self.core.GetPlayer(profile, steam64) if profile else await self.core.GetPlayer(steam64, steam64) return player