API Reference¶
The following section outlines the API of dbots.
Classes¶
-
class
dbots.
Poster
(client_id, server_count, user_count, voice_connections, on_custom_post=None, **options)¶ A class that posts server count to listing sites.
- Parameters
client_id (
str
) – The client ID used for posting to a service.server_count (function or coroutine) – The function to use when retrieving the amount of servers.
user_count (function or coroutine) – The function to use when retrieving the amount of users.
voice_connections (function or coroutine) – The function to use when retrieving the amount of voice connections.
on_custom_post (Optional[function or coroutine]) – The function to use when posting to a custom service. This function will be used with the named parameters being server_count, user_count and voice_connections.
loop (Optional[
asyncio.AbstractEventLoop
]) – Theasyncio.AbstractEventLoop
to use for asynchronous operations. Defaults toNone
, in which case the default event loop is used via asyncio.get_event_loop().sharding (Optional[
bool
]) – Whether or not to use sharding values.shard_count (Optional[
int
]) – The amount of shards the client has.shard_id (Optional[
int
]) – The shard ID the poster us posting for.proxy (Optional[
str
]) – Proxy URL.proxy_auth (Optional[
aiohttp.BasicAuth
]) – An object that represents proxy HTTP Basic Authorization.api_keys (Optional[
dict
]) – A dictionary of API keys with the key being service keys and values being tokens.
-
client_id
¶ The client ID of the poster.
-
kill_loop
()¶ Cancels the current posting loop.
-
manual_post
(server_count, service=None, user_count=None, voice_connections=None) → dbots.http.HTTPResponse¶ Manually posts a server count to a service.
- Parameters
server_count (
int
) – The server count to post to the service.service (Optional[
str
]) – The service to post to. Can be None to post to all services or custom to use the custom post method.user_count (Optional[
int
]) – The user count to post to the service.voice_connections (Optional[
int
]) – The voice connection count to post to the service.
-
post
(service=None) → dbots.http.HTTPResponse¶ Posts the current clients server count to a service.
- Parameters
service (Optional[
str
]) – The service to post to. Can be None to post to all services or custom to use the custom post method.
-
remove_key
(service: str) → str¶ Removes an API key.
- Parameters
service (
str
) – The service key to remove.
-
set_key
(service: str, key: str) → str¶ Sets an API key.
-
shard_count
¶ The shard count of the poster.
-
shard_id
¶ The shard ID of the poster.
-
class
dbots.
Service
(token=None, **options)¶ Represents any postable service.
- Parameters
token (Optional[
str
]) – The token that the class will use to authorize requests.proxy (Optional[
str
]) – Proxy URL.proxy_auth (Optional[
aiohttp.BasicAuth
]) – An object that represents proxy HTTP Basic Authorization.
-
http
¶ The HTTP client the service is using.
- Type
-
static
get
(key: str)¶ Gets a service from a key.
- Parameters
key (
str
) – The name of the service to get.
-
has_token
¶ Whether or not the service class has a token.
-
class
dbots.
AsyncLoop
(timeout, callback)¶
HTTP Classes¶
-
class
dbots.
HTTPClient
(base_url=None, proxy=None, proxy_auth=None)¶ Represents an HTTP client that can send requests.
-
class
dbots.
HTTPResponse
(response, text)¶ A wrapped response from an
HTTPClient
:.-
raw
¶ The raw response from
aiohttp
.
-
Services¶
-
class
dbots.
Arcane
(token=None, **options)¶ Represents the Arcane Bot Center service.
-
class
dbots.
Blist
(token=None, **options)¶ Represents the Blist service.
See also
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_votes
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who voted this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
BotListSpace
(token=None, **options)¶ Represents the botlist.space service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_uptime
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the uptime of a bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_votes
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who voted this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bots
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of bots on this service.
-
get_statistics
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the statistics of this service.
-
get_user
(user_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the user listed on this service.
- Parameters
user_id (
str
) – The user’s ID.
-
-
class
dbots.
BotsDataBase
(token=None, **options)¶ Represents the BotsDataBase service.
-
get_bot
(user_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
BotsForDiscord
(token=None, **options)¶ Represents the Bots For Discord service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_votes
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who voted this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_user
(user_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the user listed on this service.
- Parameters
user_id (
str
) – The user’s ID.
-
-
class
dbots.
BotsOnDiscord
(token=None, **options)¶ Represents the Bots On Discord service.
-
class
dbots.
Carbon
(token=None, **options)¶ Represents the Carbonitex service.
See also
-
class
dbots.
DBLista
(token=None, **options)¶ Represents the DBLista service.
See also
-
add_bot
(data: dict) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Updates the bot’s listing with the data provided.
- Parameters
data (
dict
) – The data being posted. This should include the ID of the bot.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot’s stats on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bots
(page: int = 0) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot’s stats on this service.
- Parameters
page (
int
) – The page you want to get.
-
get_rejected_bots
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of rejected bots on this service.
-
get_unverified_bots
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of unverified bots on this service.
-
rate_bot
(bot_id: str, data: dict) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Adds a rating to a bot on the service.
-
remove_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Removes a bot from the service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
remove_rating
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Removes a rating from a bot on the service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
DiscordBotsCo
(token=None, **options)¶ Represents the DiscordBots.co service.
-
class
dbots.
DiscordBotsGG
(token=None, **options)¶ Represents the Discord Bots service.
-
class
dbots.
DiscordAppsDev
(token=None, **options)¶ Represents the Discord Apps service.
-
get_apps
(**query) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of applications on this service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bots
(**query) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of bots on this service.
-
-
class
dbots.
DiscordBoats
(token=None, **options)¶ Represents the Discord Boats service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_user
(user_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the user listed on this service.
- Parameters
user_id (
str
) – The user’s ID.
-
-
class
dbots.
DiscordBotList
(token=None, **options)¶ Represents the Discord Bot List service.
-
class
dbots.
DiscordBotWorld
(token=None, **options)¶ Represents the Discord Bot World service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_likes
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who liked this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_stats
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot’s stats on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
DiscordExtremeList
(token=None, **options)¶ Represents the Discord Extreme List service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_likes
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who liked this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_stats
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot’s stats on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
DiscordLabs
(token=None, **options)¶ Represents the Discord Labs service.
-
class
dbots.
DiscordListology
(token=None, **options)¶ Represents the DiscordListology service.
-
get_bot_stats
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot’s stats listed on this service. :param bot_id: The bot’s ID. :type bot_id:
str
-
get_guild_stats
(guild_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the guild’s stats listed on this service. :param guild_id: The guild’s ID. :type guild_id:
str
-
-
class
dbots.
LBots
(token=None, **options)¶ Represents the LBots service.
See also
-
get_bot_favorites
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who favorited this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_panel_guild_settings
(bot_id: str, guild_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who favorited this bot on this service.
-
invalidate
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Invalidates the token being used in the request.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
ListMyBots
(token=None, **options)¶ Represents the List My Bots service.
See also
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_status_widget_url
(bot_id: str, **query) → str¶ Gets the status widget URL for this bot.
- Parameters
bot_id (
str
) – The bot’s ID.**query – The query string to append to the URL.
-
-
class
dbots.
MythicalBots
(token=None, **options)¶ Represents the Mythical Bots service.
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
-
class
dbots.
SpaceBotsList
(token=None, **options)¶ Represents the Space Bots List service.
-
class
dbots.
TopCord
(token=None, **options)¶ Represents the TopCord service.
See also
-
class
dbots.
TopGG
(token=None, **options)¶ Represents the Top.gg service.
See also
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_stats
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot’s stats listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bot_votes
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the list of people who voted this bot on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bots
(**query) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of bots on this service.
- Parameters
**query – The query string to append to the URL.
-
get_user
(user_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the user listed on this service.
- Parameters
user_id (
str
) – The user’s ID.
-
get_widget_url
(bot_id: str, small_widget: str = None, **query) → str¶ Gets the widget URL for this bot.
-
-
class
dbots.
WonderBotList
(token=None, **options)¶ Represents the Wonder Bot List service.
-
class
dbots.
YABL
(token=None, **options)¶ Represents the YABL service.
See also
-
get_bot
(bot_id: str) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets the bot listed on this service.
- Parameters
bot_id (
str
) – The bot’s ID.
-
get_bots
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of bots on this service.
-
get_bots_by_page
(**query) → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a page of bots on this service.
- Parameters
**query – The query string to append to the URL.
-
get_random_bots
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets 20 random bots from this service.
-
get_unverified_bots
() → dbots.http.HTTPResponse¶ This function is a coroutine returning a HTTPResponse.
Gets a list of unverified bots on this service.
-