ACIL FM
Dark
Refresh
Current DIR:
/home/fastexsh/public_html/soodino/functions
/
home
fastexsh
public_html
soodino
functions
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
jdf.php
19.19 MB
chmod
View
DL
Edit
Rename
Delete
methods.php
3.56 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/fastexsh/public_html/soodino/functions/methods.php
<?php function TelegramRequest(string $method, array $data) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telegram.org/bot' . API_KEY . '/' . $method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); return json_decode($response); } function sendMessage($chat_id, $text, $keyboard = null, $reply_to = null) { return TelegramRequest("sendMessage", [ "chat_id" => $chat_id, "text" => $text, "reply_markup" => $keyboard, "reply_to_message_id" => $reply_to, "parse_mode" => "Markdown" ]); } function forwardMessage($chat_id, $from_chat_id, $message_id) { return TelegramRequest("forwardMessage", [ "chat_id" => $chat_id, "from_chat_id" => $from_chat_id, "message_id" => $message_id ]); } function editMessage($chat_id, $message_id, $text, $keyboard = null) { return TelegramRequest("editMessageText", [ "chat_id" => $chat_id, "message_id" => $message_id, "text" => $text, "reply_markup" => $keyboard, "parse_mode" => "Markdown" ]); } function deleteMessage($chat_id, $message_id) { return TelegramRequest("deleteMessage", [ "chat_id" => $chat_id, "message_id" => $message_id ]); } function editMessageReplyMarkup($chat_id, $message_id, $keyboard) { return TelegramRequest("editMessageReplyMarkup", [ "chat_id" => $chat_id, "message_id" => $message_id, "reply_markup" => $keyboard ]); } function answerCallback($callback_id, $text = null, $showAlert = false) { $params = [ "callback_query_id" => $callback_id ]; if ($text !== null) { $params["text"] = $text; } if ($showAlert) { $params["show_alert"] = true; } return TelegramRequest("answerCallbackQuery", $params); } function setStep($chat_id, $step) { global $pdo; $query = "UPDATE `users` SET `step` = ? WHERE `telegram_id` = ?"; $stmt = $pdo->prepare($query); $stmt->execute([$step, $chat_id]); } function generateTrackingId() { return "WD-" . random_int(1000000, 9999999); } function getSetting($key) { global $pdo; $stmt = $pdo->prepare("SELECT `value_` FROM `settings` WHERE `key_` = ? LIMIT 1"); $stmt->execute([$key]); $row = $stmt->fetch(); return $row ? $row->value_ : null; } function setSetting($key, $value) { global $pdo; $stmt = $pdo->prepare("SELECT `id` FROM `settings` WHERE `key_` = ? LIMIT 1"); $stmt->execute([$key]); $row = $stmt->fetch(); if ($row) { $stmt = $pdo->prepare("UPDATE `settings` SET `value_` = ? WHERE `key_` = ?"); $stmt->execute([$value, $key]); } else { $stmt = $pdo->prepare("INSERT INTO `settings` (`key_`, `value_`) VALUES (?, ?)"); $stmt->execute([$key, $value]); } } function isAdmin($username) { global $pdo; $query = " SELECT `id` FROM `accounts` WHERE `username` = ? AND `is_admin` = 1 LIMIT 1 "; $stmt = $pdo->prepare($query); $stmt->execute([$username]); return $stmt->fetch() ? true : false; }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply