Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/embed_test/__init__.py
yzhh 044b588d89 re-support embed image
discord side needs the smms image hosting token to send image
2022-01-10 22:32:47 +08:00

18 lines
909 B
Python

import datetime
from core.elements import MessageSession, Embed, Image, EmbedField
from core.component import on_command
t = on_command('embed_test', required_superuser=True)
@t.handle()
async def _(session: MessageSession):
await session.sendMessage(Embed(title='Embed Test', description='This is a test embed.',
url='https://minecraft.fandom.com/zh/wiki/Minecraft_Wiki',
color=0x00ff00, timestamp=datetime.datetime.now().timestamp(),
author='oasisakari',
footer='Test',
image=Image('https://avatars.githubusercontent.com/u/68471503?s=200&v=4'),
fields=[EmbedField('oaoa', 'aaaaa', inline=True),
EmbedField('oaoa', 'aaaaa', inline=True)]))