iShotaBot/modules/luxun.py
2021-11-28 22:55:10 +08:00

27 lines
892 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from os import sep
from pyrogram import Client, filters, ContinuePropagation
from pyrogram.types import Message
from defs.luxun import process_pic
@Client.on_message(filters.incoming & ~filters.edited &
filters.regex(r"^鲁迅说过"))
async def luxun_say(client: Client, message: Message):
args = message.text[4:]
if not args:
await message.reply("烦了,不说了", quote=True)
raise ContinuePropagation
content = args.strip()
if content.startswith(",") or content.startswith(""):
content = content[1:]
if len(content) > 20:
await message.reply("太长了, 鲁迅说不完!", quote=True)
else:
if len(content) >= 12:
content = content[:12] + "\n" + content[12:]
picture = process_pic(content)
await message.reply_photo(picture, quote=True)
raise ContinuePropagation