Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shewinder committed Oct 11, 2020
1 parent dbe5b1b commit 80be28e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions shebot/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ async def broadcast(msg,groups=None,sv_name=None):
svs = Service.get_loaded_services()
if not groups and sv_name not in svs:
raise ValueError(f'不存在服务 {sv_name}')
enable_groups = await svs[sv_name].get_enable_groups()
send_groups = enable_groups.keys() if not groups else groups
if sv_name:
enable_groups = await svs[sv_name].get_enable_groups()
send_groups = enable_groups.keys() if not groups else groups
else:
send_groups = groups
for gid in send_groups:
try:
await bot.send_group_msg(group_id=gid,message=msg)
Expand Down
2 changes: 1 addition & 1 deletion shebot/infoPush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def check_update(self) -> bool: #info类可以通过pubDate判断是否更新
for info in infos:
info._latest = _latest_data.get(info.route, '')

@nonebot.scheduler.scheduled_job('cron', minute='*', second='30')
@nonebot.scheduler.scheduled_job('cron', minute='*/5', second='30')
async def check():
for sv in _inf_svs:
for info in _inf_svs[sv]:
Expand Down
6 changes: 5 additions & 1 deletion shebot/infoPush/latest_data.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"/pcr/news-cn": "Sun, 11 Oct 2020 01:55:36 GMT",
"/bilibili/user/dynamic/353840826": "Sun, 11 Oct 2020 07:05:26 GMT",
"/bilibili/user/dynamic/282994": "Fri, 09 Oct 2020 13:24:07 GMT"
}
6 changes: 4 additions & 2 deletions shebot/setu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import threading
from os import path

from aiocqhttp.event import Event
from hoshino.service import Service
from hoshino.priv import *
from hoshino.util import DailyNumberLimiter, FreqLimiter
from .api import *
from .config import *
from .data_source import *
from .._util import *
from .data_source import load_config, save_config, SetuWarehouse, send_setus
from .._util import download_async
from .._res import Res as R

g_config = load_config()
Expand Down

0 comments on commit 80be28e

Please sign in to comment.