mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-30 15:04:18 +00:00
19 lines
553 B
Python
19 lines
553 B
Python
|
from typing import *
|
||
|
from royalnet.commands import *
|
||
|
from .getgift import GetgiftCommand
|
||
|
from ..tables import XmasGift
|
||
|
from sqlalchemy.sql.expression import func
|
||
|
|
||
|
|
||
|
class GetgiftdstCommand(GetgiftCommand):
|
||
|
name: str = "getgiftdst"
|
||
|
|
||
|
aliases = ["drawgiftdst"]
|
||
|
|
||
|
description: str = "Estrai un regalo con un certo destinatario."
|
||
|
|
||
|
syntax: str = "{destinatario}"
|
||
|
|
||
|
async def _get_gift(self, args, data):
|
||
|
return data.session.query(self.alchemy.get(XmasGift)).filter_by(drawn=False, destination=args[0]).order_by(func.random()).first()
|