songquanpeng / message-pusher

搭建专属于你的消息推送服务,支持多种消息推送方式,支持 Markdown,基于 Golang 仅单可执行文件,开箱即用
https://msgpusher.com
MIT License
2.58k stars 385 forks source link

图片发送 #123

Open Samiya321 opened 9 months ago

Samiya321 commented 9 months ago

例行检查

功能描述 像telegram 企业微信这种能否支持发送图片? 或者图文形式 应用场景

fghwett commented 8 months ago

按照telegram和企业微信官方的接口来说,是支持以markdown的形式发送图文的,你现在是有测试不行吗

Samiya321 commented 8 months ago

按照telegram和企业微信官方的接口来说,是支持以markdown的形式发送图文的,你现在是有测试不行吗 https://developer.work.weixin.qq.com/document/path/90236#支持的markdown语法 https://core.telegram.org/bots/api#markdownv2-style https://core.telegram.org/bots/api#markdownv2-style

我似乎在telegram和企业微信的API文档中的Markdown部分并没有发现它支持发送图文,你指的是将图片以超链接形式发送吗?

fghwett commented 8 months ago

image tg有看到支持markdown图片的写法

![图片描述](图片链接)

企业微信文档中没写,可能是不支持,你可以先试一下,如果不行,你再看看需要哪个形式的消息,我再加一下。目前源码作者很忙,估计改了也要很久才更新,你要做好心理准备。

Samiya321 commented 8 months ago

image tg有看到支持markdown图片的写法

![图片描述](图片链接)

企业微信文档中没写,可能是不支持,你可以先试一下,如果不行,你再看看需要哪个形式的消息,我再加一下。目前源码作者很忙,估计改了也要很久才更新,你要做好心理准备。

import telebot
from telebot import asyncio_helper

# Replace 'YOUR_BOT_TOKEN' with your bot's token
bot_token = ""

asyncio_helper.proxy = "http://127.0.0.1:7890"
bot = telebot.TeleBot(bot_token)

# Replace 'YOUR_CHAT_ID' with the chat ID where you want to send the message
chat_id = ""

# Markdown formatted message
message_text = """
*Bold text*
_Italic text_
[Link](https://jp.mercari.com/item/m67531566397)
![Image](https://static.mercdn.net/c!/w=240,f=webp/thumb/photos/m56996954488_1.jpg)
"""

# Send the message
bot.send_message(chat_id, message_text, parse_mode="Markdown")

image

测试了一下telegram的markdown图片发送,实际也还是以超链接的形式被发送... 似乎无效