Zig: Commands¶
Functions¶
registerCommand¶
| Zig | |
|---|---|
Registers /name, whose text after the name reaches handler as args. Call it from enable.
- Parameters:
- name :
[]const u8 - description :
[]const u8 - permission :
Permission - handler :
comptime fn (*const Invocation) void
- name :
- Return type:
Error!void - Slots:
register_command
executeCommand¶
| Zig | |
|---|---|
Runs cmd as the console. Server thread only. The output lines are logged at debug level; a false from the host, a level that is not ready, is Refused.
- Parameters:
- cmd :
[]const u8
- cmd :
- Return type:
Error!void - Slots:
execute_command,log
Invocation¶
| Zig | |
|---|---|
One run of a command; valid during the callback only.
Invocation.success¶
| Zig | |
|---|---|
Sends a line of output.
- Parameters:
- msg :
[]const u8
- msg :
- Return type:
void
Invocation.failure¶
| Zig | |
|---|---|
Sends a line of error output.
- Parameters:
- msg :
[]const u8
- msg :
- Return type:
void
Permission¶
| Zig | |
|---|---|
Who may run a command, mirroring CommandPermissionLevel.