IRCBot Plugin API  v5
Public Attributes | List of all members
PLUGIN_PUBLIC Struct Reference

#include <plugins.h>

Public Attributes

unsigned char plugin_ver
 The bot binary ABI identifier, you should always set this to IRCBOT_PLUGIN_VERSION instead of setting it manually. More...
 
char * guid
 The unique GUID for your plugin. It should be in "registry" format, and please use a real GUID generator and don't try to freehand it. More...
 
char * plugin_name_short
 The short name of your plugin, it should be 3 or less words and NOT have a version number or anything in it. More...
 
char * plugin_name_long
 The long name of your plugin with version info (if you want). More...
 
char * plugin_author
 The name of the author of this plugin. (Can be a person, company, URL, whatever). More...
 
int(* init )(int num, BOTAPI *BotAPI)
 
void(* quit )()
 
int(* message )(unsigned int msg, char *data, int datalen)
 
int(* on_text )(USER_PRESENCE *ut, const char *msg)
 
int(* on_notice )(USER_PRESENCE *ut, const char *msg)
 
int(* raw )(int netno, char *msg)
 
int(* remote )(USER_PRESENCE *ut, unsigned char cliversion, REMOTE_HEADER *head, char *data)
 
DL_HANDLE hInstance
 
void * private_struct
 

Member Data Documentation

unsigned char PLUGIN_PUBLIC::plugin_ver

The bot binary ABI identifier, you should always set this to IRCBOT_PLUGIN_VERSION instead of setting it manually.

char* PLUGIN_PUBLIC::guid

The unique GUID for your plugin. It should be in "registry" format, and please use a real GUID generator and don't try to freehand it.

char* PLUGIN_PUBLIC::plugin_name_short

The short name of your plugin, it should be 3 or less words and NOT have a version number or anything in it.

char* PLUGIN_PUBLIC::plugin_name_long

The long name of your plugin with version info (if you want).

char* PLUGIN_PUBLIC::plugin_author

The name of the author of this plugin. (Can be a person, company, URL, whatever).

int(* PLUGIN_PUBLIC::init)(int num, BOTAPI *BotAPI)

Called when the bot is loading your plugin.

Parameters
numYour plugin number
BotAPIA pointer to the bot's plugin API.
Returns
0 if your plugin load failed, 1 for success.
void(* PLUGIN_PUBLIC::quit)()

Called when the bot is unloading your plugin

int(* PLUGIN_PUBLIC::message)(unsigned int msg, char *data, int datalen)

This function handles messages from the bot and other plugins ranging from incoming text, stats, etc.
See common_messages.h for information on individual messages.

Parameters
msgThe message ID
dataThe data sent with the message
datalenThe length of the data sent with the message. If datalen == 0 then data may or may not be a NULL ptr
Returns
0 to let other plugins handle the message, 1 otherwise.
int(* PLUGIN_PUBLIC::on_text)(USER_PRESENCE *ut, const char *msg)

Called when either:
a) The bot is PMed with any text, OR
b) In-channel messages that begin with a command prefix (!, @, etc.)

Parameters
utUSER_PRESENCE handle
msgthe message from IRC
Returns
0 to let the bot and/or other plugins handle the message, 1 otherwise.
int(* PLUGIN_PUBLIC::on_notice)(USER_PRESENCE *ut, const char *msg)

Called when either:
a) The bot is noticed with any text, OR
b) In-channel notices are received regadless of what they are prefixed with

Parameters
utUSER_PRESENCE handle
msgthe notice from IRC
Returns
0 to let the bot and/or other plugins handle the notice, 1 otherwise.
int(* PLUGIN_PUBLIC::raw)(int netno, char *msg)

Called on each incoming raw IRC line.

Parameters
netnoThe network number the line was received from
msgThe line
Returns
0 to let the bot and/or other plugins handle the message, 1 otherwise.
int(* PLUGIN_PUBLIC::remote)(USER_PRESENCE *ut, unsigned char cliversion, REMOTE_HEADER *head, char *data)

Called when a packet is received on a remote connection.

Parameters
utUSER_PRESENCE handle
cliversionThe client's protocol version
headThe REMOTE_HEADER containing the command and data length
dataThe data sent with the command. If data len is 0 data may or may not be a NULL ptr
Returns
0 to let the bot and/or other plugins handle the packet, 1 otherwise.
DL_HANDLE PLUGIN_PUBLIC::hInstance
void* PLUGIN_PUBLIC::private_struct

The documentation for this struct was generated from the following file: