yuyo.list_status provides an easy way to update a Bot's stats on bot lists.
By default this will track the count per-shard, meaning that this'll have to be running on each shard cluster instance to properly keep track of the count. This will also be relying on the GUILDS intent being declared unless a custom counting strategy is passed.
manager = list_status.ServiceManager.from_gateway_bot(bot) manager.add_service(list_status.TopGGService("TOKEN"))
Top.GG API tokens are found in the "webhooks" tab while editing the bot's entry.
manager = list_status.ServiceManager.from_gateway_bot(bot) manager.add_service(list_status.DiscordBotListService("TOKEN"))
manager = list_status.ServiceManager.from_gateway_bot(bot) manager.add_service(list_status.BotsGGService("TOKEN"))
Bots.gg API tokens are found at https://discord.bots.gg/docs (when logged in).
manager = list_status.ServiceManager.from_gateway_bot(bot) @manager.with_service() async def service(client: list_status.AbstractManager, /) -> None: count = await client.counter.count() if isinstance(count, int): ... # This is a global count of how many guilds the bot is in. else: # This is a mapping of shard IDs to guild counts. count # type: collections.abc.Mapping[int, int]
Services are simply asynchronous callbacks which call
AbstractManager.counter.count to get the most recent count(s) then pass it on.
cache # type: sake.abc.GuildCache counter = list_status.SakeStrategy(cache) manager = list_status.ServiceManager.from_gateway_bot(bot, strategy=counter)
The Sake strategy lets this be used with an asynchronous Redis guild cache. This strategy will only be keeping track of a global guild count (rather than per-shard like the default counters) and therefore you should only ever need to have one instance of this running with Sake.