mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 00:35:36 +00:00
antisticker 在贴纸被回复时自动删除贴纸防止被偷取
This commit is contained in:
parent
881349b277
commit
fe0de27a63
31
antisticker.py
Normal file
31
antisticker.py
Normal file
@ -0,0 +1,31 @@
|
||||
""" Auto-delete sticker when someone reply """
|
||||
|
||||
from pagermaid import user_id
|
||||
from pagermaid.listener import listener
|
||||
|
||||
|
||||
@listener(incoming=True, ignore_edited=True)
|
||||
async def auto_remove_sticker(context):
|
||||
""" Event handler to remove stickers. """
|
||||
reply = await context.get_reply_message()
|
||||
if reply:
|
||||
if reply.sender:
|
||||
reply_user_id = reply.sender.id
|
||||
else:
|
||||
return
|
||||
if context.sticker:
|
||||
return
|
||||
if not reply.sticker:
|
||||
return
|
||||
if context.chat_id > 0:
|
||||
return
|
||||
if context.sender.bot:
|
||||
return
|
||||
else:
|
||||
return
|
||||
|
||||
if reply_user_id == user_id:
|
||||
try:
|
||||
await reply.delete()
|
||||
except:
|
||||
pass
|
14
list.json
14
list.json
@ -12,7 +12,7 @@
|
||||
},
|
||||
{
|
||||
"name": "dme",
|
||||
"version": "1.12",
|
||||
"version": "1.121",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "4.3 kb",
|
||||
@ -342,7 +342,7 @@
|
||||
},
|
||||
{
|
||||
"name": "vip",
|
||||
"version": "0.6",
|
||||
"version": "0.61",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "9.8 kb",
|
||||
@ -749,6 +749,16 @@
|
||||
"supported": true,
|
||||
"des-short": "在指定的时间后删除他人的消息。",
|
||||
"des": "在指定的时间后删除所回复用户发送的消息。\n指令:-autodel"
|
||||
},
|
||||
{
|
||||
"name": "antisticker",
|
||||
"version": "1.0",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "0.7 kb",
|
||||
"supported": true,
|
||||
"des-short": "在贴纸被回复时自动删除贴纸防止被偷取",
|
||||
"des": "在贴纸被回复时自动删除贴纸防止被偷取。\n网速争霸 不保证成功率"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user