mirror of
https://github.com/RYGhub/royalnet.git
synced 2025-03-31 20:30:32 +00:00
# Conflicts: # royalnet/bots/generic.py # royalnet/commands/royalmusic/pause.py # royalnet/commands/royalmusic/play.py
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
import typing
|
|
from .commandinterface import CommandInterface
|
|
from .commandargs import CommandArgs
|
|
from .commanddata import CommandData
|
|
|
|
|
|
class Command:
|
|
name: str = NotImplemented
|
|
"""The main name of the command.
|
|
To have ``/example`` on Telegram, the name should be ``example``."""
|
|
|
|
aliases: typing.List[str] = []
|
|
"""A list of possible aliases for a command.
|
|
To have ``/e`` as alias for ``/example``, one should set aliases to ``["e"]``."""
|
|
|
|
description: str = NotImplemented
|
|
"""A small description of the command, to be displayed when the command is being autocompleted."""
|
|
|
|
syntax: str = ""
|
|
"""The syntax of the command, to be displayed when a :py:exc:`royalnet.error.InvalidInputError` is raised,
|
|
in the format ``(required_arg) [optional_arg]``."""
|
|
|
|
require_alchemy_tables: typing.Set = set()
|
|
"""A set of :py:class:`royalnet.database` tables that must exist for this command to work."""
|
|
|
|
def __init__(self, interface: CommandInterface):
|
|
self.interface = interface
|
|
|
|
async def run(self, args: CommandArgs, data: CommandData) -> None:
|
|
raise NotImplementedError()
|