@@ -474,7 +474,7 @@ async def fetch_stream_key(self, token: str):
474474 data = await self ._http .get_stream_key (token , str (self .id ))
475475 return data
476476
477- async def fetch_following (self , token : str = None ) -> List ["FollowEvent" ]:
477+ async def fetch_following (self , token : Optional [ str ] = None ) -> List ["FollowEvent" ]:
478478 """|coro|
479479
480480 Fetches a list of users that this user is following.
@@ -493,7 +493,7 @@ async def fetch_following(self, token: str = None) -> List["FollowEvent"]:
493493 data = await self ._http .get_user_follows (token = token , from_id = str (self .id ))
494494 return [FollowEvent (self ._http , d , from_ = self ) for d in data ]
495495
496- async def fetch_followers (self , token : str = None ):
496+ async def fetch_followers (self , token : Optional [ str ] = None ):
497497 """|coro|
498498
499499 Fetches a list of users that are following this user.
@@ -509,10 +509,10 @@ async def fetch_followers(self, token: str = None):
509509 """
510510 from .models import FollowEvent
511511
512- data = await self ._http .get_user_follows (to_id = str (self .id ))
512+ data = await self ._http .get_user_follows (token = token , to_id = str (self .id ))
513513 return [FollowEvent (self ._http , d , to = self ) for d in data ]
514514
515- async def fetch_follow (self , to_user : "PartialUser" , token : str = None ):
515+ async def fetch_follow (self , to_user : "PartialUser" , token : Optional [ str ] = None ):
516516 """|coro|
517517
518518 Check if a user follows another user or when they followed a user.
@@ -531,9 +531,44 @@ async def fetch_follow(self, to_user: "PartialUser", token: str = None):
531531 raise TypeError (f"to_user must be a PartialUser not { type (to_user )} " )
532532 from .models import FollowEvent
533533
534- data = await self ._http .get_user_follows (from_id = str (self .id ), to_id = str (to_user .id ))
534+ data = await self ._http .get_user_follows (token = token , from_id = str (self .id ), to_id = str (to_user .id ))
535535 return FollowEvent (self ._http , data [0 ]) if data else None
536536
537+ async def fetch_follower_count (self , token : Optional [str ] = None ) -> int :
538+ """|coro|
539+
540+ Fetches a list of users that are following this user.
541+
542+ Parameters
543+ -----------
544+ token: Optional[:class:`str`]
545+ An oauth token to use instead of the bots token
546+
547+ Returns
548+ --------
549+ :class:`int`
550+ """
551+
552+ data = await self ._http .get_follow_count (token = token , to_id = str (self .id ))
553+ return data ["total" ]
554+
555+ async def fetch_following_count (self , token : Optional [str ] = None ) -> int :
556+ """|coro|
557+
558+ Fetches a list of users that this user is following.
559+
560+ Parameters
561+ -----------
562+ token: Optional[:class:`str`]
563+ An oauth token to use instead of the bots token
564+
565+ Returns
566+ --------
567+ :class:`int`
568+ """
569+ data = await self ._http .get_follow_count (token = token , from_id = str (self .id ))
570+ return data ["total" ]
571+
537572 async def follow (self , userid : int , token : str , * , notifications = False ):
538573 """|coro|
539574
0 commit comments