added bot_NeonServ.c file
[NeonServV5.git] / bot_NeonServ.c
1
2 #include "bot_NeonServ.h"
3 #include "modcmd.h"
4 #include "UserNode.h"
5 #include "ChanNode.h"
6 #include "ChanUser.h"
7 #include "ClientSocket.h"
8
9 static CMD_BIND(neonserv_cmd_users) {
10     struct ChanUser *chanuser;
11     putsock(client, "PRIVMSG %s :[BOT JOIN] Users on this Channel:", chan->name);
12     for(chanuser = getChannelUsers(chan, NULL); chanuser; chanuser = getChannelUsers(chan, chanuser)) {
13         putsock(client, "PRIVMSG %s :  %s!%s@%s [%s]  rights: %d", chan->name, chanuser->user->nick, chanuser->user->ident, chanuser->user->host, ((chanuser->user->flags & USERFLAG_ISAUTHED) ? chanuser->user->auth : "*"), chanuser->flags);
14     }
15 }
16
17 static CMD_BIND(neonserv_cmd_modes) {
18     char modeBuf[MAXLEN];
19     getModeString(chan, modeBuf);
20     putsock(client, "PRIVMSG %s :Modes: %s", chan->name, modeBuf);
21 }
22
23 void init_NeonServ() {
24     register_command(0, "users", neonserv_cmd_users);
25     register_command(0, "modes", neonserv_cmd_modes);
26     
27     bind_cmd_to_command(0, "users", "users");
28     bind_cmd_to_command(0, "modes", "modes");
29 }
30
31 void free_NeonServ() {
32     
33 }