#include "bot_NeonHelp.h"
#include "../../modcmd.h"
-#include "../../cmd_neonhelp.h"
+#include "cmd_neonhelp.h"
#include "../../lang.h"
#include "../../mysqlConn.h"
#include "../../ClientSocket.h"
cache->user = user;
cache->target = target;
cache->message = strdup(message);
- get_userauth(user, neonhelp_event_privmsg_nick_lookup, cache);
+ get_userauth(user, module_id, neonhelp_event_privmsg_nick_lookup, cache);
}
}
if(!timeq_name_exists(nameBuf)) {
int *cidptr = malloc(sizeof(int));
*cidptr = client->clientid;
- timeq_add_name(nameBuf, 300, neonhelp_remind_open_requests, cidptr);
+ timeq_add_name(nameBuf, 300, module_id, neonhelp_remind_open_requests, cidptr);
}
}
printf_mysql_query("INSERT INTO `helpserv_requests` (`botid`, `host`, `hand`, `nick`, `status`, `supporter`, `time`, `text`) VALUES ('%d', '%s@%s', '%s', '%s', '0', '-1', UNIX_TIMESTAMP(), '%s')", client->clientid, escape_string(user->ident), escape_string(user->host), ((user->flags & USERFLAG_ISAUTHED) ? escape_string(user->auth) : "*"), escape_string(user->nick), escape_string(message));
char nameBuf[30];
sprintf(nameBuf, "neonhelp_%d", client->clientid);
if(!timeq_name_exists(nameBuf)) {
- timeq_add_name(nameBuf, 300, neonhelp_remind_open_requests, data);
+ timeq_add_name(nameBuf, 300, module_id, neonhelp_remind_open_requests, data);
}
char replybuf[MAXLEN];
build_language_string(NULL, replybuf, (requests == 1 ? "NH_REMIND_OPEN_REQUESTS_1" : "NH_REMIND_OPEN_REQUESTS_2"), requests);
void init_NeonHelp(int type) {
set_bot_alias(BOTID, BOTALIAS);
- start_bots();
+ start_bots(type);
if(type == MODSTATE_REBIND) return;
//register events
- bind_bot_ready(neonhelp_bot_ready);
- bind_privmsg(neonhelp_event_privmsg);
- bind_chanmsg(neonhelp_event_chanmsg);
- bind_part(neonhelp_event_part);
- bind_kick(neonhelp_event_kick);
- bind_quit(neonhelp_event_quit);
+ bind_bot_ready(neonhelp_bot_ready, module_id);
+ bind_privmsg(neonhelp_event_privmsg, module_id);
+ bind_chanmsg(neonhelp_event_chanmsg, module_id);
+ bind_part(neonhelp_event_part, module_id);
+ bind_kick(neonhelp_event_kick, module_id);
+ bind_quit(neonhelp_event_quit, module_id);
- set_trigger_callback(BOTID, neonhelp_trigger_callback);
+ set_trigger_callback(BOTID, module_id, neonhelp_trigger_callback);
register_default_language_table(msgtab);
}