Questions tagged [php-telegram-bot]

The telegram Bots are applications that can be used via telegram chat, the interaction is via Messages. The realization of these bots with PHP simplifies the work of a developer.

It is implemented by API and HTTP-based interface has all the methods of bot telegram (https://stackoverflow.com/tags/telegram-bot/info).

A simple way of use is:

define('BOT_TOKEN', '<YOUR-TOKEN>');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
define('FILE_URL', 'https://api.telegram.org/file/bot'.BOT_TOKEN.'/');

$content = file_get_contents("php://input");
$update = json_decode($content, true);

$message = isset($update['message']) ? $update['message'] : "";
$chatId = isset($message['chat']['id']) ? $message['chat']['id'] : "";
$text = isset($message['text']) ? $message['text'] : "";

header("Content-Type: application/json");
$parameters = array('chat_id' => $chatId, "text" => 'you wrote: '.$text);
$parameters["method"] = "sendMessage";
341 questions
-1
votes
1 answer

Cannot set the webhook of my Telegram Bot

I set the webhook of my Telegram Bot and it seems to work fine, but the bot doesn't reply when I try to write him. The code of the file I indicated as webhook is correct (I checked it with getupdates method) and the server where it's hosted has the…
-2
votes
1 answer

how to get user_id of my channel member when joined , by php and telegram api

I have a private channel in Telegram and a bot that I have added to the channel as a member of the administrators, and the web hook is also set to my php code file. I plan to manage the membership of the channel members with the Telegram web service…
-2
votes
1 answer

The dash comes to Telegram as Unicode – (wp site)

From my site on WP i send to Telegram chat new posts, I use get_the_title(), but if in the title have dash " - " in Telegram chat this displayed as – How this fix?
Nazar
  • 11
  • 5
-2
votes
1 answer

PHP Telegram best practises

I have written a website which links to a Telegram channel and provides "subscribers" with alerts when certain criteria are met. This is all fine. This works. I use the botfather and a bot however it's a pain to administer. Every week the telegram…
Chris
  • 546
  • 1
  • 4
  • 18
-2
votes
1 answer

Telegram bot keyboard PHP

I have written this function for my telegram bot in PHP but it doesn't work: if($text == "t"){ $keyboard = array( "inline_keyboard" => array( array( array( "text" => "My Button Text", …
Ace_69
  • 13
  • 1
  • 2
-2
votes
2 answers

ignore positive chat I'd telegram bot

I have webhook a telegram bot for search data my a hosted How can ignore positive chat I'd by bot I have a bot to search files from my hosted data And get link using telegram I want that bot just work in groups only If any person try to use it in…
-2
votes
1 answer

nothing happen on my telegeram bot

i want to create a Telegram bot, i write this codes, and also i set the Webhook, this code return the Json response from telegram bot to itself, but i don`t know why it is not working.. any help and guide will be appreciated. $token = 'my token'; //…
amin
  • 1
  • 4
-2
votes
1 answer

How to send external link to the telegram group from my bot using php? what should be the value to reply_markup in the link?

I am using the telegram bot to send some text with external link in it as a button. i have tried with following code bot i dont know the Json value to send. please, can anybody can help me? $sendMsg =…
-2
votes
1 answer

How to get the name of Telegram bot with PHP

I'm trying to make a custom management system for Telegram bots so that I can be able to send and read updates easily.. But my main problem is that I don't know how to retrieve data from an array. let me explain this in depth so you can understand…
user7424490
-4
votes
1 answer

Telegram Bot sub menus in PHP

I'm programming a telegram bot in php, and everything is working, except that now I want to add sub menus inside my cases of the switch. For example, the user puts '/insertcolour', then the bots sends a message "Insert your favourite colour" and…
Adrian
  • 7
  • 2
-4
votes
2 answers

Export Competitor’s Members - Telegram - Opensource

Is there any Telegram Bot to Export your competitor’s group/channel members and add to your own group/channel. Excellent way to grow your telegram group.
1 2 3
22
23