yvlu 支持不回复消息

This commit is contained in:
xtaodada 2021-12-12 00:02:20 +08:00
parent e26bc543dc
commit fd0ea183c2
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 10 additions and 5 deletions

View File

@ -682,13 +682,13 @@
}, },
{ {
"name": "yvlu", "name": "yvlu",
"version": "1.2", "version": "1.21",
"section": "chat", "section": "chat",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "10.3 kb", "size": "10.4 kb",
"supported": true, "supported": true,
"des-short": "将回复的消息转换成语录图片", "des-short": "将回复的消息转换成语录图片",
"des": "将回复的消息转换成语录图片。\n指令-yvlu -yvlu_" "des": "将回复的消息或者输入字符串转换成语录图片。\n指令-yvlu -yvlu_"
}, },
{ {
"name": "antichannelmsg", "name": "antichannelmsg",

View File

@ -112,11 +112,16 @@ async def yv_lu_process_sticker(name, photo, sticker, path):
@listener(is_plugin=True, outgoing=True, command=alias_command("yvlu"), @listener(is_plugin=True, outgoing=True, command=alias_command("yvlu"),
description="将回复的消息转换成语录") description="将回复的消息或者输入的字符串转换成语录")
async def yv_lu(context): async def yv_lu(context):
reply = await context.get_reply_message() reply = await context.get_reply_message()
if not reply: if not reply:
return await context.edit('你需要回复一条消息。') message = context.arguments
if message:
await context.edit(message)
reply = context
else:
return await context.edit('你需要回复一条消息或者输入一串字符。')
async with bot.conversation('QuotLyBot') as conversation: async with bot.conversation('QuotLyBot') as conversation:
try: try:
send_for = await reply.forward_to(conversation.chat_id) send_for = await reply.forward_to(conversation.chat_id)