Skip to main content

A professional Discord utility library by @kroxy

Project description

kroxy

A professional Discord utility library by @kroxy.

Install

pip install kroxy

Modules

kroxy.discord

Module Description
api Async Discord REST API client
commands Slash & prefix command builders
utils Embed builder, mentions, timestamps, permissions
antinuke Anti-nuke protection with rate-limit tracking
checkers Permission & role checks with hierarchy validation
giveaway Full-featured weighted giveaway system
music Queue-based music player state manager

kroxy.website (coming soon)


Quick Examples

Anti-Nuke

from kroxy.discord import AntiNuke

antinuke = AntiNuke(whitelist=[OWNER_ID])

async def punish(action, user_id, guild):
    print(f"NUKE DETECTED: {action} by {user_id}")

antinuke.on_trigger = punish
antinuke.punishment = "ban"

# In your event handler:
await antinuke.on_member_ban(user_id=some_user_id, guild=guild)

Giveaway

from kroxy.discord.giveaway import GiveawayManager

manager = GiveawayManager()

async def on_giveaway_end(giveaway, winners):
    print(f"Winners of {giveaway.prize}: {winners}")

manager.on_end = on_giveaway_end

giveaway = await manager.create(
    prize="Discord Nitro",
    host_id=123456789,
    channel_id=987654321,
    guild_id=111111111,
    duration=3600,     # 1 hour
    winner_count=2,
)

Embed Builder

from kroxy.discord import Utils

embed = Utils.build_embed(
    title="Hello from kroxy!",
    description="This is a professional embed.",
    color=0x5865F2,
    fields=[{"name": "Field", "value": "Value", "inline": True}],
    footer="kroxy library",
    timestamp=True,
)

Slash Command

from kroxy.discord.commands import SlashCommand, Option

@SlashCommand.decorator(
    name="ping",
    description="Check bot latency",
)
async def ping(interaction):
    await interaction.response.send_message("Pong!")

Music Player

from kroxy.discord.music import MusicPlayerManager, Track

manager = MusicPlayerManager()
player = manager.get_or_create(guild_id=111111111, channel_id=222222222)

track = Track(
    title="My Song",
    url="https://youtube.com/...",
    stream_url="https://...",
    duration=240,
    requester_id=123456789,
)
player.queue.add(track)
await player.play_next()

License

MIT © kroxy

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

kroxy-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kroxy-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file kroxy-0.1.0.tar.gz.

File metadata

  • Download URL: kroxy-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kroxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b73d0afdde1036b67ef2544154df1cbad5d655b2c1bd16f1f037c0c8e4bd99be
MD5 b69402ed0acbe84449708248ee70f4d3
BLAKE2b-256 11ba007dc0cf8e7fac36ef725d3726c7cabf04f98c08a51286e73b700e3a24b3

See more details on using hashes here.

File details

Details for the file kroxy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kroxy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kroxy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 743e0601c5b72bda97a8eec402f9ee5698f47440611b4bea7513640b2f461d69
MD5 9de0e3f9629179cfe3208d91f86ed01a
BLAKE2b-256 5bb9c17c3c33a142e5584751ba27ab5ed8bcacc01d7eef2839627ed491c5c16b

See more details on using hashes here.

Supported by

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