The msg Variable¶
In TBL, msg is a simplified version of update that is available only for message updates.
It is designed to make working with normal messages easier.
Not the same as the msg instance
This page documents the global msg variable (read-only message context).
For message-sending methods like msg.replyText(), see the msg instance.
How msg Works¶
- When the update type is a message,
msgis available msgcontains the same object asupdate.message- If the update is not a message,
msgis not available
This means you don’t need to access the full update object for common message-based bots.
Important Notes¶
msgis available only for message updates- It is read-only
- It exists only during command execution
For simple bots that mainly handle messages, msg is often more convenient than using update.message directly.