mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 15:22:20 +00:00
commit
7c45230b94
43
acg-multi.py
Normal file
43
acg-multi.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
from random import randint
|
||||||
|
from time import sleep
|
||||||
|
from requests import get
|
||||||
|
from pagermaid.listener import listener
|
||||||
|
from os import remove
|
||||||
|
|
||||||
|
|
||||||
|
@listener(is_plugin=True, outgoing=True, command="acgm",
|
||||||
|
description="多网站随机获取二刺螈(bushi) ACG图片")
|
||||||
|
async def joke(context):
|
||||||
|
await context.edit("获取中 . . .")
|
||||||
|
status = False
|
||||||
|
for _ in range (20): #最多重试20次
|
||||||
|
website = randint(0, 3)
|
||||||
|
if website == 0:
|
||||||
|
img = get("http://api.btstu.cn/sjbz/?lx=m_dongman")
|
||||||
|
elif website == 1:
|
||||||
|
img = get("https://acg.yanwz.cn/api.php")
|
||||||
|
elif website == 2:
|
||||||
|
img = get("https://img.xjh.me/random_img.php?type=bg&ctype=acg&return=302&device=mobile")
|
||||||
|
elif website == 3:
|
||||||
|
img = get("https://www.yunboys.cn/sjbz/api.php?method=mobile&lx=dongman")
|
||||||
|
if img.status_code == 200:
|
||||||
|
with open(r'tu.png', 'wb') as f:
|
||||||
|
await context.edit("正在上传图片")
|
||||||
|
f.write(img.content)
|
||||||
|
await context.client.send_file(
|
||||||
|
context.chat_id,
|
||||||
|
"tu.png",
|
||||||
|
reply_to=None,
|
||||||
|
caption=None
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
remove('tu.png')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
status = True
|
||||||
|
break #成功了就赶紧结束啦!
|
||||||
|
|
||||||
|
if not status:
|
||||||
|
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器 。")
|
||||||
|
sleep(2)
|
||||||
|
await context.delete()
|
@ -6,7 +6,7 @@ from os import remove
|
|||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@listener(is_plugin=True, outgoing=True, command="atadmins",
|
@listener(is_plugin=True, incoming=True, outgoing=True, command="atadmins",
|
||||||
description="一键 AT 本群管理员(仅在群组中有效)",
|
description="一键 AT 本群管理员(仅在群组中有效)",
|
||||||
parameters="<要说的话>")
|
parameters="<要说的话>")
|
||||||
async def atadmins(context):
|
async def atadmins(context):
|
||||||
@ -34,7 +34,7 @@ async def atadmins(context):
|
|||||||
# await context.reply(' , '.join(admin_list))
|
# await context.reply(' , '.join(admin_list))
|
||||||
await context.delete()
|
await context.delete()
|
||||||
|
|
||||||
@listener(outgoing=True, command="atall",
|
@listener(is_plugin=True, incoming=True, outgoing=True, command="atall",
|
||||||
description="一键 AT 本群成员(仅在群组中有效)")
|
description="一键 AT 本群成员(仅在群组中有效)")
|
||||||
async def atall(context):
|
async def atall(context):
|
||||||
await context.edit('正在获取成员列表中...')
|
await context.edit('正在获取成员列表中...')
|
||||||
|
49
cosplay-multi.py
Normal file
49
cosplay-multi.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
from random import randint
|
||||||
|
from time import sleep
|
||||||
|
from requests import get
|
||||||
|
from pagermaid.listener import listener
|
||||||
|
from os import remove
|
||||||
|
|
||||||
|
|
||||||
|
@listener(is_plugin=True, outgoing=True, command="cosm",
|
||||||
|
description="多网站随机获取cosplay图片,会自动重试哦")
|
||||||
|
async def joke(context):
|
||||||
|
await context.edit("获取中 . . .")
|
||||||
|
status = False
|
||||||
|
for _ in range (20): #最多重试20次
|
||||||
|
website = randint(0, 4)
|
||||||
|
if website == 0:
|
||||||
|
img = get("https://api.helloworld.la/xiezhen_cosplay.php")
|
||||||
|
elif website == 1:
|
||||||
|
img = get("https://api.vvhan.com/api/mobil.girl?type=json")
|
||||||
|
elif website == 2:
|
||||||
|
img = get("https://api.helloworld.la/xiezhen_weimei.php")
|
||||||
|
elif website == 3:
|
||||||
|
img = get("http://api.rosysun.cn/cos")
|
||||||
|
elif website == 4:
|
||||||
|
img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%8A%A8%E6%BC%AB")
|
||||||
|
if img.status_code == 200:
|
||||||
|
if website == 3:
|
||||||
|
img = get(img.content)
|
||||||
|
if img.status_code != 200:
|
||||||
|
continue #再试一次
|
||||||
|
with open(r'tu.png', 'wb') as f:
|
||||||
|
await context.edit("正在上传图片")
|
||||||
|
f.write(img.content)
|
||||||
|
await context.client.send_file(
|
||||||
|
context.chat_id,
|
||||||
|
"tu.png",
|
||||||
|
reply_to=None,
|
||||||
|
caption=None
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
remove('tu.png')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
status = True
|
||||||
|
break #成功了就赶紧结束啦!
|
||||||
|
|
||||||
|
if not status:
|
||||||
|
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器 。")
|
||||||
|
sleep(2)
|
||||||
|
await context.delete()
|
40
list.json
40
list.json
@ -112,7 +112,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "atadmins_atall",
|
"name": "atadmins_atall",
|
||||||
"version": "1.0",
|
"version": "1.1",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "Pentacene",
|
"maintainer": "Pentacene",
|
||||||
"size": "2.5 kb",
|
"size": "2.5 kb",
|
||||||
@ -152,11 +152,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "portball",
|
"name": "portball",
|
||||||
"version": "1.1",
|
"version": "1.21",
|
||||||
"section": "chat",
|
"section": "chat",
|
||||||
"maintainer": "丢失了",
|
"maintainer": "Pentacene",
|
||||||
"size": "3.0 kb",
|
"size": "3.6 kb",
|
||||||
"supported": false,
|
"supported": true,
|
||||||
"des-short": "回复你要临时禁言的人的消息来实现XX秒的禁言。",
|
"des-short": "回复你要临时禁言的人的消息来实现XX秒的禁言。",
|
||||||
"des": "这个人很懒,什么都没有留下。"
|
"des": "这个人很懒,什么都没有留下。"
|
||||||
},
|
},
|
||||||
@ -209,6 +209,36 @@
|
|||||||
"supported": false,
|
"supported": false,
|
||||||
"des-short": "生成一张 吃头像 图片。",
|
"des-short": "生成一张 吃头像 图片。",
|
||||||
"des": "这个人很懒,什么都没有留下。"
|
"des": "这个人很懒,什么都没有留下。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cosplay-multi",
|
||||||
|
"version": "1.0",
|
||||||
|
"section": "profile",
|
||||||
|
"maintainer": "TNTcraftHIM",
|
||||||
|
"size": "1.8 kb",
|
||||||
|
"supported": true,
|
||||||
|
"des-short": "多网站随机获取Cos图",
|
||||||
|
"des": "在不同的几个网站中随机获取Cosplay图片,解决了cosplay单个API流量用尽后无法获取的问题。命令:cosm。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "meizi",
|
||||||
|
"version": "1.0",
|
||||||
|
"section": "profile",
|
||||||
|
"maintainer": "TNTcraftHIM",
|
||||||
|
"size": "2.0 kb",
|
||||||
|
"supported": true,
|
||||||
|
"des-short": "多网站随机获取写真",
|
||||||
|
"des": "从不同的网站中调取妹子写真,但是无漏点,放心使用(安全版ghs)。命令:meizi。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "acg-multi",
|
||||||
|
"version": "1.0",
|
||||||
|
"section": "profile",
|
||||||
|
"maintainer": "TNTcraftHIM",
|
||||||
|
"size": "1.4 kb",
|
||||||
|
"supported": true,
|
||||||
|
"des-short": "多网站随机获取ACG图",
|
||||||
|
"des": "从几个不同的图库中随机获取二刺螈(bushi)ACG图片,基本都是手机尺寸的图。命令:acgm。"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
51
meizi.py
Normal file
51
meizi.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
from random import randint
|
||||||
|
from time import sleep
|
||||||
|
from requests import get
|
||||||
|
from pagermaid.listener import listener
|
||||||
|
from os import remove
|
||||||
|
|
||||||
|
|
||||||
|
@listener(is_plugin=True, outgoing=True, command="meizi",
|
||||||
|
description="多网站随机获取性感(可能)的写真")
|
||||||
|
async def joke(context):
|
||||||
|
await context.edit("获取中 . . .")
|
||||||
|
status = False
|
||||||
|
for _ in range (20): #最多重试20次
|
||||||
|
website = randint(0, 7)
|
||||||
|
if website == 0:
|
||||||
|
img = get("https://mm.52.mk")
|
||||||
|
elif website == 1:
|
||||||
|
img = get("https://api.helloworld.la/xiezhen_xinggan.php")
|
||||||
|
elif website == 2:
|
||||||
|
img = get("https://api.helloworld.la/bizhi_meizi.php")
|
||||||
|
elif website == 3:
|
||||||
|
img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%A4%A7%E5%B0%BA%E5%BA%A6")
|
||||||
|
elif website == 4:
|
||||||
|
img = get("https://cdn.seovx.com/?mom=302")
|
||||||
|
elif website == 5:
|
||||||
|
img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%A6%B9%E5%AD%90")
|
||||||
|
elif website == 6:
|
||||||
|
img = get("https://uploadbeta.com/api/pictures/random/?key=%E6%8E%A8%E5%A5%B3%E9%83%8E")
|
||||||
|
elif website == 7:
|
||||||
|
img = get("https://uploadbeta.com/api/pictures/random/?key=%E5%A5%B3%E7%A5%9E")
|
||||||
|
if img.status_code == 200:
|
||||||
|
with open(r'tu.png', 'wb') as f:
|
||||||
|
await context.edit("正在上传图片")
|
||||||
|
f.write(img.content)
|
||||||
|
await context.client.send_file(
|
||||||
|
context.chat_id,
|
||||||
|
"tu.png",
|
||||||
|
reply_to=None,
|
||||||
|
caption=None
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
remove('tu.png')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
status = True
|
||||||
|
break #成功了就赶紧结束啦!
|
||||||
|
|
||||||
|
if not status:
|
||||||
|
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器(没有妹子看啦!) 。")
|
||||||
|
sleep(2)
|
||||||
|
await context.delete()
|
28
portball.py
28
portball.py
@ -6,9 +6,9 @@ from datetime import timedelta
|
|||||||
from telethon.tl.types import ChannelParticipantsAdmins
|
from telethon.tl.types import ChannelParticipantsAdmins
|
||||||
|
|
||||||
|
|
||||||
@listener(is_plugin=True, outgoing=True, command="portball",
|
@listener(incoming=True, outgoing=True, command="portball",
|
||||||
description="回复你要临时禁言的人的消息来实现XX秒的禁言。",
|
description="回复你要临时禁言的人的消息来实现XX秒的禁言",
|
||||||
parameters="<理由> <时间 单位:秒>")
|
parameters="<理由>(空格)<时间/秒>")
|
||||||
async def portball(context):
|
async def portball(context):
|
||||||
reply = await context.get_reply_message()
|
reply = await context.get_reply_message()
|
||||||
if context.is_group:
|
if context.is_group:
|
||||||
@ -18,11 +18,8 @@ async def portball(context):
|
|||||||
last_name = ''
|
last_name = ''
|
||||||
else:
|
else:
|
||||||
last_name = reply.sender.last_name
|
last_name = reply.sender.last_name
|
||||||
if not len(action) == 2:
|
|
||||||
await context.edit('你好蠢诶,没有参数我怎么禁言嘛。')
|
|
||||||
return
|
|
||||||
if int(action[1])<60:
|
if int(action[1])<60:
|
||||||
notification = await bot.send_message(context.chat_id, '诶呀不要小于60秒啦')
|
notification = await bot.send_message(context.chat_id, '诶呀不要小于60秒啦', reply_to = context.id)
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
try:
|
try:
|
||||||
@ -33,31 +30,34 @@ async def portball(context):
|
|||||||
admins = await context.client.get_participants(context.chat, filter=ChannelParticipantsAdmins)
|
admins = await context.client.get_participants(context.chat, filter=ChannelParticipantsAdmins)
|
||||||
if context.sender in admins:
|
if context.sender in admins:
|
||||||
try:
|
try:
|
||||||
await bot.edit_permissions(context.chat_id, reply.sender.id, timedelta(seconds=int(action[1].replace(' ',''))), send_messages=False)
|
await bot.edit_permissions(context.chat_id, reply.sender.id, timedelta(seconds=int(action[1].replace(' ',''))), send_messages=False, send_media=False, send_stickers=False, send_gifs=False, send_games=False, send_inline=False, send_polls=False, invite_users=False, change_info=False, pin_messages=False)
|
||||||
await bot.send_message(
|
portball_message = await bot.send_message(
|
||||||
context.chat_id,
|
context.chat_id,
|
||||||
f'[{reply.sender.first_name}{last_name}](tg://user?id={reply.sender.id}) 由于 {action[0]} \n'
|
f'[{reply.sender.first_name}{last_name}](tg://user?id={reply.sender.id}) 由于 {action[0]} \n'
|
||||||
f'被暂时禁言{action[1]}秒',
|
f'被暂时禁言{action[1]}秒',
|
||||||
reply_to = reply.id
|
reply_to = reply.id
|
||||||
)
|
)
|
||||||
|
await context.delete()
|
||||||
|
await sleep(int(action[1].replace(' ','')))
|
||||||
|
await portball_message.delete()
|
||||||
except rpcerrorlist.UserAdminInvalidError:
|
except rpcerrorlist.UserAdminInvalidError:
|
||||||
notification = await bot.send_message(context.chat_id, '错误:我没有管理员权限或我的权限比被封禁的人要小')
|
notification = await bot.send_message(context.chat_id, '错误:我没有管理员权限或我的权限比被封禁的人要小', reply_to = context.id)
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
except rpcerrorlist.ChatAdminRequiredError:
|
except rpcerrorlist.ChatAdminRequiredError:
|
||||||
notification = await bot.send_message(context.chat_id, '错误:我没有管理员权限或我的权限比被封禁的人要小')
|
notification = await bot.send_message(context.chat_id, '错误:我没有管理员权限或我的权限比被封禁的人要小', reply_to = context.id)
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
else:
|
else:
|
||||||
notification = await bot.send_message(context.chat_id, '诶呀你不是管理员,不要给人家塞口球啊')
|
notification = await bot.send_message(context.chat_id, '诶呀你不是管理员,不要给人家塞口球啊', reply_to = context.id)
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
else:
|
else:
|
||||||
notification = await bot.send_message(context.chat_id, '你好蠢诶,都没有回复人,我哪知道你要搞谁的事情……')
|
notification = await bot.send_message(context.chat_id, '你好蠢诶,都没有回复人,我哪知道你要搞谁的事情……', reply_to = context.id)
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
else:
|
else:
|
||||||
notification = await bot.send_message(context.chat_id, '你好蠢诶,又不是群组,怎么禁言啦!')
|
notification = await bot.send_message(context.chat_id, '你好蠢诶,又不是群组,怎么禁言啦!', reply_to = context.id)
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
await notification.delete()
|
await notification.delete()
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user