Quick start#
Installation#
Note
Aurum requires Python 3.10 or higher.
Run command pip install (1) aurum-hikari
or:
- You can use the -U flag with the
install
command (e.g.,pip install -U ...
) to update a package.
python3 -m pip install (1) aurum-hikari
- You can use the -U flag with the
install
command (e.g.,pip install -U ...
) to update a package.
py -m pip install (1) aurum-hikari
- You can use the -U flag with the
install
command (e.g.,pip install -U ...
) to update a package.
How to#
Create a command#
Slash command#
You need to import the SlashCommand class and inherit from it.
Example
class HelloCommand(SlashCommand):
def __init__(self) -> None:
super().__init__(name="hello", description="Say hi to bot") # (1)
async def callback(self, context: InteractionContext) -> None:
await context.create_response(f"Hi, {context.user.mention}!")
- Base information about your command: name, description, default member permissions and etc.
class ABCCommand(SlashCommand): # (1)
def __init__(self) -> None:
super().__init__(name="a") # (2)
@sub_command(name="b") # (3)
async def b_command(self, context: InteractionContext) -> None:
... # (4)
@b_command.sub_command(name="c")
async def b_c_command(self, context: InteractionContext) -> None:
...
- When command has a sub-commands, callback will be ignored.
- Base information about your command: name, description, default member permissions and etc.
- Base information about your sub-command. The same fields with slash-command, but without guild, default member permissions, is nsfw, dm enabled flags.
- If sub-command have another sub-command, callback of parent sub-command will be ignored too.
User command#
Note
User command this an application command in user's context menu.
You need to import the UserCommand class and inherit from it.
Example
Message command#
Note
User command this an application command in message's context menu.
You need to import the MessageCommand class and inherit from it.
Example
Work with plugins#
For clarity, you can see a sample project with plugins in the examples.
Work with components#
Sadly, but at the moment Aurum don't have a components.