NewMessage Overview
TheNewMessage object is the primary structure for incoming message updates in Gogram. It provides a rich set of methods to interact with the message, its sender, and the chat it belongs to.
Structure
Basic Properties
Message Information
Message ID
Returns the plain text of the message.
Unix timestamp of when the message was sent.
Sender Information
Returns the ID of the user or chat that sent the message.
Fetches the full sender object.
Chat Information
Returns the ID of the chat where the message was sent.
Returns the type of chat:
user, chat, or channel.Interactive Methods
Sending Replies
Media Access
| Method | Description |
|---|---|
.Photo() | Returns photo object or nil. |
.Video() | Returns video object or nil. |
.Document() | Returns document object or nil. |
.Sticker() | Returns sticker object or nil. |
.Voice() | Returns voice note object or nil. |
.MediaType() | Returns string type of media (e.g., “photo”). |