laravel-notification-channels / telegram

✈️ Telegram Notifications Channel for Laravel
https://laravel-notification-channels.com/telegram/
MIT License
970 stars 163 forks source link

Telegram responded with an error `400 - Bad Request: chat not found` #92

Closed mdtanjilhasan closed 3 years ago

mdtanjilhasan commented 4 years ago

1 2 3 4 5 6

irazasyed commented 4 years ago

Please check the bot token is correct and that you've messaged & obtained the chat id from the same bot which is configured.

Chat IDs are unique to each bot for every user and cannot be shared/reused.

mdtanjilhasan commented 4 years ago

I have tried with another bot chat id, i have got same error. The token is correct cause, i can send text via bot api.

On Thu, Sep 24, 2020, 6:29 PM Irfaq Syed notifications@github.com wrote:

Please check the bot token is correct and that you've messaged & obtained the chat id from the same bot which is configured.

Chat IDs are unique to each bot for every user and cannot be shared/reused.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/laravel-notification-channels/telegram/issues/92#issuecomment-698312235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGKSF4DEPA3JLV2DQISBW3SHM3RDANCNFSM4RX526UQ .

irazasyed commented 4 years ago

You can't use "another bot" chat id. I just tested this on a fresh project and I can send the notification without issues.

Here's how it should be:

Do not mix with different bots.

Also, what version of Laravel and this channel lib you're using?

mdtanjilhasan commented 4 years ago

I have done the steps appropriately. Laravel 7 and latest version on the package

On Thu, Sep 24, 2020, 6:59 PM Irfaq Syed notifications@github.com wrote:

You can't use "another bot" chat id. I just tested this on a fresh project and I can send the notification without issues.

Here's how it should be:

  • Bot A Token is configured.
  • You message Bot A.
  • You save the chat ID of the user gotten to your Bot A.
  • You use that chat ID to send notifications from your Bot A.

Do not mix with different bots.

Also, what version of Laravel and this channel lib you're using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/laravel-notification-channels/telegram/issues/92#issuecomment-698327868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGKSF3QH7EDPXB3NGN5Q3LSHM7DXANCNFSM4RX526UQ .

robin-dongbin commented 3 years ago

Same issue here.

punyflash commented 3 years ago

Telegram bots can't send messages to user, if that user hasn't started conversation with bot yet, or bot is not present in chat (if it's a group chat). This issue is not related to the library, this is simply Telegram restriction, so that bots can't spam users without their permission.

robin-dongbin commented 3 years ago

Telegram bots can't send messages to user, if that user hasn't started conversation with bot yet, or bot is not present in chat (if it's a group chat). This issue is not related to the library, this is simply Telegram restriction, so that bots can't spam users without their permission.

Just use Http request can send messages,but use this package not work

gorkau commented 3 years ago

You can use a Telegram bot named @userinfobot to get the ID of a user. Beware, there are many accounts named @userinfobot, use them only if they are a bot.

Ryllaz commented 3 years ago

Telegram bots can't send messages to user, if that user hasn't started conversation with bot yet, or bot is not present in chat (if it's a group chat). This issue is not related to the library, this is simply Telegram restriction, so that bots can't spam users without their permission.

Just use Http request can send messages,but use this package not work

Same issue.

@gorkau your advice working, sending to user_id works fine.

But I think that package should send messages by user's login as well

nguyentranchung commented 3 years ago

@mdtanjilhasan

In group, you type any message begin with /, ex: /hellobot

Then open in web browser

https://api.telegram.org/bot/getUpdates

Find /hellobot and you can see: Selection_004

You can take chat id

daviddprtma commented 1 day ago

Please check the bot token is correct and that you've messaged & obtained the chat id from the same bot which is configured.

Chat IDs are unique to each bot for every user and cannot be shared/reused.

Today I get the same issue like as the authors issue. I want to know about where can I get my chatID? is it in my telegram bot?