예제 #1
0
/**
 * Executes a db-query.
 * This function is needed if your want to output your db-queries for debug-reasons.
 */
function executeQuery($database, $query)
{
    debugEcho("executing: " . $query . "...");
    try {
        if ($result = $database->query($query)) {
            debugEcho("OK.");
            return TRUE;
        } else {
            debugEcho("Error!");
            return FALSE;
        }
        debugEcho("</br>");
    } catch (Exception $e) {
        debugEcho("<br>Error executing Query." . $query . "<br>");
    }
}
예제 #2
0
파일: index.php 프로젝트: and-rom/pwgen-bot
function sendSticker($sticker, $chat, $reply_markup = "", $disable_notification = "0", $reply_to_message_id = NULL)
{
    global $debug;
    debugEcho("Sendig sticker");
    $reply_markup = $reply_markup ? "&reply_markup=" . $reply_markup : "";
    $disable_notification = "&disable_notification=" . $disable_notification;
    $reply_to_message_id = isset($reply_to_message_id) ? "&reply_to_message_id=" . $reply_to_message_id : "";
    if ($debug) {
        echo "Sticker id: " . $sticker . "\n";
    } else {
        $text = urlencode($text);
        $request = BASEURL . 'sendSticker?chat_id=' . $chat . '&sticker=' . $sticker . $reply_markup . $reply_to_message_id . $disable_notification;
        file_get_contents($request);
    }
}