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, send_my_msg
class MyBot(WechatBot):
def text_reply(self, msg):
if "ping" in msg:
return 'pong'
if __name__ == "__main__":
# 要发送的消息,填写你的微信名
send_my_msg("Hello", u"孙传武")
写完你的代码之后,可以执行`make develop`,根据提示扫描二维码之后,机器人就跑起来啦。 这时,可以向机器人发送一个ping的消息来看看服务是否正常。 对了,短暂退出不需要重新扫描二维码登录哦~
2. 规划
接下来会把Bot做成一个更加基础的服务,只对外暴露两个模块:
在接受指令之后发送定制消息 [done]
主动向某个用户发送消息 [done]
谢谢阅读!
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.12.tar.gz
(7.6 kB
view hashes)
Built Distribution
wechatbot-1.0.12-py2-none-any.whl
(11.1 kB
view hashes)
Close
Hashes for wechatbot-1.0.12-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad65446678649d4e2fcd0284fa34287e4beb2326fbca74b8339ae685bf9289fb |
|
MD5 | f80b14519dbcd8dbb3d9d7ce1b327a8e |
|
BLAKE2b-256 | 5cebe4869deb7de3c5722ab290816fcfeff48420ee6076baebe9d61279f04752 |