Skip to content

Commit

Permalink
fix: NapCat RichHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Jul 17, 2024
1 parent 86b6e57 commit 258c919
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/src/api/richHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import fs from 'fs';
import { Group as OicqGroup, Member as OicqMember } from '@icqqjs/icqq';
import { format } from 'date-and-time';
import { Group, GroupMemberInfo } from '../client/QQClient';
import { NapCatGroupMember } from '../client/NapCatClient';

const template = ejs.compile(fs.readFileSync('./assets/richHeader.ejs', 'utf-8'));

Expand All @@ -28,6 +29,9 @@ export default ((fastify, opts, done) => {
if (member instanceof OicqMember) {
memberInfo = member.info;
}
else if (member instanceof NapCatGroupMember) {
memberInfo = await member.renew();
}
if (!memberInfo) {
memberInfo = {} as any;
}
Expand Down

0 comments on commit 258c919

Please sign in to comment.