Skip to main content

A package with all sorts of utilities for discord.py.

Project description

dpytils

What is this?

It is a package with basic utilities for a discord bot main in discord.py.

How do I use it?

To use it, simply import it, and initialize the dpytils.utils() class.

from dpytils import utils
utilities = utils()

What utilities are there?

Currently, only three. randcolor(), permsfromvalue(), and GuildConverter.

randcolor

This function will return a random color (of type int) to be used for a discord embed, or anything else.

permsfromvalue

This function will return another class, discordPermissions, which contains the following values.

permsfromvalue.perms_raw

The raw discord permissions object from discord.py.

permsfromvalue.perms_true

A list of permission names that are True from the given value

permsfromvalue.perms_false

A list of permission names that are False from the given value

permsfromvalue.perms_nice

A nicely formatted string with a list of permissions, and emoji to show true/false.

GuildConverter

This will attempt to convert whatever you give it to a guild object. You must pass both a context object, and a value to search for to it. Example:

search_term = "test ser"
guild = await utils().GuildConverter(ctx, search_term)
return guild # <discord.Guild id=647392781730285629 name='bot testing server'>

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

dpytils-0.0.5.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

dpytils-0.0.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file dpytils-0.0.5.tar.gz.

File metadata

  • Download URL: dpytils-0.0.5.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for dpytils-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5e764f6d58b83705a084f63e09893d98dfeca92ad4e40dfa084490fc0adaf068
MD5 9c524d041fe0bb959aa8fbbcec447959
BLAKE2b-256 85b6dd85a2e9b7022a25429e4f2cd686c9c5ac5066ca2d03f94288c2666d4fe3

See more details on using hashes here.

File details

Details for the file dpytils-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: dpytils-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for dpytils-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b4eae95df8418f9e6fb8e3cbb1c3ebd3bc8e3d9e69374135fc070bd4ed414b8
MD5 eaec81e88f7073cb38afad5d71ab50d4
BLAKE2b-256 9b0eca702202c5ae7bf3da30dee443e459ee695cad0ad85ac921c9c5c40ac0b0

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