mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
@@ -4,7 +4,7 @@
|
||||
"name": "LLOneBot",
|
||||
"slug": "LLOneBot",
|
||||
"description": "实现 OneBot 11 协议,用于 QQ 机器人开发",
|
||||
"version": "3.31.0",
|
||||
"version": "3.31.1",
|
||||
"icon": "./icon.webp",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -16,9 +16,9 @@ export enum ProfileBizType {
|
||||
}
|
||||
|
||||
export interface NodeIKernelProfileService {
|
||||
getUidByUin(callfrom: string, uin: Array<string>): Promise<Map<string,string>>//uin->uid
|
||||
getUidByUin(callfrom: string, uin: Array<string>): Promise<Map<string, string>>//uin->uid
|
||||
|
||||
getUinByUid(callfrom: string, uid: Array<string>): Promise<Map<string,string>>
|
||||
getUinByUid(callfrom: string, uid: Array<string>): Promise<Map<string, string>>
|
||||
|
||||
// {
|
||||
// coreInfo: CoreInfo,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { OB11User } from '../../types'
|
||||
import BaseAction from '../BaseAction'
|
||||
import { OB11User } from '../../types'
|
||||
import { ActionName } from '../types'
|
||||
import { selfInfo } from '@/common/globalVars'
|
||||
|
||||
@@ -7,9 +7,13 @@ class GetLoginInfo extends BaseAction<null, OB11User> {
|
||||
actionName = ActionName.GetLoginInfo
|
||||
|
||||
protected async _handle(payload: null) {
|
||||
let nickname = selfInfo.nick
|
||||
try {
|
||||
nickname = await this.ctx.ntUserApi.getSelfNick(true)
|
||||
} catch { }
|
||||
return {
|
||||
user_id: parseInt(selfInfo.uin),
|
||||
nickname: await this.ctx.ntUserApi.getSelfNick(true)
|
||||
nickname
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,6 @@ import {
|
||||
import { OB11GroupRequestEvent } from './event/request/OB11GroupRequest'
|
||||
import { OB11FriendRequestEvent } from './event/request/OB11FriendRequest'
|
||||
import { MessageUnique } from '../common/utils/messageUnique'
|
||||
import { getConfigUtil } from '../common/config'
|
||||
import { GroupDecreaseSubType, OB11GroupDecreaseEvent } from './event/notice/OB11GroupDecreaseEvent'
|
||||
import { selfInfo } from '../common/globalVars'
|
||||
import { OB11Config, Config as LLOBConfig } from '../common/types'
|
||||
@@ -74,7 +73,7 @@ class OneBot11Adapter extends Service {
|
||||
|
||||
/** 缓存近期消息内容 */
|
||||
public async addMsgCache(msg: RawMessage) {
|
||||
const expire = getConfigUtil().getConfig().msgCacheExpire! * 1000
|
||||
const expire = this.config.msgCacheExpire * 1000
|
||||
if (expire === 0) {
|
||||
return
|
||||
}
|
||||
|
@@ -285,13 +285,13 @@ class OB11WebSocketReverseManager {
|
||||
}
|
||||
|
||||
public async start() {
|
||||
for (const url of this.config.hosts) {
|
||||
this.ctx.logger.info('开始连接反向 WebSocket', url)
|
||||
try {
|
||||
this.list.push(new OB11WebSocketReverse(this.ctx, { ...this.config, url }))
|
||||
} catch (e: any) {
|
||||
this.ctx.logger.error(e.stack)
|
||||
if (this.list.length > 0) {
|
||||
return
|
||||
}
|
||||
for (const url of this.config.hosts) {
|
||||
const ws = new OB11WebSocketReverse(this.ctx, { ...this.config, url })
|
||||
ws.start()
|
||||
this.list.push(ws)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
export const version = '3.31.0'
|
||||
export const version = '3.31.1'
|
||||
|
Reference in New Issue
Block a user