IRCBot Plugin API
v5
|
#include <plugins.h>
Public Attributes | |
COMMAND *(* | FindCommand )(const char *command) |
Finds the record of command. More... | |
COMMAND *(* | RegisterCommand_Action )(int pluginnum, const char *command, const COMMAND_ACL *acl, uint32 mask, const char *action, const char *desc) |
Register a simple IRC action command, this is the type of command defined in ircbot.text. See RegisterCommand_Proc for more detailed info. More... | |
COMMAND *(* | RegisterCommand_Proc )(int pluginnum, const char *command, const COMMAND_ACL *acl, uint32 mask, CommandProcType proc, const char *desc) |
void(* | UnregisterCommandsByPlugin )(int pluginnum) |
Unregisters all commands that were registered by pluginnum. More... | |
void(* | UnregisterCommandByName )(const char *command) |
Unregisters the command command. More... | |
void(* | UnregisterCommand )(COMMAND *command) |
Unregisters the commands with handle command (do not make the COMMAND structure yourself, it should be one returned by FindCommand. More... | |
char(* | PrimaryCommandPrefix )() |
This returns the primary command prefix (for displaying examples to users). Currently ! but may be user-configurable someday. More... | |
bool(* | IsCommandPrefix )(char ch) |
This returns true is character ch is a command prefix (!/@/?/etc.). This may be user-configurable someday so it's better to use this function than hardcode. More... | |
COMMAND_ACL *(* | FillACL )(COMMAND_ACL *acl, uint32 flags_have_all, uint32 flags_have_any, uint32 flags_not) |
Fills a COMMAND_ACL structure with the given flags. More... | |
COMMAND_ACL(* | MakeACL )(uint32 flags_have_all, uint32 flags_have_any, uint32 flags_not) |
Makes a COMMAND_ACL structure with the given flags and returns it. More... | |
int(* | ExecuteProc )(COMMAND *com, const char *parms, USER_PRESENCE *ut, uint32 type) |
Executes a command. If you have made a console interface you will need to create and manage the USER_PRESENCE and pass type as CM_ALLOW_CONSOLE_*. More... | |
void(* | RegisterCommandHook )(const char *command, CommandProcType hook_func) |
Registers a hook on a command so your handler will be called first. Return 0 to continue to the next hook or main command handler, or 1 if you handled it. More... | |
void(* | UnregisterCommandHook )(const char *command, CommandProcType hook_func) |
Registers a command hook. More... | |
This structure contains functions related to the commands system like registering a command, filling ACLs, etc.
COMMAND*(* API_commands::FindCommand)(const char *command) |
Finds the record of command.
COMMAND*(* API_commands::RegisterCommand_Action)(int pluginnum, const char *command, const COMMAND_ACL *acl, uint32 mask, const char *action, const char *desc) |
Register a simple IRC action command, this is the type of command defined in ircbot.text. See RegisterCommand_Proc for more detailed info.
COMMAND*(* API_commands::RegisterCommand_Proc)(int pluginnum, const char *command, const COMMAND_ACL *acl, uint32 mask, CommandProcType proc, const char *desc) |
Registers a command with the bot. The bot makes it's own copy of the string pointers and ACL so you don't need to keep copies around or anything.
pluginnum | Your plugin number as given to your plugin in PLUGIN_PUBLIC::init() |
command | The command's name (ie. request). This must not have a command prefix (for example: !request or @request would be incorrect) |
acl | A pointer to an COMMAND_ACL structure defining who can use the command. To allow anyone to use a command just fill it will all zeroes. |
mask | Which protocols can use the commands, one or more of the CM_ALLOW_* constants. |
proc | Your command handler |
desc | A short one-line description of the command. This is what users will see if they type !help command |
void(* API_commands::UnregisterCommandsByPlugin)(int pluginnum) |
Unregisters all commands that were registered by pluginnum.
void(* API_commands::UnregisterCommandByName)(const char *command) |
Unregisters the command command.
void(* API_commands::UnregisterCommand)(COMMAND *command) |
Unregisters the commands with handle command (do not make the COMMAND structure yourself, it should be one returned by FindCommand.
char(* API_commands::PrimaryCommandPrefix)() |
This returns the primary command prefix (for displaying examples to users). Currently ! but may be user-configurable someday.
bool(* API_commands::IsCommandPrefix)(char ch) |
This returns true is character ch is a command prefix (!/@/?/etc.). This may be user-configurable someday so it's better to use this function than hardcode.
COMMAND_ACL*(* API_commands::FillACL)(COMMAND_ACL *acl, uint32 flags_have_all, uint32 flags_have_any, uint32 flags_not) |
Fills a COMMAND_ACL structure with the given flags.
COMMAND_ACL(* API_commands::MakeACL)(uint32 flags_have_all, uint32 flags_have_any, uint32 flags_not) |
Makes a COMMAND_ACL structure with the given flags and returns it.
int(* API_commands::ExecuteProc)(COMMAND *com, const char *parms, USER_PRESENCE *ut, uint32 type) |
Executes a command. If you have made a console interface you will need to create and manage the USER_PRESENCE and pass type as CM_ALLOW_CONSOLE_*.
void(* API_commands::RegisterCommandHook)(const char *command, CommandProcType hook_func) |
Registers a hook on a command so your handler will be called first. Return 0 to continue to the next hook or main command handler, or 1 if you handled it.
void(* API_commands::UnregisterCommandHook)(const char *command, CommandProcType hook_func) |
Registers a command hook.