misskey2telegram/modules/post.py
2022-12-22 22:18:43 +08:00

18 lines
499 B
Python

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