예제 #1
0
     $botSession->doPart();
     $botSession->finalize();
     die("success");
 } else {
     if ($action == "setCommand") {
         $channel = getChannelWithAuthOrDie($USER_ACCESS_LEVEL_MOD);
         $name = getParamOrDie('name');
         $oldName = getParam('oldName');
         $response = getParamOrDie('response');
         $restriction = getParamOrDie('restriction');
         if ($restriction != "everyone" && $restriction != "regular" && $restriction != "mod" && $restriction != "owner") {
             respondMessage("invalid parameter (restriction)");
         }
         $channelCoebotData = dbGetChannel($channel);
         $bot = $channelCoebotData['botChannel'];
         $botSession = BotSession::getBotSessionCurrentUser($bot, $channel);
         if ($oldName != NULL && $oldName != "" && $oldName != $name) {
             $botSession->doCommandRename($oldName, $name);
         }
         $botSession->doCommandAdd($name, $response);
         $botSession->doCommandRestrict($name, $restriction);
         $botSession->finalize();
         die("success");
     } else {
         if ($action == "delReqsong") {
             $channel = getChannelWithAuthOrDie($USER_ACCESS_LEVEL_OWNER);
             $id = getParamOrDie('id');
             if (!is_numeric($id)) {
                 respondMessage("invalid parameter (id)");
             }
             if (!dbDeleteReqsong($channel, $id)) {