feature: 增加用户名

This commit is contained in:
ningmengchongshui 2024-06-15 22:09:30 +08:00
parent 81beeb0bfa
commit 3aac394e4b
3 changed files with 49 additions and 63 deletions

View File

@ -608,6 +608,7 @@ class PluginsLoader {
if (e?.user_id) { if (e?.user_id) {
e.user_avatar = `https://q1.qlogo.cn/g?b=qq&s=0&nk=${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) { if (e?.group_id) {
e.group_avatar = `https://p.qlogo.cn/gh/${e.group_id}/${e.group_id}/640/` e.group_avatar = `https://p.qlogo.cn/gh/${e.group_id}/${e.group_id}/640/`

View File

@ -2,11 +2,11 @@ import { type GroupMessage } from 'icqq'
// import { Client } from 'icqq' // import { Client } from 'icqq'
// import { PrivateMessage } from 'oicq' // import { PrivateMessage } from 'oicq'
interface EventTypeBase { export interface EventType extends GroupMessage {
/** /**
* *
*/ */
isMaster: boolean; isMaster: boolean
/** /**
* *
*/ */
@ -14,17 +14,60 @@ interface EventTypeBase {
/** /**
* *
*/ */
isGroup: boolean; isGroup: boolean
/**
*
*/
isPrivate?: any
/**
*
*/
isGuild?: any
/**
*
*/
user_name: string
/**
*
*/
user_avatar: string | null
/** /**
* *
*/ */
msg: string; msg: string
/** /**
* *
* @param arg * @param arg
* @returns * @returns
*/ */
reply: (...arg: any[]) => Promise<any>; reply: (...arg: any[]) => Promise<any>
/**
*
*/
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; file: any;
@ -59,88 +102,32 @@ interface EventTypeBase {
* *
*/ */
game?: any game?: any
/** /**
* *
*/ */
detail_type?: any detail_type?: any
/** /**
* *
*/ */
at?: 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; atBot: any;
/**
*
*/
isPrivate?: any
/** /**
* *
*/ */
hasAlias?: any hasAlias?: any
/** /**
* *
*/ */
replyNew?: any replyNew?: any
/**
*
*/
isGuild?: any
/** /**
* *
*/ */
friend?: any friend?: any
} }
export interface EventType extends EventTypeBase, GroupMessage { }
/** /**
* *
*/ */

View File

@ -1,8 +1,6 @@
import BaseModel from './BaseModel.js' import BaseModel from './BaseModel.js'
import lodash from 'lodash' import lodash from 'lodash'
import { UserGameDB } from './index.js'
import MysUtil from '../mys/MysUtil.js' import MysUtil from '../mys/MysUtil.js'
import MysUserDB from './MysUserDB.js'
const { Types } = BaseModel const { Types } = BaseModel