Just the messages in the invoking channel, ideally up to a specified stopping point.
A fancy way of doing it would be:
- hit “Reply” on the first message you want posted
- Write @YourDiscourseIntegrationBotAccount, optionally adding
transcriptor one of its translations on the end - A transcript from that message to the current time, capped at ~50 messages, is posted to Discourse, as the acting user if possible
You could go fancier if you want to permit interactive input, like setting a custom stop point, excluding some messages, custom destination category. This is the best UX I can come up with that isn’t a back-and-forth.
Actually, it would be fairly easy to make this interactive:
const BASE_URL = "https://discourse.example.com";
// preconditions:
// msg.type == REPLY (19)
// msg.mentions or msg.mention_roles contains the bot
// this is in JS but it'd need to be in Ruby
function onMentionWithReply(msg) {
discord.sendMessage({
content: "<" + BASE_URL +
"/chat-integration/discord/make-transcript/" +
msg.channel_id + "/" +
msg.message_reference.message_id + ".." + msg.id +
">";
type: REPLY,
message_reference: { message_id: msg.id },
});
}
Where /chat-integration/discord/make-transcript/:channel_id/:id1..:id2 would render an interactive page on Discourse where you could preview the messages and finalize them.
Pitfalls:
- Need to access-check the user hitting that page to avoid improperly disclosing transcripts.