-/* modcmd.c - NeonServ v5.2
+/* modcmd.c - NeonServ v5.3
* Copyright (C) 2011 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
{"MODCMD_ACCESS_DENIED", "Access denied."},
{"MODCMD_SUBCOMMANDS", "Subcommands of %s: %s"}, /* {ARGS: "bot", "ADD, DEL, EDIT"} */
{"MODCMD_CROSSCHAN", "You must be in %s (or on its userlist) to use this command."},
+ {"MODCMD_UNKNOWN", "$b%s$b is an unknown command."}, /* {ARGS: "bla"} */
{NULL, NULL}
};
args++;
}
struct cmd_binding *cbind;
+ int found_cmd = 0;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && stricmp(cbind->cmd, message) == 0) {
+ found_cmd = 1;
+ //get a text bot
+ tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0));
if(cbind->func->func == modcmd_linker) {
//links subcommands
char command[MAXLEN];
subcompos += sprintf(subcommands + subcompos, (subcompos ? ", %s" : "%s"), cbind->cmd + commandlen);
}
}
- reply(tmp_text_client, user, "MODCMD_SUBCOMMANDS", parent_bind->cmd, subcommands);
+ reply(tmp_text_client, user, "MODCMD_SUBCOMMANDS", parent_bind->cmd, (subcompos ? subcommands : "\1dnone\1d"));
break;
}
}
break;
chan = sent_chan;
}
- //get a text bot
- tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0));
//parse the arguments...
char *arga[MAXNUMPARAMS];
char **argv;
break;
}
}
+ if(!found_cmd && !sent_chan)
+ reply(get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0)), user, "MODCMD_UNKNOWN", message);
free(message);
if(args_buffer)
free(args_buffer);