56 Star 168 Fork 34

airgzn / QQChatBot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
aiyun.py 763 Bytes
一键复制 编辑 原始数据 按行查看 历史
airgzn 提交于 2017-03-26 20:14 . 重命名文件ai.py为aiyun.py
#!/usr/bin/env python
# coding: utf-8
from qqbot import QQBotSlot as qqbotslot, RunBot
import requests
bot_api="http://127.0.0.1:8000/get_response"
@qqbotslot
def onQQMessage(bot, contact, member, content):
if '@ME' in content:
user_input = content
payload={"user_input":user_input}
response = requests.get(bot_api,params=payload).json()["response"]
bot.SendTo(contact, member.name+','+response)
elif contact.ctype == 'buddy':
user_input = content
payload={"user_input":user_input}
response = requests.get(bot_api,params=payload).json()["response"]
bot.SendTo(contact, response)
#else:
#bot.SendTo(contact, 'aiyun')
RunBot()
Python
1
https://gitee.com/airgzn/QQChatBot.git
git@gitee.com:airgzn/QQChatBot.git
airgzn
QQChatBot
QQChatBot
master

搜索帮助