lnp2pBot/bot

"Bad Request: chat not found" when posting /buy or /sell commands

Closed this issue · 5 comments

I've been following installation instructions, and I'm stuck at "Using the bot" step.
Specifically, when posting /buy or /sell commands in the channel, bot doesn't respond and I have the following error in console:

error: 400: Bad Request: chat not found Error: 400: Bad Request: chat not found
    at Telegram.callApi (D:\Projects\work\lnp2pBot\node_modules\telegraf\lib\core\network\client.js:264:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I tried to use Telegram HTTP API to send message from bot using the same bot_token as in BOT_TOKEN property in .env and chat_id as CHANNEL property, and it succeeded.
https://api.telegram.org/bot{bot_token}/sendMessage?chat_id={chat_id}&text=hello
Bot is also admin in that channel, and ADMIN_CHANNEL is set to the right value.

when posting /buy or /sell commands in the channel

Hi, to create an order you must do it either directly within the bot, or from the group that you configured in HELP_GROUP in the .env
If you are trying to create it from the group chat, check that the bot is an admin with read and write permissions, and that you have correctly written its @username in your .env file

ADMIN_CHANNEL is for receiving notifications as admin, you cannot create an order from there

I posted commands to bot chat, or whatever it's called. And for example /listorders works and I get response from bot and no errors.

I posted commands to bot chat, or whatever it's called. And for example /listorders works and I get response from bot and no errors.

Check again that your bot is admin and has the permissions in the channel you put in CHANNEL , also verify that you have the @username correct (it is not the channel id, but the username) and try again to create an order from within your bot, or from the group that you put in HELP_GROUP

I finally solved it. Channel has to be public and part after t.me/ in link is what goes into CHANNEL property.

I finally solved it. Channel has to be public and part after t.me/ in link is what goes into CHANNEL property.

If this info was not in the documentation, please reopen this issue and create PR to add it.