2021-04-25 04:27:29 +00:00
|
|
|
|
import random
|
|
|
|
|
from requests import get
|
2022-01-18 08:47:20 +00:00
|
|
|
|
from pagermaid import version
|
2021-04-25 04:27:29 +00:00
|
|
|
|
from pagermaid.listener import listener
|
2021-06-16 07:09:40 +00:00
|
|
|
|
from pagermaid.utils import alias_command
|
2021-04-25 04:27:29 +00:00
|
|
|
|
from os import remove
|
|
|
|
|
|
|
|
|
|
|
2021-06-16 07:09:40 +00:00
|
|
|
|
@listener(is_plugin=True, outgoing=True, command=alias_command("xjj"),
|
2021-04-25 04:27:29 +00:00
|
|
|
|
description="随机小姐姐写真")
|
|
|
|
|
async def ghs(context):
|
|
|
|
|
await context.edit("拍小姐姐写真中 . . .")
|
|
|
|
|
status = False
|
2021-06-16 07:09:40 +00:00
|
|
|
|
for _ in range(10): # 最多重试10次
|
|
|
|
|
website = random.randint(0, 0)
|
2021-04-25 04:27:29 +00:00
|
|
|
|
filename = "xjj" + str(random.random())[2:] + ".png"
|
|
|
|
|
try:
|
|
|
|
|
if website == 0:
|
2021-07-05 08:40:02 +00:00
|
|
|
|
img = get("https://acg.toubiec.cn/random.php")
|
2021-04-25 04:27:29 +00:00
|
|
|
|
if img.status_code == 200:
|
|
|
|
|
with open(filename, 'wb') as f:
|
|
|
|
|
f.write(img.content)
|
|
|
|
|
await context.edit("写真我拍好辣,上传中 . . .")
|
2021-06-16 07:09:40 +00:00
|
|
|
|
await context.client.send_file(context.chat_id, filename, caption="小姐姐来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)")
|
2021-04-25 04:27:29 +00:00
|
|
|
|
status = True
|
2021-06-16 07:09:40 +00:00
|
|
|
|
break # 成功了就赶紧结束啦!
|
2021-04-25 04:27:29 +00:00
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
remove(filename)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
continue
|
|
|
|
|
try:
|
|
|
|
|
remove(filename)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
await context.delete()
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
if not status:
|
2021-06-16 07:09:40 +00:00
|
|
|
|
await context.client.send_message(context.chat_id, "出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。")
|