struct cmd_binding *cbind;
for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
if(cbind->botid == client->botid && stricmp(cbind->cmd, message) == 0) {
+ if((cbind->flags & CMDFLAG_FUNCMD)) {
+ if(!sent_chan)
+ break;
+ chan = sent_chan;
+ }
//get a text bot
tmp_text_client = get_prefered_bot(client->botid);
//parse the arguments...
}
}
-void register_bot_alias(int botid, char *alias) {
+void register_command_alias(int botid, char *alias) {
struct cmd_bot_alias *botalias;
for(botalias = bot_aliases; botalias; botalias = botalias->next) {
if(!stricmp(botalias->alias, alias))
bot_aliases = botalias;
}
+struct cmd_binding *getAllBinds(struct cmd_binding *last) {
+ int bind_index;
+ if(last) {
+ if(last->next)
+ return last->next;
+ bind_index = get_binds_index(last->cmd[0]) + 1;
+ if(bind_index > 26)
+ return NULL;
+ } else
+ bind_index = 0;
+ do {
+ if(cmd_binds[bind_index])
+ return cmd_binds[bind_index];
+ bind_index++;
+ } while(bind_index < 27);
+ return NULL;
+}