a wechat bot developed for geeks
Project description
WechatBot
WechatBot is a wechat bot built for geeks.
1. 快速上手
1.1 安装
pip install wechatbot
1.2 用法
贴上示例代码, wechatbot/ping.py。
# -*- coding:utf-8 -*-
from wechatbot import WechatBot
class MyBot(WechatBot):
def text_reply(self, msg):
if msg == 'ping':
return 'pong'
if __name__ == '__main__':
bot = MyBot()
bot.run()
扫描二维码之后,机器人就跑起来啦。 这时,可以向机器人发送一个ping的消息来看看服务是否正常。 对了,短暂退出不需要重新扫描二维码登录哦~
2. 规划
接下来会把Bot做成一个更加基础的服务,只对外暴露两个模块:
在接受指令之后发送定制消息
后续会增加session的概念,可能会支持AI,并通过向机器人发送消息来开关AI。
来自用户的每一条消息都是作为一个命令。
主动向某个用户发送消息
谢谢阅读! Good luck, have fun!
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
wechatbot-1.0.7.tar.gz
(6.8 kB
view hashes)
Built Distribution
wechatbot-1.0.7-py2-none-any.whl
(10.1 kB
view hashes)
Close
Hashes for wechatbot-1.0.7-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b07a07f16537dbff5b56fcca3af2f11ce3ff6999921fb0d65175709f5ecd0fa5 |
|
MD5 | 2e9c051f9c8b7eb23aabdb38700fb8c2 |
|
BLAKE2b-256 | 0948ffe4777a10aa42446a784a26520fa1ea59f62d7e72d76c8344bcf5967795 |