Skip to main content

Python SDK for kaiheila.cn API

Project description

> 加入我们的 khl 服务器 | Join our server on khl

khl.py

Python SDK for kaiheila.cn API

install

Python requirement: >= Python 3.6

pip install khl.py

quickly enroll

Minimal example:

from khl import Bot, Message

# init Bot
bot = Bot(token='xxxxxxxxxxxxxxxxxxxxxxxxx')


# register command, send `/hello` in channel to invoke
@bot.command(name='hello')
async def world(msg: Message):
    await msg.reply('world!')


# everything done, go ahead now!
bot.run()
# now invite the bot to a server, and send '/hello' in any channel
# (remember to grant the bot with read & send permissions)

For more example and tutorial, please turn to example

notes for Mac OSX users:

if you encounter this error:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)

please install certificate manually, turning to this post for guide:

certificate verify failed: unable to get local issuer certificate

short-term roadmap

feat

  • card message
    • default colors
  • helper function for apis
  • pass bot to command
  • timer
  • return-as-reply(issue #22)

CONTRIBUTION

welcome! we are glad to get help from community hands, and don't be shy to show your code, we can improve it together even if it's not perfect right now

if there is any bug/perf/feature request, we are willing to deal with your issue/pull request!

the only red tape:

only accept commits satisfying Conventional Commits convention

search plugins with keyword commitizen for your editor/IDE, then addict to write commit message

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

khl.py-0.1.3.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

khl.py-0.1.3-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file khl.py-0.1.3.tar.gz.

File metadata

  • Download URL: khl.py-0.1.3.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.6.8

File hashes

Hashes for khl.py-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6d1d487956df1adcc0aac113506a22c5d20bf11087f3fcbf73f1bc791508e7d7
MD5 8b07e31ed7edd11e7343478e9aabfa9d
BLAKE2b-256 02b97622a8e87725c3bed86fdc057f50ca42ce2be9397815bddac51eaa82b640

See more details on using hashes here.

File details

Details for the file khl.py-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: khl.py-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.6.8

File hashes

Hashes for khl.py-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c3cacdae80d6fd98b7933dbe235ed4e005cc05c0fc1fdcb804dec801e0763168
MD5 11ee9f28810553caf4261b5ac9f01edd
BLAKE2b-256 5a79f955194da23625d032ca490ee9f61c597875412bdc71920173c8f4afe3a8

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