🐛 Fix some bugs (mock,re,selfprune) (#116)
🐛 修复 mock, re, selfprune 运行错误。
This commit is contained in:
parent
bf9ea775c3
commit
177823f46e
@ -74,13 +74,16 @@ async def mock(context):
|
||||
reply = await context.get_reply_message()
|
||||
await context.edit(result)
|
||||
if reply:
|
||||
if reply.sender.is_self:
|
||||
try:
|
||||
await reply.edit(result)
|
||||
except MessageNotModifiedError:
|
||||
await context.edit("A rare event of two mocking messages being the same just occurred.")
|
||||
return
|
||||
await context.delete()
|
||||
try:
|
||||
if reply.sender.is_self:
|
||||
try:
|
||||
await reply.edit(result)
|
||||
except MessageNotModifiedError:
|
||||
await context.edit("A rare event of two mocking messages being the same just occurred.")
|
||||
return
|
||||
await context.delete()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
||||
@listener(is_plugin=False, outgoing=True, command=alias_command("widen"),
|
||||
|
@ -147,7 +147,10 @@ async def re(context):
|
||||
except:
|
||||
await context.edit(lang('re_arg_error'))
|
||||
return True
|
||||
await context.delete()
|
||||
try:
|
||||
await context.delete()
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
for nums in range(0, num):
|
||||
await reply.forward_to(int(context.chat_id))
|
||||
|
@ -81,7 +81,10 @@ async def selfprune(context):
|
||||
if msgs:
|
||||
await context.client.delete_messages(context.chat_id, msgs)
|
||||
await log(f"{lang('prune_hint1')}{lang('sp_hint')} {str(count_buffer)} / {str(count)} {lang('prune_hint2')}")
|
||||
notification = await send_prune_notify(context, count_buffer, count)
|
||||
try:
|
||||
notification = await send_prune_notify(context, count_buffer, count)
|
||||
except ValueError:
|
||||
pass
|
||||
await sleep(1)
|
||||
await notification.delete()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user