mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 08:34:52 +00:00
parent
107fc1ffc2
commit
5611cb79e9
10
dme.py
10
dme.py
@ -70,6 +70,7 @@ async def dme(context):
|
||||
except:
|
||||
pass
|
||||
count_buffer = 0
|
||||
try:
|
||||
async for message in context.client.iter_messages(context.chat_id, from_user="me"):
|
||||
if count_buffer == count:
|
||||
break
|
||||
@ -98,10 +99,19 @@ async def dme(context):
|
||||
pass
|
||||
await message.delete()
|
||||
count_buffer += 1
|
||||
except ValueError:
|
||||
try:
|
||||
await context.edit('出错了呜呜呜 ~ 无法识别的对话')
|
||||
except:
|
||||
pass
|
||||
return
|
||||
count -= 1
|
||||
count_buffer -= 1
|
||||
await log(f"批量删除了自行发送的 {str(count_buffer)} / {str(count)} 条消息。")
|
||||
try:
|
||||
notification = await send_prune_notify(context, count_buffer, count)
|
||||
except:
|
||||
return
|
||||
await sleep(.5)
|
||||
await notification.delete()
|
||||
|
||||
|
@ -56,7 +56,7 @@ async def fuck_admin(context):
|
||||
if day < 7:
|
||||
day = 7
|
||||
text += '由于输入的数据过小,时间自动设置为 7 天。\n'
|
||||
except KeyError:
|
||||
except (KeyError or ValueError):
|
||||
day = 7
|
||||
text += '由于输入的数据错误,时间自动设置为 7 天。\n'
|
||||
else:
|
||||
|
10
list.json
10
list.json
@ -12,7 +12,7 @@
|
||||
},
|
||||
{
|
||||
"name": "dme",
|
||||
"version": "1.121",
|
||||
"version": "1.122",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "4.3 kb",
|
||||
@ -272,7 +272,7 @@
|
||||
},
|
||||
{
|
||||
"name": "neteaseshuffle",
|
||||
"version": "1.11",
|
||||
"version": "1.111",
|
||||
"section": "daily",
|
||||
"maintainer": "TNTcraftHIM",
|
||||
"size": "3.0 kb",
|
||||
@ -332,7 +332,7 @@
|
||||
},
|
||||
{
|
||||
"name": "stickertopic",
|
||||
"version": "1.111",
|
||||
"version": "1.12",
|
||||
"section": "chat",
|
||||
"maintainer": "TNTcraftHIM",
|
||||
"size": "3.5 kb",
|
||||
@ -552,7 +552,7 @@
|
||||
},
|
||||
{
|
||||
"name": "pic2sticker",
|
||||
"version": "1.0",
|
||||
"version": "1.01",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "4.7 kb",
|
||||
@ -572,7 +572,7 @@
|
||||
},
|
||||
{
|
||||
"name": "fuckadmin",
|
||||
"version": "1.1",
|
||||
"version": "1.11",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "2.9 kb",
|
||||
|
@ -22,8 +22,11 @@ async def ns(context):
|
||||
"http://api.uomg.com/api/rand.music?sort=%E7%83%AD%E6%AD%8C%E6%A6%9C&format=json")
|
||||
if req.status_code == 200:
|
||||
req = json.loads(req.content)
|
||||
try:
|
||||
songid = req["data"]["url"][45:]
|
||||
music = req['data']['url']
|
||||
except KeyError:
|
||||
continue
|
||||
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, '
|
||||
'like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063',
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,"
|
||||
|
@ -1,7 +1,7 @@
|
||||
""" PagerMaid module to handle sticker collection. """
|
||||
|
||||
from io import BytesIO
|
||||
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto
|
||||
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto, MessageMediaWebPage
|
||||
from PIL import Image, ImageOps
|
||||
from math import floor
|
||||
from pagermaid import bot, redis, redis_status
|
||||
@ -27,6 +27,12 @@ async def pic2sticker(context):
|
||||
if isinstance(message.media, MessageMediaPhoto):
|
||||
photo = BytesIO()
|
||||
photo = await bot.download_media(message.photo, photo)
|
||||
elif isinstance(message.media, MessageMediaWebPage):
|
||||
try:
|
||||
await context.edit(lang('sticker_type_not_support'))
|
||||
except:
|
||||
pass
|
||||
return
|
||||
elif "image" in message.media.document.mime_type.split('/'):
|
||||
photo = BytesIO()
|
||||
try:
|
||||
|
@ -1,7 +1,7 @@
|
||||
from time import sleep
|
||||
from os import remove
|
||||
from io import BytesIO
|
||||
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto
|
||||
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto, MessageMediaWebPage
|
||||
from PIL import Image
|
||||
from pagermaid import bot
|
||||
from pagermaid.listener import listener
|
||||
@ -38,6 +38,11 @@ async def stickertopic(context):
|
||||
if isinstance(message.media, MessageMediaPhoto):
|
||||
photo = BytesIO()
|
||||
photo = await bot.download_media(message.photo, photo)
|
||||
elif isinstance(message.media, MessageMediaWebPage):
|
||||
await context.edit("出错了呜呜呜 ~ 目标不是贴纸 。")
|
||||
sleep(2)
|
||||
await context.delete()
|
||||
return
|
||||
elif "image" in message.media.document.mime_type.split('/'):
|
||||
photo = BytesIO()
|
||||
await context.edit("正在转换...\n████40%")
|
||||
|
Loading…
Reference in New Issue
Block a user