@overpod/mcp-telegram 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/telegram-client.d.ts +18 -0
- package/dist/telegram-client.js +39 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.22.0] - 2026-04-01
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- `TelegramService.setTyping(chatId, action?)` — send typing indicators with 10 action types: `typing`, `cancel`, `record_video`, `upload_video`, `record_audio`, `upload_audio`, `upload_photo`, `upload_document`, `choose_sticker`, `game_play` (#17)
|
|
14
|
+
- `TelegramService.getMessageById(chatId, messageId)` — fetch a single message by ID, returns formatted message object or `null`. Uses GramJS `ids` filter for exact lookup (#17)
|
|
15
|
+
|
|
10
16
|
## [1.21.0] - 2026-04-01
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -87,6 +87,24 @@ export declare class TelegramService {
|
|
|
87
87
|
blockUser(userId: string): Promise<void>;
|
|
88
88
|
reportSpam(chatId: string): Promise<void>;
|
|
89
89
|
markAsRead(chatId: string): Promise<void>;
|
|
90
|
+
private static TYPING_ACTIONS;
|
|
91
|
+
setTyping(chatId: string, action?: keyof typeof TelegramService.TYPING_ACTIONS): Promise<void>;
|
|
92
|
+
getMessageById(chatId: string, messageId: number): Promise<{
|
|
93
|
+
id: number;
|
|
94
|
+
text: string;
|
|
95
|
+
sender: string;
|
|
96
|
+
date: string;
|
|
97
|
+
media?: {
|
|
98
|
+
type: string;
|
|
99
|
+
fileName?: string;
|
|
100
|
+
size?: number;
|
|
101
|
+
};
|
|
102
|
+
reactions?: {
|
|
103
|
+
emoji: string;
|
|
104
|
+
count: number;
|
|
105
|
+
me: boolean;
|
|
106
|
+
}[];
|
|
107
|
+
} | null>;
|
|
90
108
|
forwardMessage(fromChatId: string, toChatId: string, messageIds: number[]): Promise<void>;
|
|
91
109
|
editMessage(chatId: string, messageId: number, newText: string): Promise<void>;
|
|
92
110
|
deleteMessages(chatId: string, messageIds: number[]): Promise<void>;
|
package/dist/telegram-client.js
CHANGED
|
@@ -526,6 +526,45 @@ export class TelegramService {
|
|
|
526
526
|
throw new Error(NOT_CONNECTED_ERROR);
|
|
527
527
|
await this.client.markAsRead(chatId);
|
|
528
528
|
}
|
|
529
|
+
static TYPING_ACTIONS = {
|
|
530
|
+
typing: () => new Api.SendMessageTypingAction(),
|
|
531
|
+
cancel: () => new Api.SendMessageCancelAction(),
|
|
532
|
+
record_video: () => new Api.SendMessageRecordVideoAction(),
|
|
533
|
+
upload_video: () => new Api.SendMessageUploadVideoAction({ progress: 0 }),
|
|
534
|
+
record_audio: () => new Api.SendMessageRecordAudioAction(),
|
|
535
|
+
upload_audio: () => new Api.SendMessageUploadAudioAction({ progress: 0 }),
|
|
536
|
+
upload_photo: () => new Api.SendMessageUploadPhotoAction({ progress: 0 }),
|
|
537
|
+
upload_document: () => new Api.SendMessageUploadDocumentAction({ progress: 0 }),
|
|
538
|
+
choose_sticker: () => new Api.SendMessageChooseStickerAction(),
|
|
539
|
+
game_play: () => new Api.SendMessageGamePlayAction(),
|
|
540
|
+
};
|
|
541
|
+
async setTyping(chatId, action = "typing") {
|
|
542
|
+
if (!this.client || !this.connected)
|
|
543
|
+
throw new Error(NOT_CONNECTED_ERROR);
|
|
544
|
+
const factory = TelegramService.TYPING_ACTIONS[action];
|
|
545
|
+
if (!factory)
|
|
546
|
+
throw new Error(`Unknown typing action: ${action}. Valid: ${Object.keys(TelegramService.TYPING_ACTIONS).join(", ")}`);
|
|
547
|
+
const resolved = await this.resolvePeer(chatId);
|
|
548
|
+
const peer = await this.client.getInputEntity(resolved);
|
|
549
|
+
await this.client.invoke(new Api.messages.SetTyping({ peer, action: factory() }));
|
|
550
|
+
}
|
|
551
|
+
async getMessageById(chatId, messageId) {
|
|
552
|
+
if (!this.client || !this.connected)
|
|
553
|
+
throw new Error(NOT_CONNECTED_ERROR);
|
|
554
|
+
const resolved = await this.resolvePeer(chatId);
|
|
555
|
+
const messages = await this.client.getMessages(resolved, { ids: [messageId] });
|
|
556
|
+
const m = messages[0];
|
|
557
|
+
if (!m || m.id !== messageId)
|
|
558
|
+
return null;
|
|
559
|
+
return {
|
|
560
|
+
id: m.id,
|
|
561
|
+
text: m.message ?? "",
|
|
562
|
+
sender: await this.resolveSenderName(m.senderId),
|
|
563
|
+
date: new Date((m.date ?? 0) * 1000).toISOString(),
|
|
564
|
+
media: this.extractMediaInfo(m.media),
|
|
565
|
+
reactions: this.extractReactions(m.reactions),
|
|
566
|
+
};
|
|
567
|
+
}
|
|
529
568
|
async forwardMessage(fromChatId, toChatId, messageIds) {
|
|
530
569
|
if (!this.client || !this.connected)
|
|
531
570
|
throw new Error(NOT_CONNECTED_ERROR);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overpod/mcp-telegram",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "MCP server for Telegram userbot — messages, media, reactions, polls & more. Built on GramJS/MTProto.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"url": "https://github.com/overpod/mcp-telegram/issues"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
56
56
|
"dotenv": "^17.3.1",
|
|
57
57
|
"qrcode": "^1.5.4",
|
|
58
58
|
"telegram": "^2.26.22",
|
|
59
59
|
"zod": "^4.3.6"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@biomejs/biome": "^2.4.
|
|
62
|
+
"@biomejs/biome": "^2.4.10",
|
|
63
63
|
"@types/node": "^25.5.0",
|
|
64
64
|
"@types/qrcode": "^1.5.6",
|
|
65
65
|
"tsx": "^4.21.0",
|