xiyaowong / python--iotbot Goto Github PK
View Code? Open in Web Editor NEWIOTBOT/IOTQQ/OPQ 的Python开发助手,同步易于使用,但也不那么低效🐌
Home Page: https://xiyaowong.github.io/python--iotbot
License: MIT License
IOTBOT/IOTQQ/OPQ 的Python开发助手,同步易于使用,但也不那么低效🐌
Home Page: https://xiyaowong.github.io/python--iotbot
License: MIT License
因为封装得很简单,我自己也没用过。不知道有人用过没,如果没人用就准备删除了。属于冗余的功能
请问如何同时接收多个qq消息,qq储存在了list里面,试了好多方法,都无法获取多个qq的信息,求解
现在bot发送已经稳定了,这也是一般情况下没啥大用的功能了。删除如何。
如果想用本地图片发图,应该怎样写代码呢(本人不怎么会python,烦请大佬解答一下)
因为一开始为了自由度保留和暴露出基本所有的参数可以设置,以防有需求的人对默认值不满意,但后来发现包括我自己都没有用过,所以删除!但是由于保留**kwargs,所以依旧可以显式指定
作者你好,开源的python--iotbot作品很棒,但有一点想说,在群聊的时候,也许我们不必要对每条信息处理,只对触发某些关键词
的信息做处理,可以考虑在配置文件里添一个配置项:机器人的名称,这样在群聊的时候可以通过指定的关键词来召唤机器人,对信息处理。我个人在群聊消息中间件里做了处理,实现了此功能,可能写法有点儿拙略,并未提交Pull,希望作者可以出一个该功能,以下是我改写的
def __group_msg_handler(self, msg):
context: GroupMsg = model_map['OnGroupMsgs'](msg)
logger.info(f'{context.__class__.__name__} -> {context.data}')
bot_name = config.bot_name
# 开启了关键词指令 非机器人发送的消息,进行匹配
if bot_name is not None and context.FromUserId not in self.qq:
msgContent = ""
if context.MsgType == "PicMsg":
msgContentDict = json.loads(context.Content)
msgContent = msgContentDict['Content']
elif context.MsgType == "TextMsg":
msgContent = context.Content
# 仅触发召唤词
if context.MsgType == "TextMsg" and bot_name == msgContent:
context.Content = "召唤机器人"
else:
if not re.match(str(bot_name + " "), msgContent):
# 未匹配到不做处理
return
# 匹配到则去掉机器人名字,只保留指令
res = re.match(str(bot_name + " "), msgContent)
order = msgContent.split(res.group())[1]
if context.MsgType == "PicMsg":
msgContentDict = json.loads(context.Content)
msgContentDict['Content'] = order
context.Content = json.dumps(msgContentDict)
elif context.MsgType == "TextMsg":
context.Content = order
# 黑名单
if context.FromGroupId in self.group_blacklist:
return
# 中间件
if self.__group_context_middleware is not None:
new_context = self.__group_context_middleware(context)
if isinstance(new_context, type(context)):
context = new_context
self.__executor.submit(self.__group_context_distributor, context)
Error:
# python setup.py build
Traceback (most recent call last):
File "setup.py", line 26, in <module>
version=meta['__version__'],
KeyError: '__version__'
Solution:
# setup.py
26 version=meta['__version__'],
# replace '__version__' with 'version'
26 version=meta['version'],
不知道为什么,GroupMsg里面有的MsgTime属性在FriendMsg里面没有,是遗漏了嘛
不知作者有没有考虑一下插件的优先级问题,场景:对于一些指定或含有关键词的信息,我们可以特定处理,对一些平常的消息做另一种处理,在我使用中,我发现好像是在每一个插件里都去处理了这条消息,是否可以采用优先级来处理这个问题呢?按照优先级的顺序加载插件,找到与信息相关的插件后不再引用其他插件,并且这样也能达到对不同信息不同处理的效果
配置文件.iotbot.json > 指定参数值params > 默认参数值 default
改为 params > .iotbot.json > default
在三四次调用bot.refresh_plugins()之后,插件反而刷新到之前的版本了,再继续调用仍然无果,只能重启
涉及图片的就会提示请求成功,但处理失败
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.