-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
We want to introduce SendData
: an object that specifies all necessary information in order to send a message. This can be a string, or { text: string }
or { photo: photo }
, etc. Optionally, more parameters can be contained.
This lets us add ctx.send
. In grammY 2.0, you can then call ctx.send("message")
and ctx.send({ photo })
instead of ctx.reply("message")
and ctx.replyWithPhoto(photo)
.
Similar objects will be introduced for editing messages.
Similar objects will be introduced for calling arbitrary API methods.
This has many advantages:
- ctx.reply has nothing to do with replies so the name is misleading
- it is currently impossible to write a function that generates message data—if you want modularity, you must pass around the context object, which is bad
- menus have no way to edit their own content when they are being navigated to, and send data will make this much better
Naming ideas:
- send data
- send template
- send spec objects
- send blueprints
evermake
Metadata
Metadata
Assignees
Labels
No labels