diff --git a/antisticker.py b/antisticker.py new file mode 100644 index 0000000..e04db45 --- /dev/null +++ b/antisticker.py @@ -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 diff --git a/list.json b/list.json index b432fc5..2ed2fbd 100644 --- a/list.json +++ b/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网速争霸 不保证成功率" } ] }