} if (count($row) == 0) { $db->exec("INSERT INTO CPRTeam_STAFF (uid, username) VALUES ('{$fromID}','{$userName}')"); } else { $db->exec("UPDATE CPRTeam_STAFF SET username = '******' WHERE uid = '{$fromID}'"); } } if (substr($message, 0, 1) == "/") { if (in_array($fromID, $users) || in_array($chatID, $groups)) { $cmd = str_replace(strtolower("@" . BOT_NAME), '', strtolower($message)); switch ($cmd) { case "/help": help(); break; case "/uptime": uptime(); break; case "/tagall": tagall(); break; case "/pull": git_pull(); break; default: break; } } else { sendMsg("你沒有權限喔~~~~~"); } } }
foreach (${"_" . _STYPE}['branch'] as $key => $branch) { $url = ${"_" . _STYPE}['url'][$key]; if ($url != '' && $branch != '') { $source[] = array($branch, $url); } } // Save the changes to file save_list(${"_" . _STYPE}['dir'], $source, ${"_" . _STYPE}['id']); // Then reload the file to propogate the changes list($directory, $sources) = parse_list(); break; case 1: // Pull from sources //$rslt = git_pull_all($directory,$sources); $id = ${"_" . _STYPE}['id']; $rslt = git_pull($directory[$id], $sources[$id]); break; case 2: // Init new repo break; case 3: // Delete this repo break; case 4: // Git log //$rslt = git_log_all($directory); $rslt = git_log(${"_" . _STYPE}['dir']); break; } } else { echo "";