diff --git a/src/core/plugins.loader.ts b/src/core/plugins.loader.ts index eb07b9d..95d6e33 100644 --- a/src/core/plugins.loader.ts +++ b/src/core/plugins.loader.ts @@ -608,6 +608,7 @@ class PluginsLoader { if (e?.user_id) { e.user_avatar = `https://q1.qlogo.cn/g?b=qq&s=0&nk=${e.user_id}` + e.user_name = e.sender.nickname } if (e?.group_id) { e.group_avatar = `https://p.qlogo.cn/gh/${e.group_id}/${e.group_id}/640/` diff --git a/src/core/plugins/types.ts b/src/core/plugins/types.ts index d12b8ef..e878722 100644 --- a/src/core/plugins/types.ts +++ b/src/core/plugins/types.ts @@ -2,11 +2,11 @@ import { type GroupMessage } from 'icqq' // import { Client } from 'icqq' // import { PrivateMessage } from 'oicq' -interface EventTypeBase { +export interface EventType extends GroupMessage { /** * 是否是主人 */ - isMaster: boolean; + isMaster: boolean /** * 是否是管理员 */ @@ -14,19 +14,62 @@ interface EventTypeBase { /** * 是否是群里 */ - isGroup: boolean; + isGroup: boolean + /** + * 是私聊 + */ + isPrivate?: any + /** + * 是频道 + */ + isGuild?: any + /** + * 用户名 + */ + user_name: string + /** + * 用户头像 + */ + user_avatar: string | null /** * 用户消息 */ - msg: string; + msg: string /** * 消息发送 * @param arg * @returns */ - reply: (...arg: any[]) => Promise; + reply: (...arg: any[]) => Promise /** + * 群号 */ + group_id: number; + /** + * 群名 + */ + group_name: string; + /** + * 群头像 + */ + group_avatar: string | null + /** + * + */ + group: { + is_owner: any; + recallMsg: (...arg: any[]) => any; + getMemberMap: any; + quit: any; + mute_left: any + + pickMember: any + + + sendMsg: any + }; + /** + */ file: any; /** */ @@ -59,88 +102,32 @@ interface EventTypeBase { * */ game?: any - - /** * */ detail_type?: any - /** * */ at?: any - - /** - * 群号 - */ - group_id: number; - /** - * 群名 - */ - group_name: string; - - /** - * 用户头像 - */ - user_avatar: string | null - - /** - * 群头像 - */ - group_avatar: string | null - - /** - * - */ - group: { - is_owner: any; - recallMsg: (...arg: any[]) => any; - getMemberMap: any; - quit: any; - mute_left: any - - pickMember: any - - - sendMsg: any - }; /** * */ atBot: any; - - /** - * - */ - - isPrivate?: any - /** * */ hasAlias?: any - /** * */ - replyNew?: any - - /** - * - */ - - isGuild?: any - /** * */ friend?: any } -export interface EventType extends EventTypeBase, GroupMessage { } - /** * 函数式回调类型 */ diff --git a/src/db/UserDB.ts b/src/db/UserDB.ts index d37e3e4..7b20321 100644 --- a/src/db/UserDB.ts +++ b/src/db/UserDB.ts @@ -1,8 +1,6 @@ import BaseModel from './BaseModel.js' import lodash from 'lodash' -import { UserGameDB } from './index.js' import MysUtil from '../mys/MysUtil.js' -import MysUserDB from './MysUserDB.js' const { Types } = BaseModel