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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e764f6d58b83705a084f63e09893d98dfeca92ad4e40dfa084490fc0adaf068
|
|
| MD5 |
9c524d041fe0bb959aa8fbbcec447959
|
|
| BLAKE2b-256 |
85b6dd85a2e9b7022a25429e4f2cd686c9c5ac5066ca2d03f94288c2666d4fe3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b4eae95df8418f9e6fb8e3cbb1c3ebd3bc8e3d9e69374135fc070bd4ed414b8
|
|
| MD5 |
eaec81e88f7073cb38afad5d71ab50d4
|
|
| BLAKE2b-256 |
9b0eca702202c5ae7bf3da30dee443e459ee695cad0ad85ac921c9c5c40ac0b0
|