Comments (2)
If I do this:
if ($text == "/forward") {
$reply = "Message to Forward";
$content = array('chat_id' => $chat_id, 'text' => $reply);
$response = $telegram->sendMessage($content);
//$fd_c=$response['result']['message']['forward_from_chat']['id'];
$fd_i=$response['result']['message_id'];
$content=array('chat_id' => $chat_id , 'from_chat_id' => $chat_id, 'message_id' => $fd_i);
$telegram->forwardMessage($content);
}
The message is correctly forwarded to the same chat. The differences are the use of ['return'] to take the data and I don't use the field forward_from_chat (wich is present only if the message was already forwarded).
A quick way to check the reply sended from telegram in append this toyour command:
$response = $telegram->stuff();
$reply= print_r($response, true);
$content = array('chat_id' => $chat_id, 'text' => $reply);
$telegram->sendMessage($content);
from telegrambotphp.
thank you for this code.
delete this line and change to it:
//$fd_c=$response['result']['message']['forward_from_chat']['id'];
$fd_i=$response['result']['message_id'];
$content=array('chat_id' => $chat_id , 'from_chat_id' => $chat_id, 'message_id' => $fd_i);
work perfectly and correctly.
thanks a lot of
from telegrambotphp.
Related Issues (20)
- $telegram->getUpdateType()=='channel_post' not receiving channel updates HOT 1
- Unable to get phone number HOT 1
- Telegram::getChatMembersCount() method
- [BUG]
- Hi~~ @Eleirbag89 pls delete this issue,thanks!
- Web Apps HOT 8
- UpdateCount[BUG] HOT 2
- payment function HOT 1
- you have any video for this bot like tutorial ? HOT 1
- How to make wait for answer HOT 2
- Can you create .phar file for this project HOT 9
- [BUG]
- ErrorException Undefined array key "message" when using funtion UserID() HOT 3
- Formatting options HOT 3
- sendMediaGroup not working! HOT 1
- How to get user_id of the message of a user I reply to? HOT 1
- Add API Support for up to API 6.9 (22.09.2023) HOT 1
- Please Add Forward From Username HOT 1
- My button not a have actions
- how to send sticker HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegrambotphp.