mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 07:47:39 +00:00
📝 xjj zpr 删掉了一些不必要的文字 (#152)
* 发送一些好康的图片,养眼 * Rename 小姐姐.py to xjj.py * Rename 纸片人.py to zpr.py
This commit is contained in:
parent
5c28591fa1
commit
afd152b408
82
xjj.py
82
xjj.py
@ -1,41 +1,41 @@
|
|||||||
import random
|
import random
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from requests import get
|
from requests import get
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
from os import remove
|
from os import remove
|
||||||
|
|
||||||
|
|
||||||
@listener(is_plugin=True, outgoing=True, command="xjj",
|
@listener(is_plugin=True, outgoing=True, command="xjj",
|
||||||
description="随机小姐姐写真")
|
description="随机小姐姐写真")
|
||||||
async def ghs(context):
|
async def ghs(context):
|
||||||
await context.edit("拍小姐姐写真中 . . .")
|
await context.edit("拍小姐姐写真中 . . .")
|
||||||
status = False
|
status = False
|
||||||
for _ in range (10): #最多重试10次
|
for _ in range (10): #最多重试10次
|
||||||
website = random.randint(0,0)
|
website = random.randint(0,0)
|
||||||
filename = "xjj" + str(random.random())[2:] + ".png"
|
filename = "xjj" + str(random.random())[2:] + ".png"
|
||||||
try:
|
try:
|
||||||
if website == 0:
|
if website == 0:
|
||||||
img = get("https://api.pixivweb.com/api.php?return=img")
|
img = get("https://api.pixivweb.com/api.php?return=img")
|
||||||
if img.status_code == 200:
|
if img.status_code == 200:
|
||||||
with open(filename, 'wb') as f:
|
with open(filename, 'wb') as f:
|
||||||
f.write(img.content)
|
f.write(img.content)
|
||||||
await context.edit("写真我拍好辣,上传中 . . .")
|
await context.edit("写真我拍好辣,上传中 . . .")
|
||||||
await context.client.send_file(context.chat_id,filename,caption="小姐姐来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)")
|
await context.client.send_file(context.chat_id,filename,caption="小姐姐来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)")
|
||||||
status = True
|
status = True
|
||||||
break #成功了就赶紧结束啦!
|
break #成功了就赶紧结束啦!
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
remove(filename)
|
remove(filename)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
remove(filename)
|
remove(filename)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
await context.delete()
|
await context.delete()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if not status:
|
if not status:
|
||||||
await context.client.send_message(context.chat_id,"出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。")
|
await context.client.send_message(context.chat_id,"出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。")
|
||||||
|
82
zpr.py
82
zpr.py
@ -1,41 +1,41 @@
|
|||||||
import random
|
import random
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from requests import get
|
from requests import get
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
from os import remove
|
from os import remove
|
||||||
|
|
||||||
|
|
||||||
@listener(is_plugin=True, outgoing=True, command="zpr",
|
@listener(is_plugin=True, outgoing=True, command="zpr",
|
||||||
description="随机小姐姐或纸片人写真")
|
description="随机小姐姐或纸片人写真")
|
||||||
async def ghs(context):
|
async def ghs(context):
|
||||||
await context.edit("拍小姐姐或纸片人写真中 . . .")
|
await context.edit("拍小姐姐或纸片人写真中 . . .")
|
||||||
status = False
|
status = False
|
||||||
for _ in range (10): #最多重试10次
|
for _ in range (10): #最多重试10次
|
||||||
website = random.randint(0,0)
|
website = random.randint(0,0)
|
||||||
filename = "zpr" + str(random.random())[2:] + ".png"
|
filename = "zpr" + str(random.random())[2:] + ".png"
|
||||||
try:
|
try:
|
||||||
if website == 0:
|
if website == 0:
|
||||||
img = get("https://api.pixivweb.com/anime18r.php?return=img")
|
img = get("https://api.pixivweb.com/anime18r.php?return=img")
|
||||||
if img.status_code == 200:
|
if img.status_code == 200:
|
||||||
with open(filename, 'wb') as f:
|
with open(filename, 'wb') as f:
|
||||||
f.write(img.content)
|
f.write(img.content)
|
||||||
await context.edit("写真我拍好辣,上传中 . . .")
|
await context.edit("写真我拍好辣,上传中 . . .")
|
||||||
await context.client.send_file(context.chat_id,filename,caption="来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)")
|
await context.client.send_file(context.chat_id,filename,caption="来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)")
|
||||||
status = True
|
status = True
|
||||||
break #成功了就赶紧结束啦!
|
break #成功了就赶紧结束啦!
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
remove(filename)
|
remove(filename)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
remove(filename)
|
remove(filename)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
await context.delete()
|
await context.delete()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if not status:
|
if not status:
|
||||||
await context.client.send_message(context.chat_id,"出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。")
|
await context.client.send_message(context.chat_id,"出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。")
|
||||||
|
Loading…
Reference in New Issue
Block a user