Answers for "guzzle telegram message get"

0

guzzle telegram message get

<?php
	use GuzzleHttp\Client;
    require_once __DIR__ . '/vendor/autoload.php';

	CONST CHAT_ID = '~~';
    CONST TOKEN   = '~~';
    CONST BASE    = 'https://api.telegram.org/bot' . TOKEN;

    $client = new Client();
    $client->request('POST', BASE . '/sendMessage', [
        'query' => [
            'chat_id' => CHAT_ID,
            'text' => 'Hi Maxim!',
            'reply_markup' => json_encode([
                "inline_keyboard" => [
                    [
                        [
                            "text" => "Yes",
                            "callback_data" => "yes"
                        ],
                        [
                            "text" => "No",
                            "callback_data" => "no"
                        ]
                    ]
                ]
            ])
        ]
    ]);
?>
Posted by: Guest on August-04-2021

Code answers related to "guzzle telegram message get"

Browse Popular Code Answers by Language