1
0
forked from bot/app

status适配satori

This commit is contained in:
Expliyh
2024-05-16 21:17:10 +08:00
parent 7abdac7c9c
commit eaf57f2c33
9 changed files with 191 additions and 107 deletions

View File

@ -0,0 +1,13 @@
from nonebot.adapters import satori
async def count_friends(bot: satori.Bot) -> int:
cnt: int = 0
friend_response = await bot.friend_list()
while friend_response.next is not None:
cnt += len(friend_response.data)
friend_response = await bot.friend_list(next_token=friend_response.next)
cnt += len(friend_response.data)
return cnt - 1