mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 08:27:38 +00:00
fuck eat 修复报错
This commit is contained in:
parent
2c3523283e
commit
2efe4c1d25
2
eat.py
2
eat.py
@ -243,7 +243,7 @@ async def eat(context: NewMessage.Event):
|
|||||||
if user.isnumeric():
|
if user.isnumeric():
|
||||||
user = int(user)
|
user = int(user)
|
||||||
else:
|
else:
|
||||||
user = user_object.id
|
user = from_user_id
|
||||||
if context.message.entities is not None:
|
if context.message.entities is not None:
|
||||||
if isinstance(context.message.entities[0], MessageEntityMentionName):
|
if isinstance(context.message.entities[0], MessageEntityMentionName):
|
||||||
target_user = await context.client(GetFullUserRequest(context.message.entities[0].user_id))
|
target_user = await context.client(GetFullUserRequest(context.message.entities[0].user_id))
|
||||||
|
32
fuck.py
32
fuck.py
@ -21,10 +21,17 @@ async def fuck(context):
|
|||||||
if context.is_group:
|
if context.is_group:
|
||||||
if reply:
|
if reply:
|
||||||
if reply.sender:
|
if reply.sender:
|
||||||
if reply.sender.last_name is None:
|
try:
|
||||||
reply_last_name = ''
|
if reply.sender.last_name is None:
|
||||||
else:
|
reply_last_name = ''
|
||||||
reply_last_name = reply.sender.last_name
|
else:
|
||||||
|
reply_last_name = reply.sender.last_name
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
await context.edit('无法获取所回复的用户。')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
await context.edit('无法获取所回复的用户。')
|
await context.edit('无法获取所回复的用户。')
|
||||||
@ -32,10 +39,17 @@ async def fuck(context):
|
|||||||
pass
|
pass
|
||||||
return
|
return
|
||||||
if context.sender:
|
if context.sender:
|
||||||
if context.sender.last_name is None:
|
try:
|
||||||
context_last_name = ''
|
if context.sender.last_name is None:
|
||||||
else:
|
context_last_name = ''
|
||||||
context_last_name = context.sender.last_name
|
else:
|
||||||
|
context_last_name = context.sender.last_name
|
||||||
|
except AttributeError:
|
||||||
|
try:
|
||||||
|
await context.edit('无法获取所回复的用户。')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
await context.edit('无法获取所回复的用户。')
|
await context.edit('无法获取所回复的用户。')
|
||||||
@ -76,6 +90,8 @@ async def fuck(context):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
userid = int(context.arguments)
|
userid = int(context.arguments)
|
||||||
|
if userid < 0:
|
||||||
|
return await context.edit('输入值错误。')
|
||||||
except ValueError:
|
except ValueError:
|
||||||
await context.edit('输入值错误。')
|
await context.edit('输入值错误。')
|
||||||
return
|
return
|
||||||
|
@ -202,7 +202,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eat",
|
"name": "eat",
|
||||||
"version": "1.042",
|
"version": "1.043",
|
||||||
"section": "profile",
|
"section": "profile",
|
||||||
"maintainer": "SF_PICK",
|
"maintainer": "SF_PICK",
|
||||||
"size": "22.3 kb",
|
"size": "22.3 kb",
|
||||||
@ -502,7 +502,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fuck",
|
"name": "fuck",
|
||||||
"version": "1.022",
|
"version": "1.023",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "Pentacene",
|
"maintainer": "Pentacene",
|
||||||
"size": "4.0 kb",
|
"size": "4.0 kb",
|
||||||
|
Loading…
Reference in New Issue
Block a user