Skip to main content

SDK for kaiheila.cn in python

Project description

khl.py

SDK for kaiheila.cn in python

install

Python requirement: >= Python 3.6

pip install khl.py

quickly enroll

import random

from khl import TextMsg, Bot, Cert

cert = Cert(client_id='xxxxxx', client_secret='xxxxxx', token='xxxxxx')
bot = Bot(cmd_prefix=['!', '!'], cert=cert)


@bot.command(name='roll')
async def roll(session):
    await session.reply(f'{random.randint(int(session.args[0]), int(session.args[1]))}')


bot.run()
# now invite the bot to ur server,
# and type '!roll 1 100'(in any channel) to check ur san today!
# (remember to grant read & send permissions to the bot first)

short-term roadmap

docs:

  • docs init
  • detailed docstring

perf:

  • check SN
  • refactor Msg, support multimedia msg (active @TWT233)
    • introduce MsgCtx with this
  • check

feat:

T1:

  • support websocket
  • command & arg parse system
    • sub command system (active @fi6 @TWT233)
  • event listener for bot

T2:

  • log system
  • MsgCtx design
  • command alias

bug fix:

  • error parsing str in ." pattern (cmd_prefix+unclosing quote)

commit message rules

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.0.8.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

khl.py-0.0.8-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

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