mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 06:32:47 +00:00
parent
107fc1ffc2
commit
5611cb79e9
56
dme.py
56
dme.py
@ -70,38 +70,48 @@ async def dme(context):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
count_buffer = 0
|
count_buffer = 0
|
||||||
async for message in context.client.iter_messages(context.chat_id, from_user="me"):
|
try:
|
||||||
if count_buffer == count:
|
async for message in context.client.iter_messages(context.chat_id, from_user="me"):
|
||||||
break
|
if count_buffer == count:
|
||||||
if message.forward or message.via_bot or message.sticker or message.contact or message.poll or message.game or message.geo:
|
break
|
||||||
pass
|
if message.forward or message.via_bot or message.sticker or message.contact or message.poll or message.game or message.geo:
|
||||||
elif message.text or message.voice:
|
pass
|
||||||
if not message.text == dme_msg:
|
elif message.text or message.voice:
|
||||||
try:
|
|
||||||
await message.edit(dme_msg)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
elif message.document or message.photo or message.file or message.audio or message.video or message.gif:
|
|
||||||
if target_file:
|
|
||||||
if not message.text == dme_msg:
|
|
||||||
try:
|
|
||||||
await message.edit(dme_msg, file=target_file)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
if not message.text == dme_msg:
|
if not message.text == dme_msg:
|
||||||
try:
|
try:
|
||||||
await message.edit(dme_msg)
|
await message.edit(dme_msg)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
elif message.document or message.photo or message.file or message.audio or message.video or message.gif:
|
||||||
|
if target_file:
|
||||||
|
if not message.text == dme_msg:
|
||||||
|
try:
|
||||||
|
await message.edit(dme_msg, file=target_file)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if not message.text == dme_msg:
|
||||||
|
try:
|
||||||
|
await message.edit(dme_msg)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
await message.delete()
|
||||||
|
count_buffer += 1
|
||||||
|
except ValueError:
|
||||||
|
try:
|
||||||
|
await context.edit('出错了呜呜呜 ~ 无法识别的对话')
|
||||||
|
except:
|
||||||
pass
|
pass
|
||||||
await message.delete()
|
return
|
||||||
count_buffer += 1
|
|
||||||
count -= 1
|
count -= 1
|
||||||
count_buffer -= 1
|
count_buffer -= 1
|
||||||
await log(f"批量删除了自行发送的 {str(count_buffer)} / {str(count)} 条消息。")
|
await log(f"批量删除了自行发送的 {str(count_buffer)} / {str(count)} 条消息。")
|
||||||
notification = await send_prune_notify(context, count_buffer, count)
|
try:
|
||||||
|
notification = await send_prune_notify(context, count_buffer, count)
|
||||||
|
except:
|
||||||
|
return
|
||||||
await sleep(.5)
|
await sleep(.5)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ async def fuck_admin(context):
|
|||||||
if day < 7:
|
if day < 7:
|
||||||
day = 7
|
day = 7
|
||||||
text += '由于输入的数据过小,时间自动设置为 7 天。\n'
|
text += '由于输入的数据过小,时间自动设置为 7 天。\n'
|
||||||
except KeyError:
|
except (KeyError or ValueError):
|
||||||
day = 7
|
day = 7
|
||||||
text += '由于输入的数据错误,时间自动设置为 7 天。\n'
|
text += '由于输入的数据错误,时间自动设置为 7 天。\n'
|
||||||
else:
|
else:
|
||||||
|
10
list.json
10
list.json
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dme",
|
"name": "dme",
|
||||||
"version": "1.121",
|
"version": "1.122",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "4.3 kb",
|
"size": "4.3 kb",
|
||||||
@ -272,7 +272,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "neteaseshuffle",
|
"name": "neteaseshuffle",
|
||||||
"version": "1.11",
|
"version": "1.111",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "TNTcraftHIM",
|
"maintainer": "TNTcraftHIM",
|
||||||
"size": "3.0 kb",
|
"size": "3.0 kb",
|
||||||
@ -332,7 +332,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "stickertopic",
|
"name": "stickertopic",
|
||||||
"version": "1.111",
|
"version": "1.12",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "TNTcraftHIM",
|
"maintainer": "TNTcraftHIM",
|
||||||
"size": "3.5 kb",
|
"size": "3.5 kb",
|
||||||
@ -552,7 +552,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pic2sticker",
|
"name": "pic2sticker",
|
||||||
"version": "1.0",
|
"version": "1.01",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "4.7 kb",
|
"size": "4.7 kb",
|
||||||
@ -572,7 +572,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fuckadmin",
|
"name": "fuckadmin",
|
||||||
"version": "1.1",
|
"version": "1.11",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "2.9 kb",
|
"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")
|
"http://api.uomg.com/api/rand.music?sort=%E7%83%AD%E6%AD%8C%E6%A6%9C&format=json")
|
||||||
if req.status_code == 200:
|
if req.status_code == 200:
|
||||||
req = json.loads(req.content)
|
req = json.loads(req.content)
|
||||||
songid = req["data"]["url"][45:]
|
try:
|
||||||
music = req['data']['url']
|
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, '
|
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',
|
'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,"
|
"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. """
|
""" PagerMaid module to handle sticker collection. """
|
||||||
|
|
||||||
from io import BytesIO
|
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 PIL import Image, ImageOps
|
||||||
from math import floor
|
from math import floor
|
||||||
from pagermaid import bot, redis, redis_status
|
from pagermaid import bot, redis, redis_status
|
||||||
@ -27,6 +27,12 @@ async def pic2sticker(context):
|
|||||||
if isinstance(message.media, MessageMediaPhoto):
|
if isinstance(message.media, MessageMediaPhoto):
|
||||||
photo = BytesIO()
|
photo = BytesIO()
|
||||||
photo = await bot.download_media(message.photo, photo)
|
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('/'):
|
elif "image" in message.media.document.mime_type.split('/'):
|
||||||
photo = BytesIO()
|
photo = BytesIO()
|
||||||
try:
|
try:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
from os import remove
|
from os import remove
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto
|
from telethon.tl.types import DocumentAttributeFilename, MessageMediaPhoto, MessageMediaWebPage
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from pagermaid import bot
|
from pagermaid import bot
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
@ -38,6 +38,11 @@ async def stickertopic(context):
|
|||||||
if isinstance(message.media, MessageMediaPhoto):
|
if isinstance(message.media, MessageMediaPhoto):
|
||||||
photo = BytesIO()
|
photo = BytesIO()
|
||||||
photo = await bot.download_media(message.photo, photo)
|
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('/'):
|
elif "image" in message.media.document.mime_type.split('/'):
|
||||||
photo = BytesIO()
|
photo = BytesIO()
|
||||||
await context.edit("正在转换...\n████40%")
|
await context.edit("正在转换...\n████40%")
|
||||||
|
Loading…
Reference in New Issue
Block a user