Telegram-bot-sdk: Chat not found

Created on 8 Mar 2017  路  3Comments  路  Source: irazasyed/telegram-bot-sdk

I can not send messages using the username of the destination, for example: @user
When I try to send, the following message appears:
TelegramResponseException in TelegramResponseException.php line 58:
Bad Request: chat not found

Has anyone ever come across this?

Most helpful comment

@username as chat_id can only be used to send messages to channels and supergroups. It is not possible to send messages to private chats using username.
https://core.telegram.org/bots/api/#sendmessage

All 3 comments

@username as chat_id can only be used to send messages to channels and supergroups. It is not possible to send messages to private chats using username.
https://core.telegram.org/bots/api/#sendmessage

@danilopinotti if you're looking to simply send a message to a specific user, you need to provide your bot with the user's ID. To get the user's ID, use @userinfobot in telegram client for that user. It will return user's handle, ID and the name.

Here is a link: https://t.me/userinfobot

You can try this on telegram.php

'bots' => [
'common' => [
'username' => 'Your_BOT',
'token' => 'YourTokenBOT-ex:1234567:ABCDEFGHIKLMNOPZ',
],

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mccarlosen picture mccarlosen  路  3Comments

chaskayu picture chaskayu  路  4Comments

jobs2008 picture jobs2008  路  3Comments

khalilst picture khalilst  路  3Comments

YaroslavStrigun picture YaroslavStrigun  路  4Comments