question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Send a menu to a chat id

See original GitHub issue

Describe your goal I wan’t to send the user a menu from external events, so no context exists. Is this even possible?

I’m sorry if this question is a duplicate and I missed the issue where this is covered!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
EdJoPaTocommented, Oct 28, 2020

When I saw that function in the readme i wondered why telegram had to be supplied on the resulting function each time. Like “that should have been refactored”… Looks like it was but someone (ehm…) forgot to update that. Thanks for your time looking into that!

1reaction
EdJoPaTocommented, Oct 26, 2020

You need the same Context as the MenuTemplate<Context> has. That can be anything. (The Template is different to the MenuMiddleware<Context extends TelegrafContext> which requires the context to be at least what Telegraf offers.)

Because of that you can create very simple templates requiring only a few things in the context (or even nothing). Everything your Template uses from the context has to be provided. MenuMiddleware provides the context of Telegraf for the Template. If you send the menu yourself you have to provide the context yourself. But you can decide what has to be in there.

For example if your template uses the session then someone has to provide the session into the context. If you don’t use the session from the template, you don’t need to provide it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telegram Bot - how to get a group chat id? - Stack Overflow
Use the "id" of the "chat" object to send your messages. ... group name on the left menu; click 'inspect' button; you will...
Read more >
How to Find a Chat ID in Telegram - Alphr
1. Tap to open the Telegram app. 2. In the top-right corner, tap on the small magnifying glass icon. 3. Type @RawDataBot in...
Read more >
Chat Plugin - Messenger Platform - Meta for Developers
This document shows you how to programmatically add the Chat Plugin to your ... Your business can then use the user reference ID...
Read more >
Add a Bot Options Menu to the Chat Window (Optional)
To let your customers know what your bot can do and to provide consistent navigation, add a persistent options menu to the chat...
Read more >
Send Notifications Using Chat API | Courier Docs
Looking for a way to send notifications via Chat API? This step-by-step tutorial will show you how to integrate Chat API the easy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found