2015-03-27 15:44:40 +00:00
|
|
|
#include "irc.h"
|
|
|
|
#include "events.h"
|
2015-04-07 06:56:50 +00:00
|
|
|
#include "module.h"
|
2015-03-27 15:44:40 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2015-04-08 18:56:32 +00:00
|
|
|
int HANDLER = 0;
|
|
|
|
|
2015-03-27 15:44:40 +00:00
|
|
|
void hello(struct irc_conn *bot, char *user, char *chan, char *text)
|
|
|
|
{
|
|
|
|
char *buf = (char *)malloc(sizeof(char *) * 500);
|
|
|
|
sprintf(buf, "hi %s", bot->nick);
|
|
|
|
|
|
|
|
if (!strcmp(text, buf))
|
|
|
|
{
|
2015-04-18 15:51:15 +00:00
|
|
|
irc_privmsg(bot, chan, "hi %s", user);
|
2015-03-27 15:44:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
free(buf);
|
|
|
|
}
|
|
|
|
|
2015-04-07 18:18:24 +00:00
|
|
|
void mod_init()
|
2015-03-27 15:44:40 +00:00
|
|
|
{
|
2015-04-08 18:56:32 +00:00
|
|
|
HANDLER = add_handler(PRIVMSG_CHAN, hello);
|
2015-03-27 15:44:40 +00:00
|
|
|
}
|