(telegramType: string)
| 46 | * 将 Telegram 聊天类型映射到 ChatLab 聊天类型 |
| 47 | */ |
| 48 | export function mapChatType(telegramType: string): ChatType { |
| 49 | switch (telegramType) { |
| 50 | case 'personal_chat': |
| 51 | case 'bot_chat': |
| 52 | case 'saved_messages': |
| 53 | return ChatType.PRIVATE |
| 54 | case 'private_group': |
| 55 | case 'public_group': |
| 56 | case 'private_supergroup': |
| 57 | case 'public_supergroup': |
| 58 | case 'private_channel': |
| 59 | case 'public_channel': |
| 60 | return ChatType.GROUP |
| 61 | default: |
| 62 | return ChatType.GROUP |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * 提取 Telegram text 字段为纯文本 |
no outgoing calls
no test coverage detected