X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=bot_NeonServ.c;h=8621d92bd0a868dc6c6094d495d07c21606c765d;hb=db818bf4952ccd5eda06f7ccbbe2283db1414065;hp=207450148cb7773dffeeceb8b0c0914909b496a1;hpb=1b5cf26eda4e8ed261e7cde1fc3ae8b0e082de92;p=NeonServV5.git diff --git a/bot_NeonServ.c b/bot_NeonServ.c index 2074501..8621d92 100644 --- a/bot_NeonServ.c +++ b/bot_NeonServ.c @@ -13,13 +13,14 @@ #include "WHOHandler.h" #define BOTID 1 -#define CLASSNAME "NeonServ" static const struct default_language_entry msgtab[] = { {"NS_USER_UNKNOWN", "User with nick \002%s\002 does not exist."}, {"NS_AUTH_UNKNOWN", "Account \002%s\002 has not been registered."}, {"NS_USER_NEED_AUTH", "%s must first authenticate with \002AuthServ\002."}, {"NS_INVALID_ACCESS", "\002%d\002 is an invalid access level."}, + {"NS_ADDUSER_ALREADY_ADDED", "%s is already on the \002%s\002 user list (with access %d)."}, + {"NS_ADDUSER_DONE", "Added %s to the %s user list with access %d."}, {NULL, NULL} }; @@ -60,7 +61,7 @@ static void start_bots() { MYSQL_RES *res, *res2; MYSQL_ROW row; - printf_mysql_query("SELECT `nick`, `ident`, `realname`, `server`, `port`, `pass`, `whoisbot`, `id` FROM `bots` WHERE `botclass` = '%s' AND `active` = '1'", escape_string(CLASSNAME)); + printf_mysql_query("SELECT `nick`, `ident`, `realname`, `server`, `port`, `pass`, `whoisbot`, `id` FROM `bots` WHERE `botclass` = '%d' AND `active` = '1'", BOTID); res = mysql_use(); while ((row = mysql_fetch_row(res)) != NULL) { @@ -95,7 +96,7 @@ void init_NeonServ() { register_command(BOTID, "users", neonserv_cmd_users, 1, CMDFLAG_REQUIRE_CHAN | CMDFLAG_REQUIRE_AUTH); register_command(BOTID, "modes", neonserv_cmd_modes, 1, CMDFLAG_REQUIRE_CHAN | CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH); - register_command(BOTID, "adduser", neonserv_cmd_adduser, 2, CMDFLAG_REQUIRE_CHAN | CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH); + register_command(BOTID, "adduser", neonserv_cmd_adduser, 2, CMDFLAG_REQUIRE_CHAN | CMDFLAG_REGISTERED_CHAN | CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH); start_bots(); bind_bot_ready(neonserv_bot_ready); @@ -109,4 +110,3 @@ void free_NeonServ() { } #undef BOTID -#undef CLASSNAME