Skip to content

Commit c0e15a6

Browse files
committed
fix: block
1 parent b735974 commit c0e15a6

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/plugins/block/__init__.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ def refresh_accounts(self) -> None:
2525
if time.time() - self.refresh_time < 60 and self.accounts:
2626
return
2727

28-
if not self.accounts and not os.path.exists(self.accounts_dir):
29-
return
30-
3128
with self.refresh_lock:
3229
self.refresh_time = time.time()
33-
go_cqhttp_plugin_accounts: list[int] = [
34-
int(d) for d in os.listdir(self.accounts_dir) if d.isnumeric()
35-
]
30+
if os.path.exists(self.accounts_dir):
31+
go_cqhttp_plugin_accounts: list[int] = [
32+
int(d) for d in os.listdir(self.accounts_dir) if d.isnumeric()
33+
]
34+
else:
35+
go_cqhttp_plugin_accounts = []
3636
onebot_accounts: list[int] = [
37-
int(self_id) for self_id, bot in get_bots().items() if self_id.isnumeric() and bot.type == 'onebot'
37+
int(self_id) for self_id, bot in get_bots().items() if self_id.isnumeric() and bot.type == 'OneBot V11'
3838
]
3939
self.accounts = list(set(go_cqhttp_plugin_accounts + onebot_accounts))
4040

@@ -70,3 +70,8 @@ async def is_sleep(self, bot: Bot, event: Union[GroupMessageEvent, GroupIncrease
7070
block=True,
7171
rule=Rule(account_manager.is_sleep)
7272
)
73+
74+
75+
@other_bot_msg.handle()
76+
async def _():
77+
return

0 commit comments

Comments
 (0)