#include "bot_NeonServ.h"
#include "modcmd.h"
#include "IRCEvents.h"
+#include "IRCParser.h"
#include "UserNode.h"
#include "ChanNode.h"
#include "ChanUser.h"
#include "ClientSocket.h"
#include "mysqlConn.h"
#include "lang.h"
+#include "HandleInfoHandler.h"
+#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}
};
*/
#include "cmd_neonserv_users.c"
#include "cmd_neonserv_modes.c"
+#include "cmd_neonserv_adduser.c"
static void neonserv_bot_ready(struct ClientSocket *client) {
MYSQL_RES *res;
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) {
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_REGISTERED_CHAN | CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH);
+
start_bots();
bind_bot_ready(neonserv_bot_ready);
set_trigger_callback(BOTID, neonserv_trigger_callback);
}
#undef BOTID
-#undef CLASSNAME