An easy-to-use extension for Discord.py and Pycord with some utility functions.
Features
✏️ Reduce boilerplate code
- Easy cog management
- Embed templates
- Datetime and file utilities
- Wrapper for aiosqlite
✨ Error handling
- Automatic error handling for slash commands
- Error webhook reports
- Custom logging
⚙️ Extensions
- Help command - Automatically generate a help command for your bot
- Status changer - Change the bot's status in an interval
- Blacklist - Block users from using your bot
Installing
Python 3.9 or higher is required.
pip install tdcord
You can also install the latest version from GitHub. Note that this version may be unstable and requires git to be installed.
pip install git+https://github.com/tdius9/tdcord
If you need the latest version in your requirements.txt file, you can add this line:
tdcord @ git+https://github.com/tdius/tdcord
Useful Links
Examples
- For more examples, see the example repository or the sample code.
- Note: It's recommended to load the token from a
.envfile instead of hardcoding it. TdCord can automatically load the token if aTOKENvariable is present in the.envfile.
Pycord
import tdcord
import discord
bot = tdcord.Bot(
intents=discord.Intents.default()
)
if __name__ == "__main__":
bot.load_cogs("cogs") # Load all cogs in the "cogs" folder
bot.run("TOKEN")
Discord.py
import asyncio
import discord
import tdcord
class Bot(tdcord.Bot):
def __init__(self):
super().__init__(intents=discord.Intents.default())
async def setup_hook(self):
await super().setup_hook()
await self.tree.sync()
async def main():
async with Bot() as bot:
bot.add_help_command()
bot.load_cogs("cogs") # Load all cogs in the "cogs" folder
await bot.start("TOKEN")
if __name__ == "__main__":
asyncio.run(main())
Contributing
I am always happy to receive contributions. Here is how to do it:
- Fork this repository
- Make changes
- Create a pull request
You can also create an issue if you find any bugs.
Metadata
Release files for tdcord 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tdcord-0.1.3.tar.gz | 41.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tdcord-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.0 kB
Release files / tdcord-0.1.3.tar.gz
| Download URL | tdcord-0.1.3.tar.gz |
|---|---|
| Size | 41.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96b112b93a30e65f5c49008404be1eb792f680db749d0b159c362d5fb8bd0241
|
|
BLAKE2b-256 checksum How to use checksums |
49f2f712b172bb6a7e813e53e2c0fc92ea5bf231d0f724202d5c72de9ee6c9a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / tdcord-0.1.3-py3-none-any.whl
| Download URL | tdcord-0.1.3-py3-none-any.whl |
|---|---|
| Size | 47.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33870bd943f2f12ea9b361590fb36b6f2c8ded71be04616c0881925dd04b4e1c
|
|
BLAKE2b-256 checksum How to use checksums |
996c3180cfe5974e9ef3fdfc9eb5a1aad10a8147f3bc3855efe0390d3e31447b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for tdcord 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.