mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
chore: Hello LangBot !
This commit is contained in:
4
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -23,8 +23,8 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: QChatGPT版本
|
label: LangBot 版本
|
||||||
description: QChatGPT版本号
|
description: LangBot (QChatGPT) 版本号
|
||||||
placeholder: 例如:v3.3.0,可以使用`!version`命令查看,或者到 pkg/utils/constants.py 查看
|
placeholder: 例如:v3.3.0,可以使用`!version`命令查看,或者到 pkg/utils/constants.py 查看
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
*请在方括号间写`x`以打勾
|
*请在方括号间写`x`以打勾
|
||||||
|
|
||||||
- [ ] 阅读仓库[贡献指引](https://github.com/RockChinQ/QChatGPT/blob/master/CONTRIBUTING.md)了吗?
|
- [ ] 阅读仓库[贡献指引](https://github.com/RockChinQ/LangBot/blob/master/CONTRIBUTING.md)了吗?
|
||||||
- [ ] 与项目所有者沟通过了吗?
|
- [ ] 与项目所有者沟通过了吗?
|
||||||
- [ ] 我确定已自行测试所作的更改,确保功能符合预期。
|
- [ ] 我确定已自行测试所作的更改,确保功能符合预期。
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/build-docker-image.yml
vendored
4
.github/workflows/build-docker-image.yml
vendored
@@ -38,5 +38,5 @@ jobs:
|
|||||||
run: docker login --username=${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
|
run: docker login --username=${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Create Buildx
|
- name: Create Buildx
|
||||||
run: docker buildx create --name mybuilder --use
|
run: docker buildx create --name mybuilder --use
|
||||||
- name: Build # image name: rockchin/qchatgpt:<VERSION>
|
- name: Build # image name: rockchin/langbot:<VERSION>
|
||||||
run: docker buildx build --platform linux/arm64,linux/amd64 -t rockchin/qchatgpt:${{ steps.check_version.outputs.version }} -t rockchin/qchatgpt:latest . --push
|
run: docker buildx build --platform linux/arm64,linux/amd64 -t rockchin/langbot:${{ steps.check_version.outputs.version }} -t rockchin/langbot:latest . --push
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
database.db
|
database.db
|
||||||
qchatgpt.log
|
qchatgpt.log
|
||||||
|
langbot.log
|
||||||
/banlist.py
|
/banlist.py
|
||||||
/plugins/
|
/plugins/
|
||||||
!/plugins/__init__.py
|
!/plugins/__init__.py
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
</p>
|
</p>
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
# QChatGPT
|
# LangBot
|
||||||
|
|
||||||
<a href="https://trendshift.io/repositories/6187" target="_blank"><img src="https://trendshift.io/api/badge/repositories/6187" alt="RockChinQ%2FQChatGPT | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
<a href="https://trendshift.io/repositories/6187" target="_blank"><img src="https://trendshift.io/api/badge/repositories/6187" alt="RockChinQ%2FQChatGPT | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||||
|
|
||||||
[](https://github.com/RockChinQ/QChatGPT/releases/latest)
|
[](https://github.com/RockChinQ/LangBot/releases/latest)
|
||||||
<a href="https://hub.docker.com/repository/docker/rockchin/qchatgpt">
|
<a href="https://hub.docker.com/repository/docker/rockchin/langbot">
|
||||||
<img src="https://img.shields.io/docker/pulls/rockchin/qchatgpt?color=blue" alt="docker pull">
|
<img src="https://img.shields.io/docker/pulls/rockchin/langbot?color=blue" alt="docker pull">
|
||||||
</a>
|
</a>
|
||||||

|

|
||||||

|

|
||||||
|
|||||||
10
main.py
10
main.py
@@ -1,6 +1,6 @@
|
|||||||
# QChatGPT 终端启动入口
|
# LangBot 终端启动入口
|
||||||
# 在此层级解决依赖项检查。
|
# 在此层级解决依赖项检查。
|
||||||
# QChatGPT/main.py
|
# LangBot/main.py
|
||||||
|
|
||||||
asciiart = r"""
|
asciiart = r"""
|
||||||
_ ___ _
|
_ ___ _
|
||||||
@@ -63,7 +63,7 @@ if __name__ == '__main__':
|
|||||||
input("按任意键退出...")
|
input("按任意键退出...")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# 检查本目录是否有main.py,且包含QChatGPT字符串
|
# 检查本目录是否有main.py,且包含LangBot字符串
|
||||||
invalid_pwd = False
|
invalid_pwd = False
|
||||||
|
|
||||||
if not os.path.exists('main.py'):
|
if not os.path.exists('main.py'):
|
||||||
@@ -71,10 +71,10 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
with open('main.py', 'r', encoding='utf-8') as f:
|
with open('main.py', 'r', encoding='utf-8') as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
if "QChatGPT/main.py" not in content:
|
if "LangBot/main.py" not in content:
|
||||||
invalid_pwd = True
|
invalid_pwd = True
|
||||||
if invalid_pwd:
|
if invalid_pwd:
|
||||||
print("请在QChatGPT项目根目录下以命令形式运行此程序。")
|
print("请在 LangBot 项目根目录下以命令形式运行此程序。")
|
||||||
input("按任意键退出...")
|
input("按任意键退出...")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ class Image(MessageComponent):
|
|||||||
|
|
||||||
@pydantic.validator('path')
|
@pydantic.validator('path')
|
||||||
def validate_path(cls, path: typing.Union[str, Path, None]):
|
def validate_path(cls, path: typing.Union[str, Path, None]):
|
||||||
"""修复 path 参数的行为,使之相对于 QChatGPT 的启动路径。"""
|
"""修复 path 参数的行为,使之相对于 LangBot 的启动路径。"""
|
||||||
if path:
|
if path:
|
||||||
try:
|
try:
|
||||||
return str(Path(path).resolve(strict=True))
|
return str(Path(path).resolve(strict=True))
|
||||||
@@ -673,7 +673,7 @@ class Voice(MessageComponent):
|
|||||||
"""语音的长度,单位为秒。"""
|
"""语音的长度,单位为秒。"""
|
||||||
@pydantic.validator('path')
|
@pydantic.validator('path')
|
||||||
def validate_path(cls, path: typing.Optional[str]):
|
def validate_path(cls, path: typing.Optional[str]):
|
||||||
"""修复 path 参数的行为,使之相对于 QChatGPT 的启动路径。"""
|
"""修复 path 参数的行为,使之相对于 LangBot 的启动路径。"""
|
||||||
if path:
|
if path:
|
||||||
try:
|
try:
|
||||||
return str(Path(path).resolve(strict=True))
|
return str(Path(path).resolve(strict=True))
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class BasePlugin(metaclass=abc.ABCMeta):
|
|||||||
|
|
||||||
|
|
||||||
class APIHost:
|
class APIHost:
|
||||||
"""QChatGPT API 宿主"""
|
"""LangBot API 宿主"""
|
||||||
|
|
||||||
ap: app.Application
|
ap: app.Application
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ class APIHost:
|
|||||||
|
|
||||||
if self.ap.ver_mgr.compare_version_str(qchatgpt_version, ge) < 0 or \
|
if self.ap.ver_mgr.compare_version_str(qchatgpt_version, ge) < 0 or \
|
||||||
(self.ap.ver_mgr.compare_version_str(qchatgpt_version, le) > 0):
|
(self.ap.ver_mgr.compare_version_str(qchatgpt_version, le) > 0):
|
||||||
raise Exception("QChatGPT 版本不满足要求,某些功能(可能是由插件提供的)无法正常使用。(要求版本:{}-{},但当前版本:{})".format(ge, le, qchatgpt_version))
|
raise Exception("LangBot 版本不满足要求,某些功能(可能是由插件提供的)无法正常使用。(要求版本:{}-{},但当前版本:{})".format(ge, le, qchatgpt_version))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class AnnouncementManager:
|
|||||||
) -> list[Announcement]:
|
) -> list[Announcement]:
|
||||||
"""获取所有公告"""
|
"""获取所有公告"""
|
||||||
resp = requests.get(
|
resp = requests.get(
|
||||||
url="https://api.github.com/repos/RockChinQ/QChatGPT/contents/res/announcement.json",
|
url="https://api.github.com/repos/RockChinQ/LangBot/contents/res/announcement.json",
|
||||||
proxies=self.ap.proxy_mgr.get_forward_proxies(),
|
proxies=self.ap.proxy_mgr.get_forward_proxies(),
|
||||||
timeout=5
|
timeout=5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class VersionManager:
|
|||||||
async def get_release_list(self) -> list:
|
async def get_release_list(self) -> list:
|
||||||
"""获取发行列表"""
|
"""获取发行列表"""
|
||||||
rls_list_resp = requests.get(
|
rls_list_resp = requests.get(
|
||||||
url="https://api.github.com/repos/RockChinQ/QChatGPT/releases",
|
url="https://api.github.com/repos/RockChinQ/LangBot/releases",
|
||||||
proxies=self.ap.proxy_mgr.get_forward_proxies(),
|
proxies=self.ap.proxy_mgr.get_forward_proxies(),
|
||||||
timeout=5
|
timeout=5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1 @@
|
|||||||
[
|
[]
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"time": "2024-03-08 22:30:00",
|
|
||||||
"timestamp": 1709908200,
|
|
||||||
"content": "QChatGPT 3.x 已发布,若您仍在使用不再维护的 2.x 版本,请尽快迁移至 3.x 版本:https://github.com/RockChinQ/QChatGPT/discussions/690"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
"host": {
|
"host": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "0.0.0.0",
|
"default": "0.0.0.0",
|
||||||
"description": "监听的 IP 地址,一般就保持 0.0.0.0 就可以了。使用 aiocqhttp 时,QChatGPT 作为服务端被动等待框架连接,请在 Lagrange 等框架中设置被动 ws 地址或者反向 ws 地址(具体视框架而定)为 QChatGPT 监听的地址,且路径为/ws,例如:ws://127.0.0.1:8080/ws"
|
"description": "监听的 IP 地址,一般就保持 0.0.0.0 就可以了。使用 aiocqhttp 时,LangBot 作为服务端被动等待框架连接,请在 Lagrange 等框架中设置被动 ws 地址或者反向 ws 地址(具体视框架而定)为 LangBot 监听的地址,且路径为/ws,例如:ws://127.0.0.1:8080/ws"
|
||||||
},
|
},
|
||||||
"port": {
|
"port": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"pipeline-concurrency": 20,
|
"pipeline-concurrency": 20,
|
||||||
"qcg-center-url": "https://api.qchatgpt.rockchin.top/api/v2",
|
"qcg-center-url": "https://api.qchatgpt.rockchin.top/api/v2",
|
||||||
"help-message": "QChatGPT - 😎高稳定性、🧩支持插件、🌏实时联网的 ChatGPT QQ 机器人🤖\n链接:https://q.rkcn.top",
|
"help-message": "LangBot - 😎高稳定性、🧩支持插件、🌏实时联网的 ChatGPT QQ 机器人🤖\n链接:https://q.rkcn.top",
|
||||||
"http-api": {
|
"http-api": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"host": "0.0.0.0",
|
"host": "0.0.0.0",
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const close = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openSource = () => {
|
const openSource = () => {
|
||||||
window.open('https://github.com/RockChinQ/QChatGPT', '_blank')
|
window.open('https://github.com/RockChinQ/LangBot', '_blank')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user