-
Notifications
You must be signed in to change notification settings - Fork 43
[FAQ] send multimedia message
Housa Hitomi edited this page Apr 15, 2022
·
4 revisions
- send KMarkdown
@bot.command()
async def multimedia(msg: Message):
await msg.reply('''(spl)some secret(spl)''', type=MessageTypes.KMD)
- send image
@bot.command()
async def multimedia(msg: Message):
await msg.reply('https://link.to/your/image', type=MessageTypes.IMG)
for more msg types, please refer to MessageTypes
when send/reply IMG/VIDEO/AUDIO etc. multimedia message, the content should be filled with a link str
@bot.command()
async def foo(m: Message, b: Bot):
url = await b.create_asset(open('/path/to/your/file', 'rb'))
await m.reply(url, type=MessageTypes.IMG)