Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片发送 #123

Open
4 tasks done
Samiya321 opened this issue Dec 16, 2023 · 4 comments
Open
4 tasks done

图片发送 #123

Samiya321 opened this issue Dec 16, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Samiya321
Copy link

Samiya321 commented Dec 16, 2023

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

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

@Samiya321 Samiya321 added the enhancement New feature or request label Dec 16, 2023
@fghwett
Copy link

fghwett commented Dec 18, 2023

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

@Samiya321
Copy link
Author

按照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
Copy link

fghwett commented Dec 18, 2023

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

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

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

@Samiya321
Copy link
Author

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图片发送,实际也还是以超链接的形式被发送... 似乎无效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants