ptgc
MTProto client for Dart

Messaging

Part of the API Reference. Reached via client.messages. Not the focus of ptgc (that’s Member Management), but included since a user-account client without basic messaging would be of limited use for verifying/exercising the rest of the API.

sendMessage

Future<int> sendMessage(int chatId, String text) async {

Sends a plain-text message to chatId (a user, basic group, or supergroup/channel — resolved automatically). Returns the new message’s ID.

forwardMessages

Future<void> forwardMessages(
    int fromChatId, List<int> messageIds, int toChatId) async {

Forwards messageIds from fromChatId to toChatId, preserving the “Forwarded from” attribution.

deleteMessages

Future<void> deleteMessages(int chatId, List<int> messageIds,
    {bool revokeForEveryone = true}) async {

Deletes messageIds from chatId. revokeForEveryone deletes them for the other participant(s) too where Telegram allows it (always true in your own DMs/groups; time-limited elsewhere).