Skip to main content

A powerful asynchronous library for creating Discord bots in Python.

Project description


A blazing fast Discord API wrapper that you can't deny

Support | Documentation | Source


Hata is an async Discord API wrapper written in Python named after Hata no Kokoro.

Why hata?

  • Multiple simultaneous clients

    Hata can run multiple clients from the same instance without sacrificing performance, all while being easy to code.

  • Performant

    Fast concurrent code based on async/await paradigm with cache control, PyPy support and much more!

  • Newest API features

    Whatever Discord decides to release/update/break Hata will support it natively in no time!

  • 100% Python

    Built in Python! Easy to code, easy to read, easy to maintain.

Why not hata?

  • Small community

    Hata has a small but, slowly growing community. The chance of getting help outside of our cosy discord server equals to zero.


The library reference is available here & the tutorial is available here


The following example answers on ping message.

from hata import Client

Nue = Client('TOKEN')
async def ready(client):
    print(f'{client:f} logged in.')
async def message_create(client, message):

    if message.content == 'ping':
        await client.message_create(, 'pong')


An improved example using the commands extension to handle common use cases.

from hata import Client

Saki = Client('TOKEN', extensions='commands', prefix='s!')
async def ready(client):
    print(f'{client:f} logged in.')

async def ping(client, message):
    return 'pong'


Or use slash commands!

from hata import Client, Guild

GUILD = Guild.precreate(guild_id)

Seija = Client('TOKEN', extensions='slash')
async def ready(client):
    print(f'{client:f} logged in.')

async def ping():
    return 'pong'


Note: You need to restart your client, or the slash command wont show up. If there are more than 50 integrations (bots) in a guild, some of the (integrations) bots wont be able to use slash commands. This is currently a Discord limitation.

If you are wondering, how to start more clients, just put the two code snippet into the same file.

Hata leaves the main thread free, client.start() blocks it only till the client logs in (or fails it), although you can still use the start_clients function, what as it says, starts up all the non-running clients parallelly, so go ahead and start python with -i option, then interact with the clients from your interactive console in runtime.


To install Hata simply do

# Linux/OS X
$ python3 -m pip install hata

# Windows
$ python -m pip install hata

# Voice Support
$ python -m pip install hata[voice]

And you are good to go! Hata has native pypy support as well if you need some more speed!




Get in touch

If you have issues, suggestions, want to contribute, or just want to send cute neko pictures, join our discord server.


Shout-Out to our brave testers, who are helping the most to improve Hata!

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hata, version 1.1.111
Filename, size File type Python version Upload date Hashes
Filename, size hata-1.1.111-py3-none-any.whl (1.6 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size hata-1.1.111.tar.gz (1.0 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page