-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhttpClient.py
More file actions
26 lines (25 loc) · 816 Bytes
/
httpClient.py
File metadata and controls
26 lines (25 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from typing import List
from bot import httpClient
from interactions import Channel
async def getAllUsersFromReaction(channelId: int, messageId:int, emoji:str) -> List[dict]:
reactions = await httpClient.get_reactions_of_emoji(
channel_id=channelId,
message_id=messageId,
emoji=emoji,
limit=100
)
i = 0
added = 0
if len(reactions) == 100:
# loop until you get all of them
while added == 100:
new_reactions = await httpClient.get_reactions_of_emoji(
channel_id=channelId,
message_id=messageId,
emoji=emoji,
limit=100,
after= (i:=i+1) * 100
)
added = len(new_reactions)
reactions += new_reactions
return reactions