Skip to main content

An API wrapper for discordbotslist.us.to written in Python

Project description

DiscordBotsList.py

Codacy Badge

An API wrapper for discordbotslist.us.to written in Python

Installation

Install via pip

pip install dbl-us-to

Features

  • GET bot likes and check if user has liked
  • GET bot comments
  • GET bot stats
  • POST your own bot stats

Methods

In the following I'll be explaining all methods this library offers. Notice that you have to await these since they are async.

DBLClient.get_likes(bot_id)

Arguments

Parameter Type Description
bot_id int The bot id to get the likes of. Defaults to your own bot id.

Returns List of Like objects. These have the following attributes.

Attributes Type Description
bot_id int The bot id the like is associated with
author discord.User User object if cached else None. Use author_id as fallback.
author_id int The id of the author who liked
date datetime.datime When the like was created

DBLClient.get_comments(bot_id)

Arguments

Parameter Type Description
bot_id int The bot id to get the comments of. Defaults to your own bot id.

Returns List of Comment objects. These have the following attributes.

Attributes Type Description
id str Unique id of the comment
bot_id int The bot id the comment is associated with
author discord.User User object if cached else None. Use author_id as fallback.
author_id int The id of the author who liked
content str The content of the comment
date datetime.datime When the comment was created

DBLClient.get_stats(bot_id)

Arguments

Parameter Type Description
bot_id int The bot id to get the stats of. Defaults to your own bot id.

Returns Stats object. These have the following attributes.

Attributes Type Description
bot_id int The bot id the stats are associated with
guild_count int The amount of guilds the bot is on
channel_count int The amount of all guild channels the bot can see
user_count int The amount of all users the bot can see
date datetime.datime When the stats was last updated

DBLClient.post_stats()

Updates your bots stats on DiscordBotsList.us.to

Example

import discord
from dbl_us_to import DBLClient


intents = discord.Intents.default()
intents.members = True
bot = discord.Client(intents=intents)

api_key = "DiscordBotsList API Key"
dbl = DBLClient(bot, api_key)


@bot.event
async def on_ready():
    likes = dbl.get_likes()
    for like in likes:
        print(like.author)


bot.run("bot token")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbl-us-to-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

dbl_us_to-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file dbl-us-to-1.0.0.tar.gz.

File metadata

  • Download URL: dbl-us-to-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for dbl-us-to-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9b7c24ee95b7c2d03572ed28a0ad7f80c2fea3d2619118858d6d8a380876a0cf
MD5 bed900fb494df41276bdb435e02bbe3a
BLAKE2b-256 9ad390615924d8eb67a16289f8e91f509947da348b38fe618126b54fb955e8a2

See more details on using hashes here.

File details

Details for the file dbl_us_to-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dbl_us_to-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for dbl_us_to-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 766910e60fe55626cb7e552959f19da960f2c16f8c5257b9dbfab6daeb3e1d44
MD5 5430d41dbd7aa7ff7a1f042ce9b91ea7
BLAKE2b-256 f1950cf42ab4f558502e7fbf4afaf0e2859521916757f0a7d4accfd1236111a6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page