Discord to discourse?

Hello, is there a way to create posts in discourse automatically from posts made in discord?

Hi Sam! Welcome to our community. Take a look at Set up Discord notifications using the discourse-chat-integration plugin

In future please try the :mag: search - many questions have already been discussed here and the search is quite good at helping find them.

1 Like

Thanks, but i did look and this is not what im looking for, this is discourse to discord, not discord to discourse.

Example scenario:
Channel in Discord gets a message, this message is then sent to Discourse and a thread created with the info.

3 Likes

chat-integration can do that in Slack; You’re looking for the post transcripts feature to be implemented for Discord.

2 Likes

Thanks, so there is no automated way to do it then

You could do this with a custom Discord bot that copies the content of messages and makes a post request to your forum.

This would involve additional hosting, unless you want to write your bot in discordrb and use a plugin on your forum.

Try using this:

https://meta.discourse.org/t/how-to-connect-discourse-with-hundreds-of-apps-using-integromat/

Thanks, I tried this but for some reason i cant get the right message id variable set up on it to work.

Their tech support can most likely help you figure it out.

How would that work wrt permissions and invocation?

Would you want all messages to get copied, or just ones in a particular channel? Would they all get appended to a single Topic - what would cause a fresh Topic to be created?

Would all Discord users have rights to do it?

Where would it end up? Without a category?

3 Likes

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 transcript or 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.
4 Likes

Currently, i have a link from slack to Trello, Trello to discord, so id like to get those posts made in discord, or I guess Trello to create a new post under a specific topic.

Too many places to post and not enough time! :slight_smile:

Thanks, il take a look at it

Oh! Apologies. I didn’t realize that integration doesn’t post in both directions, like the slack integration does.

Generally I do have to wonder… why would you want to do this? You will clutter your long term memory on discourse with chatter.

No problem, the channel posts i want to post to discourse are announcements of new updates in the game, it is very time consuming to post the same thing in multiple places, and discourse often gets forgotten. So I am trying to reduce my work load and at the same time hope to increase activity in Discourse.

2 Likes

Ok so I found a workaround that i guess will have to do
I had to use zapier (the downside is it is not enough on the free plan to cover the posts) to connect my trello to discourse to reply to a thread I had to create for this.
So now the flow is;
API from data base posts to slack, slack creates trello card, trello posts to discord and discourse. :slight_smile:

Except now i have a loop where discourse is reposting to discord lol anyway to exclude my posts from that?

I’ve added a related feature to: "Discord Bot": run one on your Discourse server & keep things in sync - #79 by merefield

If you designate a Channel as the “Announcements Channel”, any message typed there will get posted on your designated Discourse Topic.

(The update also watches for announcements from Discourse that are copied to Discord in the same channel)

This also occurs on my implementation, but it’s not an infinite loop, it just confirms back that the Post has been added. You can avoid that by putting the Discord Topic on Discourse in a different place and avoid the watched Categories.

6 Likes

oh thanks, this might actually save me from using another third-party app! I will just have to see how it handles image links

1 Like

actually im not really understanding your instructions, i cant find this in discourse menus under plugin and im not understanding how to install your plugin.

Please post specific issues with the instructions on the the plugin Topic.

Your issue is currently a bit vague for me to help you. Make sure you’ve read the OP thoroughly, then post a specific issue and I’ll be glad to help you.

1 Like