🥳 添加静默记录并且设为默认

This commit is contained in:
xtaodada 2020-03-13 16:48:50 +08:00
parent cf8b55eb05
commit ffe12b1923
No known key found for this signature in database
GPG Key ID: 39EFACA711DF5D8C

View File

@ -45,7 +45,7 @@ async def chatid(context):
await context.edit("ChatID: `" + str(context.chat_id) + "`")
@listener(outgoing=True, command="log",
@listener(outgoing=True, command="-uslog",
description="转发一条消息到日志。",
parameters="<string>")
async def log(context):
@ -64,6 +64,25 @@ async def log(context):
await context.edit("出错了呜呜呜 ~ 日志记录已禁用。")
@listener(outgoing=True, command="log",
description="静默转发一条消息到日志。",
parameters="<string>")
async def log(context):
""" Forwards a message into log group """
if strtobool(config['log']):
if context.reply_to_msg_id:
reply_msg = await context.get_reply_message()
await reply_msg.forward_to(int(config['log_chatid']))
elif context.arguments:
await log(context.arguments)
else:
await context.edit("出错了呜呜呜 ~ 无效的参数。")
return
await context.delete()
else:
await context.edit("出错了呜呜呜 ~ 日志记录已禁用。")
@listener(outgoing=True, command="leave",
description="说 再见 然后离开会话。")
async def leave(context):