Skip to content

Commit

Permalink
fix(discord): fix regression of #212
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 10, 2021
1 parent 8735b3b commit 3a7e6b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/adapter-discord/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ async function adaptMessageSession(bot: DiscordBot, meta: DC.Message, session: P
await adaptMessage(bot, meta, session)
session.messageId = meta.id
session.timestamp = new Date(meta.timestamp).valueOf() || new Date().valueOf()
// 遇到过 cross post 的消息在这里不会传消息id
// eslint-disable-next-line camelcase
session.content = segment('quote', { id: meta.message_reference.message_id, channelId: meta.message_reference.channel_id }) + session.content
// 遇到过 cross post 的消息在这里不会传消息 id
if (meta.message_reference) {
const { message_id, channel_id } = meta.message_reference
session.content = segment('quote', { id: message_id, channelId: channel_id }) + session.content
}
return session
}

Expand Down

0 comments on commit 3a7e6b2

Please sign in to comment.