Code-Society-Lab / Code-Society-Lab/matrixpy
Command Alias
Open
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
Assessment
This issue has not been assessed yet.