把仓库数据整合成 JSON 供 bot 使用 #19
nullqwertyuiop
started this conversation in
Ideas
Replies: 3 comments 6 replies
-
不过感觉还是考虑有所欠缺,比如多 bot 共用同账号的情况,譬如
BotType 结构如下
修改后的 JSON 示例 [
{
"id": 114514,
"name": "田所浩二",
"num": 1,
"description": "一个香气扑鼻的机器人",
"site": "https://example.com",
"maintainer": [
{
"pony": 10001
}
],
"type": [
{
"name": "哼哼哼",
"repo": "HengHengHeng/HengHengHeng",
"description": "哼!哼!哼!"
},
{
"name": "啊啊啊啊啊",
"repo": "HengHengHeng/AAAAA",
"description": "啊啊啊啊啊!"
}
]
},
{
"id": 1919810,
"name": "田所浩二",
"num": 2,
"description": "一个香气扑鼻的机器人",
"site": "https://example.com",
"maintainer": [
{
"pony": 10001
}
],
"type": [
{
"name": "哼哼哼",
"repo": "HengHengHeng/HengHengHeng",
"description": "哼!哼!哼!"
},
{
"name": "啊啊啊啊啊",
"repo": "HengHengHeng/AAAAA",
"description": "啊啊啊啊啊!"
}
]
}
] 应该就可以涵盖大部分情况了 |
Beta Was this translation helpful? Give feedback.
0 replies
-
我倒是认为在目前没有提供主动 API 的情况下,我们可以把 botProgram.json [
{
"id": 1,
"name": "哼哼哼",
"repo": "HengHengHeng/HengHengHeng",
"description": "哼!哼!哼!"
},
{
"id": 2,
"name": "啊啊啊啊啊",
"repo": "HengHengHeng/AAAAA",
"description": "啊啊啊啊啊!"
}
] bot.json [
{
"id": 114514,
"name": "田所浩二",
"num": 1,
"description": "一个香气扑鼻的机器人",
"site": "https://example.com",
"maintainer": [
{
"pony": 10001
}
],
"program": [
"HengHengHeng/AAAAA",
"HengHengHeng/HengHengHeng"
]
},
{
"id": 1919810,
"name": "田所浩二",
"num": 2,
"description": "一个香气扑鼻的机器人",
"site": "https://example.com",
"maintainer": [
{
"pony": 10001
}
],
"program": [
"HengHengHeng/AAAAA"
]
}
] 当然我认为 |
Beta Was this translation helpful? Give feedback.
3 replies
-
凑个热闹。 // botProgram.json
;({
'qq.qq.bot1': {
name: '哼哼哼',
url: 'https://github.com/HengHengHeng/HengHengHeng',
desc: '哼!哼!哼!',
author: '114514'
},
'qq.qq.bot2': {
name: '啊啊啊啊啊',
url: 'https://github.com/HengHengHeng/AAAAA',
desc: '啊啊啊啊啊!',
author: '1919810'
}
})
// bot.json
;({
'114514': {
name: '田所浩二',
desc: '一个香气扑鼻的机器人',
url: 'https://example.com',
author: '乐',
use: ['qq.qq.bot1', 'qq.qq.bot2']
},
'1919810': {
name: '田所浩二',
desc: '一个香气扑鼻的机器人',
url: 'https://example.com',
author: '乐2',
use: ['qq.qq.bot2']
}
}) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
感觉可以整一个方便 bot 读取的 JSON出来,充分利用仓库数据的话这样的结构应该可以?
JSON 大概这样
Beta Was this translation helpful? Give feedback.
All reactions