Skip to main content

An easy-to-use extension for Discord.py and Pycord

Project description

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.

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

tdcord-0.1.3.tar.gz (41.7 kB view details)

Uploaded Source

Built Distribution

tdcord-0.1.3-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file tdcord-0.1.3.tar.gz.

File metadata

  • Download URL: tdcord-0.1.3.tar.gz
  • Upload date:
  • Size: 41.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for tdcord-0.1.3.tar.gz
Algorithm Hash digest
SHA256 96b112b93a30e65f5c49008404be1eb792f680db749d0b159c362d5fb8bd0241
MD5 26daab166adfb43cdb4079fbfdc883bd
BLAKE2b-256 49f2f712b172bb6a7e813e53e2c0fc92ea5bf231d0f724202d5c72de9ee6c9a2

See more details on using hashes here.

File details

Details for the file tdcord-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tdcord-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for tdcord-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33870bd943f2f12ea9b361590fb36b6f2c8ded71be04616c0881925dd04b4e1c
MD5 1d20d29a31b0d0cdc7656dba48167599
BLAKE2b-256 996c3180cfe5974e9ef3fdfc9eb5a1aad10a8147f3bc3855efe0390d3e31447b

See more details on using hashes here.

Supported by

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