fuck fix AttributeError

This commit is contained in:
xtaodada 2021-09-15 20:56:09 +08:00
parent a9fa76f2f3
commit 0dffb55978
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 15 additions and 5 deletions

10
fuck.py
View File

@ -20,17 +20,27 @@ async def fuck(context):
reply = await context.get_reply_message()
if context.is_group:
if reply:
if reply.sender:
if reply.sender.last_name is None:
reply_last_name = ''
else:
reply_last_name = reply.sender.last_name
else:
try:
await context.edit('无法获取所回复的用户。')
except:
pass
return
if context.sender:
if context.sender.last_name is None:
context_last_name = ''
else:
context_last_name = context.sender.last_name
else:
try:
await context.edit('无法获取所回复的用户。')
except:
pass
return
admins = await context.client.get_participants(context.chat, filter=ChannelParticipantsAdmins)
if context.sender in admins:

View File

@ -502,7 +502,7 @@
},
{
"name": "fuck",
"version": "1.021",
"version": "1.022",
"section": "chat",
"maintainer": "Pentacene",
"size": "4.0 kb",