Skip to content

Commit

Permalink
Merge pull request #13 from Valorant-Shop-CN/develop
Browse files Browse the repository at this point in the history
chown(v1.2.0): release v1.2.0
  • Loading branch information
musnows authored May 12, 2023
2 parents 4fd27b6 + 2e739c6 commit 98d0366
Show file tree
Hide file tree
Showing 34 changed files with 2,478 additions and 724 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ __pycache__/
# idea
.idea/
.vscode/
*vnev/
*venv/

# webfile
!code/web/ahri/index.html
Expand Down
22 changes: 21 additions & 1 deletion code/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import traceback
from aiohttp import web
from pkg.utils.Gtime import getTime
from pkg.utils.Gtime import get_time
from pkg.utils.api import ApiHandler
from pkg.utils.log.Logging import _log

Expand Down Expand Up @@ -217,6 +217,26 @@ async def aifadian_webhook(request):
content_type='application/json')


# 机器人加入的服务器/命令总数等等信息
from pkg.utils.log.BotLog import log_bot_list
@routes.get('/bot-log')
async def bot_log_get(request):
_log.info(f"request | /bot-log")
try:
ret_dict = await log_bot_list()
ret = {
"guild_total":ret_dict["guild"]["guild_total"],
"guild_active":ret_dict["guild"]["guild_active"],
"user_total":ret_dict["user"]["user_total"],
"cmd_total":ret_dict["cmd_total"]
}
return web.Response(body=json.dumps(ret, indent=2, sort_keys=True, ensure_ascii=False),
content_type='application/json')
except:
_log.exception("Exception in /afd")
return web.Response(status=503)


app = web.Application()
app.add_routes(routes)
if __name__ == '__main__':
Expand Down
35 changes: 21 additions & 14 deletions code/config/config.exp.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{
"token":{
"bot": "机器人websocket token",
"token": {
"bot": {
"token": "bot webhook/websocket token",
"verify_token": "webhook verify token",
"encrypt": "webhook encrypt token",
"webhook_port": 50000,
"ws": true,
"info":"如果要使用webhook,将ws字段修改为false"
},
"api_bot_token": "api用来上传图片的机器人websocket token",
"img_upload_token": "用来进行vip商店图片测试的机器人websocket token(发图片让kook的内容识别来判断有么有问题)"
},
"master_id": "机器人开发者userid",
"caiyun": "彩云小译的token,可为空,但不能删除本键值",
"channel":{
"channel": {
"debug_ch": "发送错误日志的频道",
"img_upload_ch": "用来测试vip商店图片的频道"
},
"lsky":{
"url":"lsky图床的url(该功能未启用)",
"token":"lsky图床的token(该功能未启用)"
"lsky": {
"url": "lsky图床的url(该功能未启用,可留空",
"token": "lsky图床的token(该功能未启用,可留空"
},
"leancloud":{
"appid":"leancloud数据库的appid(可联系作者,共用皮肤评价数据库)",
"appkey":"leancloud数据库的appkey",
"master_key":"leancloud数据库的masterkey(可为空,目前没有使用)",
"user_name":"数据库内置用户id",
"user_pwd":"数据库内置用户密码"
"leancloud": {
"appid": "leancloud数据库的appid(可联系作者,共用皮肤评价数据库)",
"appkey": "leancloud数据库的appkey",
"master_key": "leancloud数据库的masterkey(可为空,目前没有使用)",
"user_name": "数据库内置用户id",
"user_pwd": "数据库内置用户密码"
},
"no":1000,
"platform":"kook"
"no": 1000,
"platform": "kook"
}
Loading

0 comments on commit 98d0366

Please sign in to comment.