Code-Society-Lab / Code-Society-Lab/matrixpy

Command Alias

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Python
Stars
14
Forks
7
Avg merge
8d 19h
Merged PRs (30d)
5

Description

Commands can currently only be invoked by their exact name. Bot authors often want a command to respond to multiple names (e.g. `!hello` and `!hi`) without duplicating logic so we would like to allow registering one or more aliases for a command at decoration time.

**Proposed API**
```python
@bot.command(aliases=["hi", "hey"])
async def greet(ctx, name: str):
await ctx.reply(f"Hello {name}!")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.