【有手就行】5分钟教你把ChatGPT接入QQ,搭建你的专属聊天机器人 * { margin: 0; padding: 0; outline: 0; } body { font-family: “PingFang SC”, system-ui, -apple-system, BlinkMacSystemFont, “Helvetica Neue”, “Hiragino Sans GB”, “Microsoft YaHei UI”, “Microsoft YaHei”, Arial, sans-serif; line-height: 1.6; } .__page_content__ { max-width: 667px; margin: 0 auto; padding: 20px; text-size-adjust: 100%; color: rgba(0, 0, 0, 0.9); padding-bottom: 64px; } .title { user-select: text; font-size: 22px; line-height: 1.4; margin-bottom: 14px; font-weight: 500; } .__meta__ { color: rgba(0, 0, 0, 0.3); font-size: 15px; line-height: 20px; hyphens: auto; word-break: break-word; margin-bottom: 50px; } .__meta__ .nick_name { color: 576B95; } .__meta__ .copyright { color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.05); padding: 0 4px; margin: 0 10px 10px 0; } blockquote.source { padding: 10px; margin: 30px 0; border-left: 5px solid ccc; color: #333; font-style: italic; word-wrap: break-word; } blockquote.source a { cursor: pointer; text-decoration: underline; } .item_show_type_0 > section { margin-top: 0; margin-bottom: 24px; } a { color: 576B95; text-decoration: none; cursor: default; } .text_content { margin-bottom: 50px; user-select: text; font-size: 17px; white-space: pre-wrap; word-wrap: break-word; line-height: 28px; hyphens: auto; } .picture_content .picture_item { margin-bottom: 30px; } .picture_content .picture_item .picture_item_label { text-align: center; } img { max-width: 100%; } .pay_subscribe_notice { margin: 30px 0; padding: 20px; background: fffbe6; border: 1px solid ffe58f; border-radius: 8px; } .pay_subscribe_badge { display: inline-block; padding: 4px 12px; background: faad14; color: fff; border-radius: 4px; font-size: 14px; font-weight: 500; margin-bottom: 12px; } .pay_subscribe_desc { font-size: 15px; line-height: 1.8; color: rgba(0, 0, 0, 0.7); margin-bottom: 12px; } .pay_subscribe_hint { font-size: 13px; color: rgba(0, 0, 0, 0.4); } .__bottom-bar__ { display: flex; justify-content: space-between; align-items: center; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; padding: 8px 20px; background: white; box-sizing: border-box; border-top: 1px solid rgba(0, 0, 0, 0.2); } .__bottom-bar__ .left { display: flex; align-items: center; font-size: 15px; white-space: nowrap; } .__bottom-bar__ .right { display: flex; } .__bottom-bar__ .sns_opr_btn { display: flex; align-items: center; user-select: none; background: transparent; border: 0; color: rgba(0, 0, 0, 0.9); font-size: 14px; } .__bottom-bar__ .sns_opr_btn:not(:last-child) { margin-right: 16px; } .__bottom-bar__ .sns_opr_btn > img { margin-right: 4px; }
【有手就行】5分钟教你把ChatGPT接入QQ,搭建你的专属聊天机器人
原创 数字生命卡兹克 数字生命卡兹克 2023-05-31 23:08 天津
最近OpenAI对魔法封的严重,而且ChatGPT用起来最近挺慢,没事还卡一卡,麻烦。
所以为了自己的顺畅体验,干脆直接把ChatGPT接进QQ里面去了。
用起来就轻松加愉快,私聊群聊都行~
大概就是这种效果:
接下来,就教大家徒手接一个,真的,有手就行,5分钟解决战斗。
我使用的项目是ChatGPT for Bot,Github源址在此:
https://github.com/lss233/chatgpt-mirai-qq-bot
你需要准备的东西:
-
魔法(这个不解释了)
-
1个QQ号(别作死用自己的大号)
-
OpenAI的API key
OK,我们正式开始。
首先,你需要先下载这个项目的一个整合包。毕竟没程序跑个屁哈哈~
我也给大家准备好了,关注并私信我Q,就直接自动回复你下载链接了。
下载完解压到本地,我就直接解压到D盘的新建文件夹里了。可以看到包里有这么些东西。
我么直接双击运行初始化~
敲一下回车,就会让你输入你想配置的机器人的QQ号了,再强调一下,别用自己的大号,虽然封号概率很低,但是万一封了就得不偿失了~
输入完QQ号后,再敲一下回车,就会开始跑脚本,嘟嘟嘟的几秒十几秒就完事了,此时会自动给你弹出一个长这样的文本文件。这就是我们需要修改一下的配置文件,也是最麻烦的一步,后面就一马平川了~
因为这次只接ChatGPT,所以模版我已经写好了。大家把我的代码复制进去,然后把我标注的地方给改成自己的就行~
# 这里是 ChatGPT for QQ 的所有配置文件
# 请注意:以 ”#” 开头的文本均为注释
# 不会被程序读取
# 如果你想要使用某个设置,请确保前面没有 ”#” 号
# 配置文件编写教程:
# https://chatgpt-qq.lss233.com/
[onebot]
qq=请填写机器人的 QQ 号
manager_qq = 请修改为机器人管理员的QQ号
# ==== OpenAI 部分开始
[openai]
# OpenAI 相关设置
# 自定义 OpenAI 的 API 接口基础地址
api_endpoint = “https://chatgpt-proxy.lss233.com/v1/”
# 以下是 GPT3(.5) 和 GPT4 的模型参数
# 在使用 API 调用时有效
[openai.gpt3_params]
temperature = 1.0
max_tokens = 4000
top_p = 1.0
presence_penalty = 0.5
frequency_penalty = 0.5
min_tokens = 1000
# 你的 API key,可以在这里看:https://platform.openai.com/account/api-keys
api_key=“sk-xxxxx”
# 如果你在国内,需要配置代理(端口写成自己的)
proxy=“http://127.0.0.1:7890”
支持的变量:{session_id} - 此对话对应的上下文 ID,若产生在好友中,则为好友 QQ 号,若产生在群聊中,则为群号
title_pattern=“qq-{session_id}”
这几个地方需要更改。QQ就不说了。
OpenAI的API Key如果忘了的话,去这个网址:
https://platform.openai.com/account/api-keys
登录后,新建一个Key,以前的key你也没法复制,就新建一个存下来。
而端口那块,打开你的魔法,我的这个7890就是,每个人的可能都不一样,默认的一般就是7890。
全部设置好以后,我们把配置文件和刚才的窗口都关了。最难的一步完事了!
我们找到根目录中的启动ChatGPT。双击运行。
看到这些消息后,说明ChatGPT启动成功。
这个窗口千万别关。我们回到文件夹里,再找到启动go-cqhttp,双击运行。
弹出一个窗口,等个几秒以后,就会出现一个巨大的二维码,此时,打开你的手机QQ,登上你的小号,直接扫码登录。
**提示登录的是手表QQ,没毛病,因为用的就是手表QQ的协议,**直接手机确认登录。看到这些提示后,就说明登录成功,
所有程序全部完成。QQ接入ChatGPT成功,我们去对话一下试试~
一切都没毛病,愉快的玩耍起来吧~
关注并私信我Q,就直接自动回复你整合包啦。
另,明天儿童节啦,祝大家六一快乐~
以上,创作不易,有用的话请点个在看并给我设个星标⭐,感恩。
数字生命卡兹克
 阅读 赞  分享 ‘%3E %3Cg transform=‘translate(0 -2.349)‘%3E %3Cpath d=‘M0 2.349h24v24H0z’/%3E %3Cpath fill=‘%23576B95’ d=‘M16.45 7.68c-.954 0-1.94.362-2.77 1.113l-1.676 1.676-1.853-1.838a3.787 3.787 0 0 0-2.63-.971 3.785 3.785 0 0 0-2.596 1.112 3.786 3.786 0 0 0-1.113 2.687c0 .97.368 1.938 1.105 2.679l7.082 6.527 7.226-6.678a3.787 3.787 0 0 0 .962-2.618 3.785 3.785 0 0 0-1.112-2.597A3.687 3.687 0 0 0 16.45 7.68zm3.473.243a4.985 4.985 0 0 1 1.464 3.418 4.98 4.98 0 0 1-1.29 3.47l-.017.02-7.47 6.903a.9.9 0 0 1-1.22 0l-7.305-6.73-.008-.01a4.986 4.986 0 0 1-1.465-3.535c0-1.279.488-2.56 1.465-3.536A4.985 4.985 0 0 1 7.494 6.46c1.24-.029 2.49.4 3.472 1.29l.01.01L12 8.774l.851-.85.01-.01c1.046-.951 2.322-1.434 3.59-1.434 1.273 0 2.52.49 3.472 1.442z’/%3E %3C/g%3E %3C/g%3E %3C/g%3E%3C/svg%3E) 推荐 ’ fill=‘%23000’ fill-opacity=’.9’/%3E%3C/svg%3E) 留言