|
|
@ -1,13 +1,10 @@ |
|
|
|
import discord |
|
|
|
from ..exceptions import * |
|
|
|
from ..bot import DiscordClient |
|
|
|
from ..player import Player |
|
|
|
import os |
|
|
|
|
|
|
|
class Extension: |
|
|
|
auth_channel = 960796520247091201 |
|
|
|
default_role = 684828780040421388 |
|
|
|
def __init__(self, core: DiscordClient): |
|
|
|
def __init__(self, core): |
|
|
|
if not os.getenv("REGISTER_ENABLED", None): return None |
|
|
|
@core.tree.command(name = "register", description = "Привязать дискорд к стиму") |
|
|
|
@discord.app_commands.describe(profile=core.ANY_INPUT) |
|
|
@ -52,7 +49,7 @@ class Extension: |
|
|
|
): |
|
|
|
await interaction.response.defer(thinking=True) |
|
|
|
steam64 = await core.GetSteam64OfDiscord(interaction.user) |
|
|
|
player: Player = await core.GetPlayer(steam64, steam64, False) |
|
|
|
player = await core.GetPlayer(steam64, steam64, False) |
|
|
|
await player.RemoveDiscordId(interaction.user.id) |
|
|
|
await interaction.followup.send(f'Профиль отвязан, друг', ephemeral=True) |
|
|
|
await self.remove_role(interaction.user.id) |
|
|
|