Skip to content

Commit

Permalink
feat(onebot): support author.roles
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 6, 2021
1 parent 0e9b724 commit aef0404
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/adapter-onebot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export const adaptUser = (user: OneBot.AccountInfo): Koishi.UserInfo => ({
export const adaptGroupMember = (user: OneBot.SenderInfo): Koishi.GroupMemberInfo => ({
...adaptUser(user),
nickname: user.card,
roles: [user.role],
})

export const adaptAuthor = (user: OneBot.SenderInfo, anonymous?: OneBot.AnonymousInfo): Koishi.AuthorInfo => ({
...adaptUser(user),
nickname: anonymous?.name || user.card,
anonymous: anonymous?.flag,
roles: [user.role],
})

function adaptContent(content: string) {
Expand Down

0 comments on commit aef0404

Please sign in to comment.