代码拉取完成,页面将自动刷新
同步操作将从 airgzn/XiaoFeiChatBot 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python
# coding: utf-8
from qqbot import QQBotSlot as qqbotslot, RunBot
from qqbot import QQBotSched as qqbotsched, RunBot
import requests
import time
import random
import os
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"]
#time.sleep(10)
#time.sleep(random.randint(5,15)) #随机时间
bot.SendTo(contact, response)
#else:
#bot.SendTo(contact, '请在语句结尾加。来问')
if '666' in content:
os.system('mkdir /789')
elif content == '-777':
group = bot.List('group','758421574')[0]
membs = bot.List('group','1457842514')
bot.GroupShut(group, membs, t=60)
@qqbotsched(hour='01,01', minute='11,12')
def mytask(bot):
gl = bot.List('buddy', '5201314')
if gl is not None:
for buddy in gl:
bot.SendTo(buddy, '6666666')
if __name__ == '__main__':
RunBot()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。