Skip to main content

An asynchronous API wrapper for the Motion Development bot list API.

Project description

Motiondev

An asynchronous API wrapper for the Motion Development bot list API.

Installation

# Linux/macOS
python3 -m pip install -U motiondev

# Windows
py -3 -m pip install -U motiondev

From GitHub

# Linux/macOS
python3 -m pip install -U git@https://github.com/itswilliboy/motiondev

# Windows
py -3 -m pip install -U git@https://github.com/itswilliboy/motiondev

Quick Example

import asyncio
import motiondev

# Declaration
async def main():
    client = motiondev.Client('My API key')

    # Async context manager for automatic cleanup
    async with client:
        bot = await client.get_bot(000000000000000) # Your bot ID
        print(bot.name, bot.library) # Example#0001, discord.py

        votes = await bot.get_votes() # Get the bot's votes
        print(votes) # [<Vote id=...,>, ...]

        print(bot.servers) # 0
        bot = await bot.update(servers=10) # Update the server count on the bot list
        print(bot.servers) # 10


asyncio.run(main())

Issues

Feel free to report any issue/bug or ask any question on the issue tracker.

Documentation

Client

Client(token)

Represents a client that sends requests to the motiondevelopment.top API.

Parameters

token: str

The API key found in your bot's API settings.

Methods

get_bot(bot_id)

Get a bot with the by its ID.

Raises:

  • NotFound - The bot was not found.
  • Forbidden - You are not authorized to get this bot.

Returns:

The bot from the bot ID.

Return Type:

Bot


Bot

Represents a bot on the bot list.

Attributes

name: str

The bot's name.

id: int

The bot's ID.

avatar_url: Optional[str]

The bot's avatar URL (as PNG).

status: str

The bot's status.

status: str

Invite URL to the bot's support server.

invite: str

The bot's OAuth invite URL.

library: str

The library the bot was built with.

list_date: datetime.date

The date the bot was listed on the bot list.

owner_id: int

The bot's owner's ID.

owner_name: str

The bot's owner's.

prefix: str

The bot's prefix.

public_flags: int

The bot's public flags.

servers: int

The amount of servers displayed on the bot list.

site: str

The bot's website.

topics: List[str]

The topics the bot is listed under (max of 3).

vanity_url: str

The bot's vanity URL.

big_description: str

The bot's big description.

small_description: str

The bot's small description.

owner: User

The bot's owner

co_owners: List[Optional[User]]

The bot's co-owners.

Methods

update(*, servers)

Update the bot on the bot list.

Parameters:

  • servers (int) - The bot's server count

Raises:

  • Forbbiden - You are not authorized to update this bot.
  • HTTPException - Something went wrong when trying to update the bot.

Returns:

The bot with the updated parameters.

Return Type:

Bot

get_votes()

Get all of the bot's votes

Raises:

  • Forbbiden - You are not authorized to get the votes of this bot.
  • HTTPException - Something went wrong when trying to update the bot.

Returns:

A list with all of the votes (empty if there are no votes).

Return Type:

List[Optional[Vote]]


User

Represents a user on the bot list.

Attributes

id: int

The voter's ID

username: str

The voter's username.


Vote

Represents a vote on a bot.

Attributes

id: int

The voter's ID.

vote_time: datetime

The date & time when the vote was added.

user: VoteUser

The user who voted, is None if the vote is a placeholder. VoteUser is a subclass of User but it's username is not implemented as it seems that the API currently does not supply a correct username.

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

motiondev-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

motiondev-0.1.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file motiondev-0.1.0.tar.gz.

File metadata

  • Download URL: motiondev-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for motiondev-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d0cda9d4d255fdebc5d7ab508125164d6eacd4c8ee249a0eac9ce07106f750c9
MD5 42857d90963af8aa8a631bbefa7768cc
BLAKE2b-256 75ddd82f9aaeb374b06e3a8ae30186ae3a3ca157f6b74fa7b434463ed463132b

See more details on using hashes here.

File details

Details for the file motiondev-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: motiondev-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for motiondev-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02b4ba538b45f8651f3e45c01e4b9bdfeb8835852d0e9e73811be0627f25310f
MD5 26892c9097b68011501e06318977d69c
BLAKE2b-256 2aa3b67da27e2aed9409c60c6a545b71301a80633d25020b89093540a8364662

See more details on using hashes here.

Supported by

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