Comments (3)
Automatic /help
handler is a sound idea very much indeed. That said, I find myself implementing /help
differently every single time. Sometimes you want to have some sort of a FAQ, sometimes it's just a brief explanation of core mechanics, but usually you don't want it auto-generated.
I also believe that such auto-generated /help
implementation must also account for Telegram's recent i18n support (see language_code
within User) and at this point I can't really tell whether such feature is worth it.
adding more arguments to the Handle func would be a breaking change
Not necessarily. Handle is a set-up function and isn't supposed to be used heavily (only a handful of times, during the bot init process), we can rely on reflection to add "optional" arguments:
// Definition
func (b *Bot) Handle(prefix string, features ...interface{}) {}
// Uses
bot.Handle("/action", func (c Context) {})
bot.Handle("/action", "Description", func (c Context) {})
from telebot.
That said, I find myself implementing /help differently every single time. Sometimes you want to have some sort of a FAQ, sometimes it's just a brief explanation of core mechanics, but usually you don't want it auto-generated.
I think most of the implementations I've seen (ie. BotFather) would fit in a basic modular scheme:
<optional Title>
<optional Text>(possibly a summary of the bots purpose and general use cases)
<optional Category Title>
<optional Category Text>
<optional Command> - <optional short command description>
I also believe that such auto-generated /help implementation must also account for Telegram's recent i18n support (see language_code within User) and at this point I can't really tell whether such feature is worth it.
Language support could also be done if each text was a map[string]string
. (although even Telegram themselves don't seem to use this feature afaik)
That said... You are probably right, it might not be worth the time to implement such a feature.
from telebot.
Closing for the time being. We might bring it back for v2.1
or whatever.
from telebot.
Related Issues (20)
- telebot: add AllUpdates flag for the long poller settings
- proposal: add a way to set the caption for Album
- api 6.5: implement HOT 1
- errors: bot is not a member of the channel chat
- How to generate a pop-up window when click the button? HOT 1
- Can't use localizer with layout HOT 2
- The callback loads forever HOT 1
- Telegram strips non-accessible URLs
- Payment example HOT 1
- [BUG] `telegram: chat not found (400)` HOT 2
- Skipping pending updates using LongPoller HOT 2
- how to use handle? HOT 4
- Do you have plans to update to API 7.0 HOT 1
- How get a body raw on json?
- Getting group list HOT 1
- How to check that user blocked and stop bot? HOT 1
- Is this project maintained? HOT 1
- Question: How to create default menu button? HOT 1
- layout: add ability to group keys in the locale file
- How to send an alert using bot instance? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telebot.