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
from khl import TextMsg, Bot, Cert
# init Cert and Bot
cert = Cert(client_id='xxxxxxxx', client_secret='xxxxxxxx', token='xxxxxxxx')
bot = Bot(cmd_prefix=['!', '!'], cert=cert)
@bot.command(name='hello')
async def roll(msg: TextMsg):
await msg.reply('world!')
bot.run()
# now invite the bot to ur server,
# and type '!hello'(in any channel) to check ur san today!
# (remember to grant read & send permissions to the bot first)
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 certi manually, turning to this post for guide:
certificate verify failed: unable to get local issuer certificate
short-term roadmap
refactor
- move api req urls into
hardcoded
docs
- examples & tutorials (active @TWT233)
- docstring (v0.0.10)
perf:
- async bot.run() (v0.0.11)
- websocket refine (v0.0.11/.12)
feat:
T1:
- private messages
- refactor
Msg
, support multimedia msg- add kinds of multimedia msg (v0.0.10)
- new events, new handler system (v0.0.10)(active @TWT233)
- upload assets (v0.0.10)
- no prefix commands (v0.0.10)
- fix
cmd_prefix=[]
- fix
T2:
- bot send args (done by @fi6, waiting for merge)
- needs more practice and design
- command & arg parse system(long term design needed)
- event class(interface)
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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
khl.py-0.0.10-py3-none-any.whl
(27.5 kB
view hashes)