Compare commits

..

5 Commits

Author SHA1 Message Date
idranme
c0b682606c Merge pull request #378 from LLOneBot/dev
3.31.1
2024-08-28 16:09:35 +08:00
idranme
8564630c4d Update manifest.json 2024-08-28 16:07:58 +08:00
idranme
abd5a12708 chore: v3.31.1 2024-08-28 16:07:31 +08:00
idranme
234167f305 fix 2024-08-28 16:06:40 +08:00
idranme
da75f59d0d fix 2024-08-28 15:40:08 +08:00
20 changed files with 1648 additions and 1645 deletions

View File

@@ -4,7 +4,7 @@
"name": "LLOneBot", "name": "LLOneBot",
"slug": "LLOneBot", "slug": "LLOneBot",
"description": "实现 OneBot 11 协议,用于 QQ 机器人开发", "description": "实现 OneBot 11 协议,用于 QQ 机器人开发",
"version": "3.31.0", "version": "3.31.1",
"icon": "./icon.webp", "icon": "./icon.webp",
"authors": [ "authors": [
{ {

View File

@@ -1,5 +1,5 @@
import { OB11User } from '../../types'
import BaseAction from '../BaseAction' import BaseAction from '../BaseAction'
import { OB11User } from '../../types'
import { ActionName } from '../types' import { ActionName } from '../types'
import { selfInfo } from '@/common/globalVars' import { selfInfo } from '@/common/globalVars'
@@ -7,9 +7,13 @@ class GetLoginInfo extends BaseAction<null, OB11User> {
actionName = ActionName.GetLoginInfo actionName = ActionName.GetLoginInfo
protected async _handle(payload: null) { protected async _handle(payload: null) {
let nickname = selfInfo.nick
try {
nickname = await this.ctx.ntUserApi.getSelfNick(true)
} catch { }
return { return {
user_id: parseInt(selfInfo.uin), user_id: parseInt(selfInfo.uin),
nickname: await this.ctx.ntUserApi.getSelfNick(true) nickname
} }
} }
} }

View File

@@ -13,7 +13,6 @@ import {
import { OB11GroupRequestEvent } from './event/request/OB11GroupRequest' import { OB11GroupRequestEvent } from './event/request/OB11GroupRequest'
import { OB11FriendRequestEvent } from './event/request/OB11FriendRequest' import { OB11FriendRequestEvent } from './event/request/OB11FriendRequest'
import { MessageUnique } from '../common/utils/messageUnique' import { MessageUnique } from '../common/utils/messageUnique'
import { getConfigUtil } from '../common/config'
import { GroupDecreaseSubType, OB11GroupDecreaseEvent } from './event/notice/OB11GroupDecreaseEvent' import { GroupDecreaseSubType, OB11GroupDecreaseEvent } from './event/notice/OB11GroupDecreaseEvent'
import { selfInfo } from '../common/globalVars' import { selfInfo } from '../common/globalVars'
import { OB11Config, Config as LLOBConfig } from '../common/types' import { OB11Config, Config as LLOBConfig } from '../common/types'
@@ -74,7 +73,7 @@ class OneBot11Adapter extends Service {
/** 缓存近期消息内容 */ /** 缓存近期消息内容 */
public async addMsgCache(msg: RawMessage) { public async addMsgCache(msg: RawMessage) {
const expire = getConfigUtil().getConfig().msgCacheExpire! * 1000 const expire = this.config.msgCacheExpire * 1000
if (expire === 0) { if (expire === 0) {
return return
} }

View File

@@ -285,13 +285,13 @@ class OB11WebSocketReverseManager {
} }
public async start() { public async start() {
for (const url of this.config.hosts) { if (this.list.length > 0) {
this.ctx.logger.info('开始连接反向 WebSocket', url) return
try {
this.list.push(new OB11WebSocketReverse(this.ctx, { ...this.config, url }))
} catch (e: any) {
this.ctx.logger.error(e.stack)
} }
for (const url of this.config.hosts) {
const ws = new OB11WebSocketReverse(this.ctx, { ...this.config, url })
ws.start()
this.list.push(ws)
} }
} }

View File

@@ -1 +1 @@
export const version = '3.31.0' export const version = '3.31.1'