Skip to content

Commit

Permalink
feat: ignore group_upload in favor of <file>, fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 13, 2024
1 parent bad1dbe commit 94b887c
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,20 @@ export async function adaptSession(bot: BaseBot, data: OneBot.Payload) {
session.type = 'onebot'
session.subtype = 'channel-destroyed'
break
case 'offline_file':
session.elements = [h('file', data.file)]
session.type = 'message'
session.subtype = 'private'
session.isDirect = true
session.subsubtype = 'offline-file-added'
break
case 'group_upload':
session.elements = [h('file', data.file)]
session.type = 'message'
session.subtype = 'group'
session.subsubtype = 'guild-file-added'
break
// https://github.com/koishijs/koishi-plugin-adapter-onebot/issues/33
// case 'offline_file':
// session.elements = [h('file', data.file)]
// session.type = 'message'
// session.subtype = 'private'
// session.isDirect = true
// session.subsubtype = 'offline-file-added'
// break
// case 'group_upload':
// session.elements = [h('file', data.file)]
// session.type = 'message'
// session.subtype = 'group'
// session.subsubtype = 'guild-file-added'
// break
default: return
}
} else return
Expand Down

0 comments on commit 94b887c

Please sign in to comment.