mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
18 lines
531 B
Python
18 lines
531 B
Python
from typing import *
|
|
from royalnet.commands import *
|
|
from .getgift import GetgiftCommand
|
|
from ..tables import XmasGift
|
|
from sqlalchemy.sql.expression import func
|
|
|
|
|
|
class GetgiftidCommand(GetgiftCommand):
|
|
name: str = "getgiftid"
|
|
|
|
aliases = ["drawgiftid"]
|
|
|
|
description: str = "Estrai un regalo con un certo id."
|
|
|
|
syntax: str = "{id}"
|
|
|
|
async def _get_gift(self, args, data):
|
|
return data.session.query(self.alchemy.get(XmasGift)).filter_by(drawn=False, gift_id=int(args[0])).order_by(func.random()).first()
|