]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/chancmds/delchan.c
1 /* Automatically generated by refactor.pl.
7 * CMDDESC: Removes a channel from the bot.
8 * CMDFUNC: csc_dodelchan
9 * CMDPROTO: int csc_dodelchan(void *source, int cargc, char **cargv);
10 * CMDHELP: Usage: delchan <channel> [<reason>]
11 * CMDHELP: Removes a channel from the bot, reason is optional.
14 #include "../chanserv.h"
15 #include "../../nick/nick.h"
16 #include "../../lib/flags.h"
17 #include "../../lib/irc_string.h"
18 #include "../../channel/channel.h"
19 #include "../../parser/parser.h"
20 #include "../../irc/irc.h"
21 #include "../../localuser/localuserchannel.h"
25 int csc_dodelchan(void *source
, int cargc
, char **cargv
) {
27 reguser
*rup
=getreguserfromnick(sender
);
35 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "delchan");
39 if (!(cip
=findchanindex(cargv
[0])) || !(rcp
=cip
->exts
[chanservext
])) {
40 chanservstdmessage(sender
, QM_UNKNOWNCHAN
, cargv
[0]);
44 cs_log(sender
,"DELCHAN %s (%s)",cip
->name
->content
,cargc
>1?cargv
[1]:"");
45 cs_removechannel(rcp
);
46 chanservstdmessage(sender
, QM_DONE
);