XHandler
XHandler is eXternal Handler. Coding your command like discord.pySetup
You can enable XHandler by
This enable is disablecommand
event and enable 2 event. click here goto XHandler event.
Quick Example
@XH.command()
def calculate(client, mode="add", x=3, y=1, hello=False):
"""Perform mathematical operations."""
x, y, = int(x), int(y)
if mode == "add":
Send(client, x + y)
elif mode == "sub":
Send(client, x - y)
elif mode == "mul":
Send(client, x * y)
elif mode == "div":
Send(client, x / y)
if hello:
Send(client, "Hello World!")
-
in your command
you can use --
for boolean only
Help command
You can disable help command by enablehelp=False
help <command>
for more command info
> help calculate
calculate
Perform mathematical operations.
Usage: calculate [-mode add] [-x 3] [-y 1] [--hello]
Error
You can show error input command by showusageonworng=False
Command Not Found
Handle
You can handle command not found by using .commandnotfound
Missing argument
if enable showusageonworng
showusageonworng
Invalid argument
if enable showusageonworng
showusageonworng