Skip to main content

Not another freaking fork

Project description

PyPI Downloads Code style: black black-formatted CodeQL Discord Documentation Status

What is this?

This is NAFF, a python API wrapper for Discord. NAFF is intended to be fast, easy to use, and easily modified to suit your needs.

Features:

  • ✅ 100% coverage of the application commands API
  • ✅ Dynamic cache with TTL support
  • ✅ Modern and Pythonic API
  • ✅ Proper rate-limit handling
  • ✅ Feature parity with most other Discord API wrappers

Is this just another Discord.py fork?

While this library shares features and some stylistic choices with discord.py, it is completely separate from them. We think discord.py is a fantastic library, but we disagree with the direction and design decisions that were made by it.

How do I use this?

Here is a basic example:

from naff import Client, Button, ButtonStyles, CommandTypes, context_menu, prefixed_command, listen

bot = Client(sync_interactions=True)


@listen()
async def on_startup():
    print("Ready")
    print(f"This bot is owned by {bot.owner}")


@prefixed_command()
async def test_button(ctx):
    await ctx.send("Blurple button example!", components=Button(ButtonStyles.BLURPLE, "Click me"))


@context_menu(name="User menu", context_type=CommandTypes.USER, scopes=[931832853770149918])
async def user_context(ctx):
    await ctx.send("Context menu example!", ephemeral=True)


bot.start("TOKEN")

For more examples check out our examples repo or the docs. You also can explore projects with the dis-snek topic.

If you get stuck join our Discord server.

"Can I contribute to this project?"

Of course, we welcome all contributions to this library. Just ensure you follow our requirements. If youre stuck for things to contribute, check out our GitHub Projects for inspiration.

Links:

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

naff-1.4.1.tar.gz (607.2 kB view details)

Uploaded Source

Built Distribution

naff-1.4.1-py3-none-any.whl (658.6 kB view details)

Uploaded Python 3

File details

Details for the file naff-1.4.1.tar.gz.

File metadata

  • Download URL: naff-1.4.1.tar.gz
  • Upload date:
  • Size: 607.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for naff-1.4.1.tar.gz
Algorithm Hash digest
SHA256 7c86d111d8cdde408077f9f6c4459e9c7824225c03124aad37f524609f59f23d
MD5 076012c90f8daf93cf7f14f245242d78
BLAKE2b-256 45511e03ecbcd8fc3bfae321a06203125f522abc88cee939384113998ab2f6cf

See more details on using hashes here.

File details

Details for the file naff-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: naff-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 658.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for naff-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59a863ca0c50339c9cbb332c818883a031ecda4bd4ae851dc5b3eb362310b6fe
MD5 7957538ed9292929c4f2e026ecd68627
BLAKE2b-256 38aa089764c32c7f555996f60fb6b1ad22c8df0800c63aa6d11b7350f4058194

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