IRCBot Plugin API
v5
|
#include <plugins.h>
Public Attributes | |
USER *(* | GetUser )(const char *hostmask) |
USER *(* | GetUserByNick )(const char *nick) |
bool(* | IsValidUserName )(const char *nick) |
Check to see if a user with the username 'nick' exists. More... | |
uint32(* | GetUserCount )() |
Only returns users in your ircbot.db, not auth plugins. More... | |
void(* | EnumUsersByLastHostmask )(EnumUsersByLastHostmaskCallback callback, const char *hostmask, void *ptr) |
uint32(* | GetUserFlags )(const char *hostmask) |
Get the user flags for a particular hostmask. If it matches a user it will return their flags, if not it will return the user-defined default flags. More... | |
USER *(* | AddUser )(const char *nick, const char *pass, uint32 flags, bool temp) |
void(* | SetUserFlags )(USER *user, uint32 flags) |
Change a user's flags. More... | |
void(* | AddUserFlags )(USER *user, uint32 flags) |
Add flags to a user. More... | |
void(* | DelUserFlags )(USER *user, uint32 flags) |
Remove flags a user. More... | |
uint32(* | GetDefaultFlags )() |
Returns the default flags for a user without a bot account. More... | |
bool(* | uflag_have_any_of )(uint32 flags, uint32 wanted) |
int(* | uflag_compare )(uint32 flags1, uint32 flags2) |
void(* | uflag_to_string )(uint32 flags, char *buf, size_t bufSize) |
uint32(* | string_to_uflag )(const char *buf, uint32 cur) |
bool(* | Mask )(const char *hostmask, char *msgbuf, size_t bufSize, int type) |
uint32(* | GetLevelFlags )(int level) |
Returns the default flags for an old IRCBot user level. This is used by the LevelEmul plugin and shouldn't be used by other plugins. More... | |
void(* | SetLevelFlags )(int level, uint32 flags) |
Sets the default flags for an old IRCBot user level. This is used by the LevelEmul plugin and shouldn't be used by other plugins. More... | |
These functions are related to IRCBot user accounts and user flags.
USER*(* API_user::GetUser)(const char *hostmask) |
Get a handle to the user matching a certain hostmask.
hostmask | The hostmask to search for |
USER*(* API_user::GetUserByNick)(const char *nick) |
Get a handle to the user with a certain IRCBot username. (Remember: their bot username isn't always the same as their IRC nick, so if at all possible it's better to use API_user::GetUser with a hostmask!)
nick | The username to search for |
bool(* API_user::IsValidUserName)(const char *nick) |
Check to see if a user with the username 'nick' exists.
uint32(* API_user::GetUserCount)() |
Only returns users in your ircbot.db, not auth plugins.
void(* API_user::EnumUsersByLastHostmask)(EnumUsersByLastHostmaskCallback callback, const char *hostmask, void *ptr) |
uint32(* API_user::GetUserFlags)(const char *hostmask) |
Get the user flags for a particular hostmask. If it matches a user it will return their flags, if not it will return the user-defined default flags.
uint32(* API_user::GetDefaultFlags)() |
Returns the default flags for a user without a bot account.
Check if any of some wanted flag are in flags.
flags | A user's flags |
wanted | The flags you want them to have |
This function gives a general comparison of user rank based on their flags.
flags1 | User 1's flags. |
flags2 | User 2's flags. |
void(* API_user::uflag_to_string)(uint32 flags, char *buf, size_t bufSize) |
Given numeric user flags, it will create a string version for display (ie. +abcdefg)
flags | A user's flags |
buf | The char buffer to output to. |
bufSize | The size of buf |
Modifies user flags with a flag string and returns numerical user flags.
Strings must start with an operator: +, -, or =. As you would imagine + adds any following flags to the user's flags, - removes them, and = sets the flags obliterating any existing flags.
You can also mix and match operators inline.
Example: +abcdefg (adds abcdefg to user's flags)
Example: -abcdefg (removes abcdefg from user's flags)
Example: =abcdefg (sets user's flags to abcdefg, removing all others)
Example: +abc-def (adds abc to user's flags and removes def)
buf | The flag modification string |
cur | The user's current flags. |
bool(* API_user::Mask)(const char *hostmask, char *msgbuf, size_t bufSize, int type) |
Given a full hostmask, alter into a wildcard matching hostmask
Type 0: *!*user@*.host
Type 1: *!*@*.host
Type 2: nick!*user@*.host
Type 3: nick!*@*.host
hostmask | A full hostmask in nick!user@host form |
msgbuf | The buffer to load the altered hostmask in to |
bufSize | The size of your buffer |
type | The type of mask to apply, see list above. |
uint32(* API_user::GetLevelFlags)(int level) |
Returns the default flags for an old IRCBot user level. This is used by the LevelEmul plugin and shouldn't be used by other plugins.
void(* API_user::SetLevelFlags)(int level, uint32 flags) |
Sets the default flags for an old IRCBot user level. This is used by the LevelEmul plugin and shouldn't be used by other plugins.