Skip to content

Commit

Permalink
fix: add at name
Browse files Browse the repository at this point in the history
  • Loading branch information
sj817 committed Aug 12, 2024
1 parent 3f3aad9 commit 921e648
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/adapter/onebot/11/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function AdapterConvertKarin (data: Array<OB11Segment>): Array<KarinEleme
elements.push(segment.video(i.data.url || i.data.file))
break
case 'at':
elements.push(segment.at(i.data.qq, i.data.qq))
elements.push(segment.at(i.data.qq, i.data.qq, i.data.name))
break
case 'poke':
elements.push(segment.poke(Number(i.data.id), Number(i.data.type)))
Expand Down Expand Up @@ -86,7 +86,7 @@ export function KarinConvertAdapter (data: Array<KarinElement>, bot: AdapterOneB
elements.push({ type, data: { id: i.id } })
break
case OB11SegmentType.At:
elements.push({ type, data: { qq: String(i.uid || i.uin) } })
elements.push({ type, data: { qq: String(i.uid || i.uin), name: i.name } })
break
case OB11SegmentType.Reply:
elements.push({ type, data: { id: i.message_id } })
Expand Down
4 changes: 2 additions & 2 deletions src/types/onebot11/segment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-unused-vars */
/**
* - OneBot11消息类型枚举
*/
Expand Down Expand Up @@ -102,7 +101,8 @@ export interface VideoSegment extends Segment {
export interface AtSegment extends Segment {
type: OB11SegmentType.At
data: {
qq: string | 'all'
qq: string | 'all',
name?: string
}
}

Expand Down

0 comments on commit 921e648

Please sign in to comment.