Skip to content

Commit

Permalink
feat: 新增
Browse files Browse the repository at this point in the history
  • Loading branch information
yusheng929 committed Aug 5, 2024
1 parent 5b3387c commit a13f2ca
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions apps/GroupOther.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { karin, logger, segment } from 'node-karin'
/**
* 看头像
*/
export const SeeImg = karin.command(/^#/, async (e) => {
export const SeeImg = karin.command(/^#()?/, async (e) => {
let userId = ''
if (e.at.length) {
userId = e.at[0]
} else {
userId = e.msg.replace(/#/, '').trim()
userId = e.msg.replace(/#()?/, '').trim()
}

if (!userId || !(/\d{5,}/.test(userId))) {
Expand All @@ -17,4 +17,15 @@ let userId = ''
}
let Img = e.bot.getAvatarUrl(userId, 640);
e.reply(segment.image(Img))
}, { name: "看头像", priority: "-1" })
return true
}, { name: "看头像", priority: "-1" })

/**
* 看群头像
*/
export const SeeGroupImg = karin.command(/^#(|)/, async (e) => {
let groupId = e.msg.replace(/^#?(|)/, "").trim() || e.group_id
let Img = e.bot.getGroupAvatar(groupId, 640);
e.reply(segment.image(Img))
return true
}, { name: "看群头像", priority: "-1" })

0 comments on commit a13f2ca

Please sign in to comment.