From 9348e1fb0ed44e0fd9ad6369b64c94b4af35d8f0 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 30 Apr 2021 13:46:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20discord=20login=20bolt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- royalpack/bolts/login.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/royalpack/bolts/login.py b/royalpack/bolts/login.py index 8b3fc93b..ed2fdfd2 100644 --- a/royalpack/bolts/login.py +++ b/royalpack/bolts/login.py @@ -8,6 +8,7 @@ import functools import logging import royalnet.engineer as engi +import royalnet_discordpy import royalnet_telethon import sqlalchemy.orm as so import sqlalchemy.sql as ss @@ -40,6 +41,13 @@ def use_ryglogin(allow_anonymous=False): ss.select(db.TelegramAccount).where(db.TelegramAccount.id == _sender._user.id) ).scalar() + elif isinstance(_imp, royalnet_discordpy.DiscordpyPDAImplementation): + _sender = await _msg.sender + supported = True + account = _session.execute( + ss.select(db.DiscordAccount).where(db.DiscordAccount.id == _sender._user.id) + ).scalar() + else: supported = False account = None