mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-06-01 21:19:49 +08:00
fix
This commit is contained in:
parent
9a5fdd6690
commit
fb555a9595
54
__init__.py
54
__init__.py
@ -1,12 +1,14 @@
|
|||||||
from .getImg import draw_pic,draw_abyss_pic,draw_abyss0_pic,draw_wordcloud
|
from .getImg import draw_pic,draw_abyss_pic,draw_abyss0_pic,draw_wordcloud
|
||||||
from .getDB import connectDB,selectDB,cookiesDB,cacheDB,deletecache,CheckDB,TransDB,OpenPush,GetMysInfo,GetDaily,GetSignList,MysSign,GetSignInfo,OpCookies,GetAward,GetWeaponInfo,GetCharInfo
|
from .getDB import (CheckDB, GetAward, GetCharInfo, GetDaily, GetMysInfo,
|
||||||
|
GetSignInfo, GetSignList, GetWeaponInfo, MysSign, OpenPush,
|
||||||
|
connectDB, cookiesDB, deletecache, selectDB)
|
||||||
from nonebot import *
|
from nonebot import *
|
||||||
from hoshino import Service,R,priv,util
|
from hoshino import Service,R,priv,util
|
||||||
from hoshino.typing import MessageSegment,CQEvent, HoshinoBot
|
from hoshino.typing import MessageSegment,CQEvent, HoshinoBot
|
||||||
|
|
||||||
import requests,random,os,json,re,time,datetime,string,base64
|
import requests,random,os,json,re,time,datetime,string,base64
|
||||||
|
|
||||||
|
import threading
|
||||||
import hoshino
|
import hoshino
|
||||||
import asyncio
|
import asyncio
|
||||||
import hashlib
|
import hashlib
|
||||||
@ -141,21 +143,45 @@ async def _(bot:HoshinoBot, ev: CQEvent):
|
|||||||
@sv.scheduled_job('cron', hour='0')
|
@sv.scheduled_job('cron', hour='0')
|
||||||
async def delete():
|
async def delete():
|
||||||
deletecache()
|
deletecache()
|
||||||
|
|
||||||
|
@sv.on_fullmatch('全部重签')
|
||||||
|
async def _(bot:HoshinoBot, ev: CQEvent):
|
||||||
|
if ev.user_id not in bot.config.SUPERUSERS:
|
||||||
|
return
|
||||||
|
await bot.send(ev,"已开始执行")
|
||||||
|
dailysign()
|
||||||
|
|
||||||
#每日零点半进行米游社签到
|
#每日零点半进行米游社签到
|
||||||
@sv.scheduled_job('cron', hour='0',minute="30")
|
@sv.scheduled_job('cron', hour='0',minute="30")
|
||||||
async def dailysign():
|
async def dailysign():
|
||||||
conn = sqlite3.connect('ID_DATA.db')
|
dailysign()
|
||||||
c = conn.cursor()
|
|
||||||
cursor = c.execute("SELECT * FROM NewCookiesTable WHERE StatusB != ?",("off",))
|
def dailysign():
|
||||||
c_data = cursor.fetchall()
|
async def sign_thread():
|
||||||
for row in c_data:
|
conn = sqlite3.connect('ID_DATA.db')
|
||||||
im = await sign(str(row[0]))
|
c = conn.cursor()
|
||||||
if row[4] == "on":
|
cursor = c.execute(
|
||||||
await bot.send_private_msg(user_id = row[2],message = im)
|
"SELECT * FROM NewCookiesTable WHERE StatusB != ?", ("off",))
|
||||||
else:
|
c_data = cursor.fetchall()
|
||||||
await bot.send_group_msg(group_id = row[4],message = f"[CQ:at,qq={row[2]}]" + "\n" + im)
|
|
||||||
|
count = 0
|
||||||
|
for row in c_data:
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
im = await sign(str(row[0]))
|
||||||
|
if row[4] == "on":
|
||||||
|
await bot.send_private_msg(user_id = row[2],message = im)
|
||||||
|
else:
|
||||||
|
await bot.send_group_msg(group_id = row[4],message = f"[CQ:at,qq={row[2]}]" + "\n" + im)
|
||||||
|
|
||||||
|
if count == 10:
|
||||||
|
count = 0
|
||||||
|
time.sleep(30)
|
||||||
|
|
||||||
|
t = threading.Thread(target=lambda: asyncio.run(sign_thread()))
|
||||||
|
t.setDaemon(True)
|
||||||
|
t.start()
|
||||||
|
|
||||||
#每隔半小时检测树脂是否超过设定值
|
#每隔半小时检测树脂是否超过设定值
|
||||||
@sv.scheduled_job('interval', minutes=30)
|
@sv.scheduled_job('interval', minutes=30)
|
||||||
async def push():
|
async def push():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user