mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-30 15:04:18 +00:00
fixed (?) db.py
blame steffo if something breaks
This commit is contained in:
parent
c1f0f34aa8
commit
e903c6484f
1 changed files with 2 additions and 2 deletions
4
db.py
4
db.py
|
@ -16,7 +16,7 @@ import re
|
||||||
import enum
|
import enum
|
||||||
# Both packages have different pip names
|
# Both packages have different pip names
|
||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
from discord import User as DiscordUser
|
# from discord import User as DiscordUser
|
||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
from telegram import User as TelegramUser
|
from telegram import User as TelegramUser
|
||||||
import loldata
|
import loldata
|
||||||
|
@ -689,7 +689,7 @@ class Discord(Base, Mini):
|
||||||
return f"<db.Discord {self.discord_id}>"
|
return f"<db.Discord {self.discord_id}>"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def create(session: Session, royal_username, discord_user: DiscordUser):
|
def create(session: Session, royal_username, discord_user: "DiscordUser"):
|
||||||
d = session.query(Discord).filter(Discord.discord_id == discord_user.id).first()
|
d = session.query(Discord).filter(Discord.discord_id == discord_user.id).first()
|
||||||
if d is not None:
|
if d is not None:
|
||||||
raise AlreadyExistingError(repr(d))
|
raise AlreadyExistingError(repr(d))
|
||||||
|
|
Loading…
Reference in a new issue