xbot/mods/test/test.c

23 lines
432 B
C
Raw Normal View History

#include "irc.h"
#include "events.h"
2015-04-06 23:56:50 -07:00
#include "module.h"
#include <stdio.h>
#include <stdlib.h>
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))
{
irc_privmsg(bot, chan, "hi %s", user);
}
free(buf);
}
2015-04-06 23:56:50 -07:00
void mod_init(void *handle, void (*export)())
{
2015-04-06 23:56:50 -07:00
export(handle, PRIVMSG_CHAN, "hello");
}