Skip to main content

A powerful asynchronous library for creating Discord bots in Python.

Project description

Hata

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

Support Guild | Topical documentation | Examples | Technical documentation | Source


New hata versions use Discord API V10 .

About

Hata is an asynchronous Discord API wrapper built on top of scarletio. It is designed to be easy to use, with also providing rich API offering everything what an advanced developer might need.

Named after Hata no Kokoro from Touhou Project.

Why hata?

  • Multiple simultaneous clients

    Hata can run multiple clients from the same instance without sacrificing performance.

  • 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.

Usage

Simple example implementing a ping command.

from hata import Client, Guild, wait_for_interruption

GUILD = Guild.precreate(guild_id)

Seija = Client('TOKEN', extensions = ['slash'])

@Seija.events
async def ready(client):
    print(f'{client:f} logged in.')

@Seija.interactions(guild = GUILD)
async def ping():
    """ping-pong"""
    return 'pong'

Seija.start()

wait_for_interruption()

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.

Sometimes leaving the main thread might cause problems when trying to shut down the bot(s). At this case, you might want to use wait_for_interruption(), which disconnects the clients gracefully and closes the event loop on keyboard interrupt.

Installation

To install Hata simply do

$ python3 -m pip install hata

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

Dependencies

Requirements

Optional

Get in touch

If you have issues, suggestions, want to contribute, or just want to hang out, join our discord server.

Invite

Acknowledgements

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

Project details


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.

Source Distribution

hata-1.3.95.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

hata-1.3.95-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file hata-1.3.95.tar.gz.

File metadata

  • Download URL: hata-1.3.95.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.32.3 setuptools/50.3.2 requests-toolbelt/0.10.1 tqdm/4.50.2 CPython/3.8.20

File hashes

Hashes for hata-1.3.95.tar.gz
Algorithm Hash digest
SHA256 6b05372168d446d0b8240761164cf971084087f6169b83a107c1a1d6850eee2d
MD5 07d86d608cd73a8620cacbd54e3fdf8b
BLAKE2b-256 7d4fbed32a9d96034a79d8704ed7cd5a5f503f725c1e22c6c28f7b19e7e833b1

See more details on using hashes here.

File details

Details for the file hata-1.3.95-py3-none-any.whl.

File metadata

  • Download URL: hata-1.3.95-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.32.3 setuptools/50.3.2 requests-toolbelt/0.10.1 tqdm/4.50.2 CPython/3.8.20

File hashes

Hashes for hata-1.3.95-py3-none-any.whl
Algorithm Hash digest
SHA256 d2b9a80759578927733779bb948726d46b6cf69d27ef0c003bb77b54d2762894
MD5 3bf75779a0bafe2c347834a19ea7d171
BLAKE2b-256 f719c73070daa0af4e3d94788d8da0b4f0fc0dba48fe8162593472200b193808

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