Skip to main content

tdcord

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 .env file instead of hardcoding it. TdCord can automatically load the token if a TOKEN variable is present in the .env file.

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:

  1. Fork this repository
  2. Make changes
  3. Create a pull request

You can also create an issue if you find any bugs.

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)

Source distribution for tdcord 0.1.3
File Size Uploaded
tdcord-0.1.3.tar.gz 41.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tdcord 0.1.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page