mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51634c1caf | ||
|
|
0e00da6617 |
@@ -35,6 +35,7 @@ required_deps = {
|
||||
"telegram": "python-telegram-bot",
|
||||
"certifi": "certifi",
|
||||
"mcp": "mcp",
|
||||
"telegramify_markdown":"telegramify-markdown",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,13 +31,6 @@ spec:
|
||||
type: int
|
||||
required: true
|
||||
default: 2288
|
||||
- name: host
|
||||
label:
|
||||
en_US: Host
|
||||
zh_CN: 监听主机
|
||||
type: string
|
||||
required: true
|
||||
default: 0.0.0.0
|
||||
execution:
|
||||
python:
|
||||
path: ./slack.py
|
||||
|
||||
@@ -4,7 +4,7 @@ import telegram
|
||||
import telegram.ext
|
||||
from telegram import Update
|
||||
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler, MessageHandler, filters
|
||||
|
||||
import telegramify_markdown
|
||||
import typing
|
||||
import asyncio
|
||||
import traceback
|
||||
@@ -86,9 +86,10 @@ class TelegramMessageConverter(adapter.MessageConverter):
|
||||
if message.text:
|
||||
message_text = message.text
|
||||
message_components.extend(parse_message_text(message_text))
|
||||
|
||||
|
||||
if message.photo:
|
||||
message_components.extend(parse_message_text(message.caption))
|
||||
if message.caption:
|
||||
message_components.extend(parse_message_text(message.caption))
|
||||
|
||||
file = await message.photo[-1].get_file()
|
||||
|
||||
@@ -201,19 +202,20 @@ class TelegramAdapter(adapter.MessagePlatformAdapter):
|
||||
|
||||
for component in components:
|
||||
if component['type'] == 'text':
|
||||
|
||||
content = telegramify_markdown.markdownify(
|
||||
content= component['text'],
|
||||
)
|
||||
args = {
|
||||
"chat_id": message_source.source_platform_object.effective_chat.id,
|
||||
"text": component['text'],
|
||||
"text": content,
|
||||
}
|
||||
|
||||
if self.config['markdown_card'] is True:
|
||||
args["parse_mode"] = "MarkdownV2"
|
||||
if quote_origin:
|
||||
args['reply_to_message_id'] = message_source.source_platform_object.message.id
|
||||
|
||||
if quote_origin:
|
||||
args['reply_to_message_id'] = message_source.source_platform_object.message.id
|
||||
await self.bot.send_message(**args)
|
||||
|
||||
await self.bot.send_message(**args)
|
||||
|
||||
async def is_muted(self, group_id: int) -> bool:
|
||||
return False
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
semantic_version = "v3.4.12"
|
||||
semantic_version = "v3.4.12.1"
|
||||
|
||||
debug_mode = False
|
||||
|
||||
|
||||
@@ -35,5 +35,6 @@ python-telegram-bot
|
||||
certifi
|
||||
mcp
|
||||
slack_sdk
|
||||
telegramify-markdown
|
||||
# indirect
|
||||
taskgroup==0.0.0a4
|
||||
Reference in New Issue
Block a user