求助,这个公益群的微信机器人是怎么做的?

他这个机器人可以关键词签到发key
这个公益站来自论坛一个大佬

https://linux.do/t/topic/97658
我自己搭建了,chatgpt-on-wechat,并没有找到类似功能

1 个赞

hook的

帮顶

可以试一下这个
aff:https://gptgod.online/#/register?invite_code=87qtql9p8m7z04knuuq2k7ubg
注册后打开https://gptgod.online/#/robot
在提示词里面写入

有个channel,里面会监听消息,然后根据消息判断直接包装好数据类型返回就行。或者插件里添加相关逻辑

有一个框架,然后写一个关键词检测不就行了

hello.py,on_handle_context(self, e_context: EventContext)函数处理也方便

        if "音乐" in content:
            reply = Reply()
            reply.type = ReplyType.TEXT
            msg: ChatMessage = e_context["context"]["msg"]
            user_name = msg.actual_user_nickname
            match = re.search(r'音乐:(.*)', content, re.DOTALL)
            if match:
                content = match.group(1)
                try:
                    response_content = self.send_request(content)
                    print(response_content)
                    reply.content = f"@{user_name}\n{response_content}"
                    e_context["reply"] = reply
                    e_context.action = EventAction.BREAK_PASS  # 事件结束,并跳过处理context的默认逻辑
                except Exception as e:
                    print(str(e))
                    reply.content = f"错误: {str(e)}"
                    e_context["reply"] = reply
                    e_context.action = EventAction.BREAK_PASS  # 事件结束,并跳过处理context的默认逻辑

就是这样啊

功能肯定是站主加的嘛,微信机器人项目本身没有这种需求和功能

wechat hook可以实现

这个key是啥

KEY是他网站的兑换码

1 个赞

可惜了,我没学过python看不懂,等我再学习学习吧,我只想弄一个签到功能