mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c0b682606c | ||
![]() |
8564630c4d | ||
![]() |
abd5a12708 | ||
![]() |
234167f305 | ||
![]() |
da75f59d0d |
@@ -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": [
|
||||||
{
|
{
|
||||||
|
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
}
|
}
|
||||||
|
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const version = '3.31.0'
|
export const version = '3.31.1'
|
||||||
|
Reference in New Issue
Block a user