Skip to content

List Status#

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)

TopGGService is used to set as one of the targets for updating the bot's guild count.

Top.GG API tokens are found in the "webhooks" tab while editing the bot's entry.

manager = list_status.ServiceManager.from_gateway_bot(bot)

DiscordBotListService is used to set as one of the targets for updating the bot's guild count.

manager = list_status.ServiceManager.from_gateway_bot(bot)

BotsGGService is used to set as one of the targets for updating the bot's guild count. API tokens are found at (when logged in).

Custom service#
manager = list_status.ServiceManager.from_gateway_bot(bot)

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.

        # This is a mapping of shard IDs to guild counts.
        count  # type:[int, int]

Services are simply asynchronous callbacks which call AbstractManager.counter.count to get the most recent count(s) then pass it on.

AbstractManager.counter.count may raise CountUnknownError to indicate an unknown state and will return either int to indicate a global guild count or Mapping[int, int] to give per-shard guild counts.

Counting Strategies#

Sake counting#
cache  # type:
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.