mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-14 11:27:37 +08:00
14 lines
374 B
Python
14 lines
374 B
Python
|
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
|