1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00
royalnet/royalpack/commands/trionfireali.py

60 lines
2.1 KiB
Python
Raw Normal View History

2020-09-22 02:01:22 +00:00
from typing import *
import logging
import royalnet.commands as rc
import royalnet.utils as ru
from royalnet.backpack import tables as rbt
from .abstract.linker import LinkerCommand
2020-09-24 01:20:35 +00:00
import asyncio
import datetime
2020-09-22 02:01:22 +00:00
2020-09-24 01:20:35 +00:00
from ..halloween2020 import *
2020-09-22 02:01:22 +00:00
log = logging.getLogger(__name__)
class TrionfirealiCommand(LinkerCommand):
name: str = "trionfireali"
description: str = "Visualizza il tuo pr⊕gress⊕ nei Tri⊕nfi Reali!"
syntax: str = ""
2020-09-24 01:20:35 +00:00
def describe(self, obj: TrionfiStatus) -> str:
2020-09-22 02:01:22 +00:00
raise NotImplementedError()
2020-09-24 01:20:35 +00:00
async def get_updatables_of_user(self, session, user: rbt.User) -> List[TrionfiStatus]:
return [user.halloween2020] if user.halloween2020 else []
2020-09-22 02:01:22 +00:00
2020-09-24 01:20:35 +00:00
async def get_updatables(self, session) -> List[TrionfiStatus]:
return await ru.asyncify(session.query(self.alchemy.get(TrionfiStatus)).all)
2020-09-22 02:01:22 +00:00
async def create(self,
session,
user: rbt.User,
args: rc.CommandArgs,
2020-09-24 01:20:35 +00:00
data: Optional[rc.CommandData] = None) -> Optional[TrionfiStatus]:
raise rc.InvalidInputError("N⊕n è qui che inizia il mister⊕.")
async def update(self, session, obj: TrionfiStatus, change: Callable[[str, Any], Awaitable[None]]):
for trionfo in trionfilist:
check_result = await trionfo.check.check(obj, key=self.config["steampowered"]["token"])
log.debug(f"{trionfo.check}: {check_result}")
if check_result is True:
obj.__setattr__(trionfo.variable, datetime.datetime.now())
await asyncio.sleep(1)
async def on_increase(self, session, obj: TrionfiStatus, attribute: str, old: Any, new: Any) -> None:
2020-09-22 02:01:22 +00:00
pass
2020-09-24 01:20:35 +00:00
async def on_unchanged(self, session, obj: TrionfiStatus, attribute: str, old: Any, new: Any) -> None:
2020-09-22 02:01:22 +00:00
pass
2020-09-24 01:20:35 +00:00
async def on_decrease(self, session, obj: TrionfiStatus, attribute: str, old: Any, new: Any) -> None:
2020-09-22 02:01:22 +00:00
pass
2020-09-24 01:20:35 +00:00
async def on_first(self, session, obj: TrionfiStatus, attribute: str, old: None, new: Any) -> None:
2020-09-22 02:01:22 +00:00
pass
2020-09-24 01:20:35 +00:00
async def on_reset(self, session, obj: TrionfiStatus, attribute: str, old: Any, new: None) -> None:
2020-09-22 02:01:22 +00:00
pass