Sending messages correctly
How to send message correctly in a controller handler
Sending message as answer
In this code in start
method, you can see when the user writes command /start, the user gets the message Hello, world!
. What's method returns will be sent to the user
MessageSend class-method is a wrapper for the message: it allows you to add keyboard, options, photo, or media to the message
If you don't know what will return your method (e.g. MessageSend or Edit) you can use MessageCreator class as return type (import from root)
MessageSend class-method take arguments:
Content (media or text)
Required
Optional
Optional
Sometimes you can't use the class methods, for example when you want to get some info about the current chat, for that you can use the Answer class
Sending message line
You can also send more than one message, use the .next
method on the MessageSend class
.next method takes argument: content you want to send (it can be MessageSend class). It also can be a function or an async function
Last updated