mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
refactor: optimize save image rkey
This commit is contained in:
parent
d6b44053de
commit
02c973fe5e
@ -40,6 +40,7 @@ import {OB11GroupTitleEvent} from "./event/notice/OB11GroupTitleEvent";
|
|||||||
import {OB11GroupCardEvent} from "./event/notice/OB11GroupCardEvent";
|
import {OB11GroupCardEvent} from "./event/notice/OB11GroupCardEvent";
|
||||||
import {OB11GroupDecreaseEvent} from "./event/notice/OB11GroupDecreaseEvent";
|
import {OB11GroupDecreaseEvent} from "./event/notice/OB11GroupDecreaseEvent";
|
||||||
|
|
||||||
|
let lastRKeyUpdateTime = 0;
|
||||||
|
|
||||||
export class OB11Constructor {
|
export class OB11Constructor {
|
||||||
static async message(msg: RawMessage): Promise<OB11Message> {
|
static async message(msg: RawMessage): Promise<OB11Message> {
|
||||||
@ -149,8 +150,11 @@ export class OB11Constructor {
|
|||||||
// log("图片url已有rkey", rkey)
|
// log("图片url已有rkey", rkey)
|
||||||
if (rkey != currentRKey){
|
if (rkey != currentRKey){
|
||||||
config.imageRKey = rkey
|
config.imageRKey = rkey
|
||||||
|
if (Date.now() - lastRKeyUpdateTime > 1000 * 60) {
|
||||||
|
lastRKeyUpdateTime = Date.now()
|
||||||
getConfigUtil().setConfig(config)
|
getConfigUtil().setConfig(config)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
message_data["data"]["url"] = IMAGE_HTTP_HOST_NT + url
|
message_data["data"]["url"] = IMAGE_HTTP_HOST_NT + url
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user