Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
webwarrior-ws opened this issue Jul 30, 2024 · 5 comments · Fixed by #549
Closed

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

webwarrior-ws opened this issue Jul 30, 2024 · 5 comments · Fixed by #549

Comments

@webwarrior-ws
Copy link
Contributor

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.

@Catrya
Copy link
Member

Catrya commented Jul 30, 2024

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

@webwarrior-ws
Copy link
Contributor Author

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.

@Catrya
Copy link
Member

Catrya commented Jul 30, 2024

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

@webwarrior-ws
Copy link
Contributor Author

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

@knocte
Copy link
Contributor

knocte commented Jul 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants