Message Types
MadelineProto provides typed message classes for different chat types:Message- Base message classPrivateMessage- Messages in private chatsGroupMessage- Messages in groupsChannelMessage- Messages in channelsSecretMessage- Messages in secret chats
Receiving Messages
Handle incoming messages using event handlers with type filters:Sending Text Messages
Using the Reply Method
The simplest way to respond to a message:Using sendMessage Method
Send messages to any chat:Advanced Message Options
Message Entities
MadelineProto automatically parses message entities:Available Entity Types
Bold- Bold textItalic- Italic textCode-Inline codePre- Code blocksUrl- URLsMention- @username mentionsHashtag- #hashtagBotCommand- /commandEmail- Email addressesPhone- Phone numbersCustomEmoji- Custom emojis
Editing Messages
Edit sent messages:Deleting Messages
Delete messages from chats:Replying to Messages
Check and get replied-to messages:Forwarding Messages
Forward messages between chats:Message Filters
Use filters to handle specific messages:Command Handling
MadelineProto automatically parses bot commands:Typing Indicators
Show typing indicators:Reading Messages
Mark messages as read:Message Properties
All available message properties:Working with Channels
Best Practices
Rate Limiting
Rate Limiting
Always handle FLOOD_WAIT errors:
Parse Mode Selection
Parse Mode Selection
Choose the right parse mode:
ParseMode::TEXT- No formatting, safe for user inputParseMode::MARKDOWN- Markdown syntaxParseMode::HTML- HTML tags
Message Validation
Message Validation
Always validate message content: