Skip to main content

discord-helpers

Downloads PyPI
A helper module for discord.py and its forks

Current Features (v0.2.0)

  • Invite tracker
  • Per server custom prefixes using SQLite3 - aiosqlite
  • Paginator
  • A chatbot coroutine function to get a reply from an AI (The Random Stuff API)
  • A cycling status for your bot
  • A function to create a rich embed with every feature in a simple line of code
  • A coroutine function to find a webhook from a channel and send a message via it
  • Coroutine functions for making GET and POST requests easily

Installation

$ pip install -U discord-helpers
$ pip install -U discord-helpers[sqlite]

# development
$ pip install -U git+https://github.com/Dorukyum/discord-helpers.git

Examples

More bot examples can be found in the examples directory.

Prefixes

import discord
from discord.ext import commands, helpers

bot = commands.Bot(command_prefix = "!", intents = discord.Intents.all())

@bot.event
async def on_ready():
    bot.db = helpers.Database(bot, "data.db") # also used in the examples below
    bot.command_prefix = bot.db.custom_prefix("!")
@bot.event
async def on_message(message):
	if message.mentions[0] == client.user:
		await bot.db.reply_with_prefix(message)
@bot.command()
async def change_prefix(ctx, *, prefix):
	await bot.db.change_prefix(ctx.guild.id, prefix)
    await ctx.send(f"Successfuly changed the prefix to `{prefix}`.")

Chatbot

@bot.event
async def on_message(message):
	if message.channel.id == my_chatbot_channel_id:
		response = await helpers.chatbot(message.content, api_key=my_api_key)
		await message.reply(response)

Paginator

@bot.command()
async def send_pages(ctx):
    paginator = helpers.Paginator(bot, pages=[
        discord.Embed(title="Page 1"),
        discord.Embed(title="Page 2"),
    ])
    paginator.add_page(discord.Embed(title="Page 3"))
    await paginator.start(ctx)

Webhooks

@bot.command()
async def send_webhook(ctx, *, text):
	await helpers.Webhooks.find_and_send(text, channel=ctx.channel, webhook_name="Test")

Metadata

Release files for discord-helpers 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discord-helpers 0.2.0
File Size Uploaded Provenance Actions
discord-helpers-0.2.0.tar.gz 7.8 kB Without provenance Details for discord-helpers-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for discord-helpers 0.2.0
File Interpreter ABI Platform Actions
discord_helpers-0.2.0-py3-none-any.whl Python 3 none any Details for discord_helpers-0.2.0-py3-none-any.whl

Total release size: 16.8 kB

Release files / discord-helpers-0.2.0.tar.gz

Download URL discord-helpers-0.2.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dda3f604f4193cc942245921c7a8908086ed94bcaac5cda3be7e6673ccf1e469
BLAKE2b-256 checksum
How to use checksums
aaadb1474f53df43f9e4471315939693859c1403d7548d1dbf4c9217fc87907f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / discord_helpers-0.2.0-py3-none-any.whl

Download URL discord_helpers-0.2.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef5186c2449582dab26265df4861b17474e97faea5eb0bfcd3da491fa38bb0fb
BLAKE2b-256 checksum
How to use checksums
455d1b88e1afc3f9b2073041e3652c7ec7b273346ed87ac9e8a78c98a9d42497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Security for discord-helpers 0.2.0

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.

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