Skip to content

Commit

Permalink
refactor(shell): satori: api: message.create do not route to `chron…
Browse files Browse the repository at this point in the history
…ocat.internal.message.create2.markdown`
  • Loading branch information
ilharp committed Jul 25, 2024
1 parent d66df3e commit 89d8a06
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/shell/src/satori/routes/message/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,16 @@ async function messageCreateUsingJson({
method = 'chronocat.internal.message.create2.poke'
}

const markdowns = cctx.chronocat.h.select(
payloadRich.content,
`${cctx.chronocat.platform}:markdown`,
)
if (markdowns.length) {
// TODO: 如果单条消息内除了 markdown 还有其他元素,打印警告
method = 'chronocat.internal.message.create2.markdown'
}
// Markdown 现在不走此 API 发送
//
// const markdowns = cctx.chronocat.h.select(
// payloadRich.content,
// `${cctx.chronocat.platform}:markdown`,
// )
// if (markdowns.length) {
// // TODO: 如果单条消息内除了 markdown 还有其他元素,打印警告
// method = 'chronocat.internal.message.create2.markdown'
// }

const result = await cctx.chronocat.api[method](payloadRich, config)

Expand Down

0 comments on commit 89d8a06

Please sign in to comment.