pythonqqbot简易复读机

qqbot 简易⼩插件:
具体的插件⽤法请访问
基于smartQQ的qqbot 已经被弃⽤

from datetime import datetime
import time
defonQQMessage(bot,contact,member,content):
if content =='-hello':
bot.SendTo(contact,'你好我是机器⼈')
elif content =='-stop':
bot.SendTo(contact,'你好我关了哦。')
bot.Stop()
tempWord =''
tempTime =0
times =0
lastContent =""
defonQQMessage(bot,contact,member,content):
global tempWord
global tempTime
global times
now = time.time()
print(times)
当复读超过
次的时候就不要复读了
if times >20:#
20
print('times > 10')
return-1
elif(now - tempTime)>3000:
print('times more than 3s')
三秒内有⼈复读则启动复读程序
elif(now - tempTime)<=3000:#
当前内容与之前的⼀份内容⼀样启动复读
if(tempWord == content):#
bot.SendTo(contact,content)
times +=1
tempWord =''
return
else:
tempWord = content
else:
print('it wont happen')
tempTime =float(now)
启动并且注册插件之后,qq机器⼈就被注⼊了灵魂,可以实现复读功能了。后续的更为⾼级的复读功能正在开发中。

 

原文地址:https://fendou.gqr5.cn/3001.html
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

THE END
喜欢就打个赏呗
点赞12 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容