DiscordBotsList.Api is the official Top.gg library for .NET. It exposes both an unauthenticated client for reading public bot and user data and an authenticated client for posting your bot’s stats and generating widget URLs.
Installation
Install with the .NET CLI:PackageReference directly to your .csproj:
x.y.z with the latest version published on NuGet.
Unauthenticated usage
UseDiscordBotListApi to read public data without an API token. This is useful for looking up any bot or user listed on Top.gg.
unauthenticated.cs
Authenticated usage
UseAuthDiscordBotListApi when you need to post stats on behalf of your bot. Pass your bot’s Discord ID and your Top.gg API token to the constructor.
authenticated.cs
Widgets
Generate a widget image URL for your bot’s listing usingSmallWidgetOptions. You can customize the widget type and colors before calling Build.
widget.cs
Embed the returned URL in an
<img> tag or Markdown image to display the widget on your website or README.