misskey2telegram/modules/post.py

18 lines
499 B
Python
Raw Normal View History

2022-12-22 14:18:43 +00:00
from pyrogram import Client, filters
from pyrogram.types import Message
from misskey_init import misskey_bot
@Client.on_message(filters.incoming & filters.private & filters.text &
filters.command(["post"]))
async def post_command(_: Client, message: Message):
"""
发送新贴
"""
if text := message.text[6:].strip():
await misskey_bot.core.api.note.action.send(text)
await message.reply("发送成功", quote=True)
else:
return