Skip to content

Commit

Permalink
fix: omit redundant attributes (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: Shigma <[email protected]>
  • Loading branch information
idranme and shigma authored Aug 8, 2024
1 parent a391748 commit c289053
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h, hyphenate, Universal } from 'koishi'
import { h, hyphenate, omit, Universal } from 'koishi'
import * as qface from 'qface'
import { BaseBot, CQCode } from './bot'
import * as OneBot from './types'
Expand Down Expand Up @@ -77,25 +77,25 @@ export async function adaptMessage(
image(attrs) {
return h('img', {
src: attrs.url || attrs.file,
...attrs,
...omit(attrs, ['url']),
})
},
record(attrs) {
return h('audio', {
src: attrs.url || attrs.file,
...attrs,
...omit(attrs, ['url']),
})
},
video(attrs) {
return h('video', {
src: attrs.url || attrs.file,
...attrs,
...omit(attrs, ['url']),
})
},
file(attrs) {
return h('file', {
src: attrs.url || attrs.file,
...attrs,
...omit(attrs, ['url']),
})
},
})
Expand Down

0 comments on commit c289053

Please sign in to comment.