feature: 群头像&用户头像

This commit is contained in:
ningmengchongshui 2024-06-15 21:58:58 +08:00
parent e76a1ac73d
commit 81beeb0bfa
2 changed files with 21 additions and 3 deletions

View File

@ -295,7 +295,7 @@ class PluginsLoader {
if (!this.checkLimit(e)) return if (!this.checkLimit(e)) return
/** /**
* * e
*/ */
this.dealMsg(e) this.dealMsg(e)
@ -606,6 +606,13 @@ class PluginsLoader {
e.logText = `[私聊][${e.sender.nickname}(${e.user_id})]` e.logText = `[私聊][${e.sender.nickname}(${e.user_id})]`
} }
if (e?.user_id) {
e.user_avatar = `https://q1.qlogo.cn/g?b=qq&s=0&nk=${e.user_id}`
}
if (e?.group_id) {
e.group_avatar = `https://p.qlogo.cn/gh/${e.group_id}/${e.group_id}/640/`
}
/** /**
* *
*/ */
@ -650,7 +657,7 @@ class PluginsLoader {
* at msg处理 * at msg处理
*/ */
if (e.msg && e.isGroup) { if (e.msg && e.isGroup) {
let groupCfg = cfg.getGroup(e.group_id) const groupCfg = cfg.getGroup(e.group_id)
let alias = groupCfg.botAlias let alias = groupCfg.botAlias
if (!Array.isArray(alias)) { if (!Array.isArray(alias)) {
alias = [alias] alias = [alias]

View File

@ -78,7 +78,18 @@ interface EventTypeBase {
/** /**
* *
*/ */
group_name: string group_name: string;
/**
*
*/
user_avatar: string | null
/**
*
*/
group_avatar: string | null
/** /**
* *
*/ */