+static struct cmd_binding *modcmd_sub_linker_command(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct cmd_binding *cbind, int bind_index, char **args_ptr) {
+ //links subcommands
+ char command[MAXLEN];
+ struct cmd_binding *parent_bind = cbind;
+ char *args = *args_ptr;
+ if(args) {
+ char *subcmd = args;
+ args = strchr(args, ' ');
+ if(args) {
+ *args = '\0';
+ args++;
+ }
+ sprintf(command, "%s %s", parent_bind->cmd, subcmd);
+ for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
+ if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && stricmp(cbind->cmd, command) == 0)
+ break;
+ }
+ *args_ptr = args;
+ if(cbind && cbind->func->func == modcmd_linker) {
+ return modcmd_linker_command(client, textclient, user, cbind, bind_index, args_ptr);
+ }
+ return (cbind ? cbind : parent_bind);
+ } else
+ return parent_bind;
+}
+