Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save untillnesss/345f71bf4844c0651966b9a637a73eb6 to your computer and use it in GitHub Desktop.
Save untillnesss/345f71bf4844c0651966b9a637a73eb6 to your computer and use it in GitHub Desktop.
// Set Telegram bot webhook url
https://api.telegram.org/bot<Your-Bot-token>/setWebhook?url=<Your-webhook-url>
// Get Telegram bot webhook url info
https://api.telegram.org/bot<Your-Bot-token>/getWebhookInfo
// Get Telegram bot file path
https://api.telegram.org/bot<Your-Bot-token>/getFile?file_id=<Your-file-id>
// Download Telegram bot file / Image
https://api.telegram.org/file/bot<Your-Bot-token>/<Your-file-path>
//Telegram Test Message structure
array (
'update_id' => 691514221,
'message' =>
array (
'message_id' => 55,
'from' =>
array (
'id' => <chat_id>,
'is_bot' => false,
'first_name' => 'ScaleUp',
'last_name' => 'Saas',
'language_code' => 'en',
),
'chat' =>
array (
'id' => <chat_id>,
'first_name' => 'ScaleUp',
'last_name' => 'Saas',
'type' => 'private',
),
'date' => 1679515515,
'text' => 'test',
),
)
// Telegram Image Message structure
array (
'update_id' => 691514222,
'message' =>
array (
'message_id' => 57,
'from' =>
array (
'id' => <chat_id>,
'is_bot' => false,
'first_name' => 'ScaleUp',
'last_name' => 'Saas',
'language_code' => 'en',
),
'chat' =>
array (
'id' => <chat_id>,
'first_name' => 'ScaleUp',
'last_name' => 'Saas',
'type' => 'private',
),
'date' => 1679515542,
'photo' =>
array (
0 =>
array (
'file_id' => 'AgACAgQAAxkBAAM5ZBtflnQ5vkwqMsEnbTOqU-FTu1kAArjAMRvh1dlQP22d2dR0EnFp3S8UBAAMCAANtAAMvBA',
'file_unique_id' => 'AQADuMAxG-HV4VB4',
'file_size' => 864,
'width' => 90,
'height' => 35,
),
1 =>
array (
'file_id' => 'AgACAgQAAxkBAAM5ZBtflnQ5vkwqMsEnbTOqU-FTu1kAArjAMRvh1dlQP22d2dR0EnFp3S8UBAAMCAANtAAMvBA',
'file_unique_id' => 'AQADuMAxG-HV4VBy',
'file_size' => 12180,
'width' => 320,
'height' => 123,
),
2 =>
array (
'file_id' => 'AgACAgQAAxkBAAM5ZBtflnQ5vkwqMsEnbTOqU-FTu1kAArjAMRvh1dlQP22d2dR0EnFp3S8UBAAMCAANtAAMvBA',
'file_unique_id' => 'AQADuMAxG-HV4VB9',
'file_size' => 29913,
'width' => 748,
'height' => 287,
),
),
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment