Discord-Discourse Bot

What

We have started a discord bot to send message from discord to discourse.

Repo:

GIF

Initial Functionality

  • Select Single Messages, Multiple Message, or Entire Thread/Channel (Threads are buggy)
  • Displays Preview before Submittal (Completed)
  • On Submit: Sends post to Discourse using Discourse API (Functional in sandbox category)

Suggestions/Ideas

  • Users select category to send post to
  • User accounts connected between Discord/Discourse to submit to Discourse under their own username
  • Search Discourse topics/posts from Discord
  • Create GitHub issue from posts

To-do

  • Move to RW API side
  • Finalize post functionality to use selected message
  • Debug thread interactivity
  • Final testing before going live

Contributing / Feedback

Feel free to contribute to the bot. The github repo is linked at the top. Suggestions, ideas, feedback, etc are all welcome.

Links

** This post may be edited as things change.

1 Like

Hi @PantheRedEye ,

I’m not sure I understand the purpose of this bot, community wise.
Can you elaborate on the intention behind this?

1 Like

@noire.munich

Hey noire,

A main goal is to facilitate migrating discord message into discourse for archival type purposes. I would say it is initially targeted at moving questions/answers/solutions. This would help build upon the ‘knowledge base’ that is searchable within discourse. However, it could also be used to shift discussions, when appropriate, from discord to discourse (that is where a ‘category selection’ would be a nice feature). Expanded functionality could work to increase information flow both ways… for instance, using the bot to search the forums from directly inside discord would be nice.

To specifically relate this project to the RW community, it started a weekend hack-turned POC, based on some ideas @thedavid and others had. It was moved under the RW github organization after it was up and running in an ‘alpha’ form. As of today, it has not progressed much beyond that phase. I have the function to post from the bot to discourse working. However, I have not connected the message collector to the post function yet. Also, I started it based on the discordjs docs and did not use rw as the basis for it. I am currently working on moving it into the api side of a rw project like @dom has done with the github bot.

As far as use and adoption within the community, I expect the bot will very much be in a ‘trial’ phase for a while after it is up and running. The bot will be posting a lot of messages under its own name at first. It will probably have a single category dedicated for it. This category may simply become a ‘discord archive.’ That is valuable in its own right.

It may also help increase user engagement within the community. Enabling category selection would make it easier to migrate unanswered questions or discussions to the forums where they may be better served. A stretch goal is to connect usernames between discord/discourse. This seems complex, and I am not sure about the mechanisms with this, but it may be a goal worth pursuing. At that point, we could ask users to moderate or manage messages under their own name for more ownership.

Finally, once it is up and running well, other communities could use this sort of solution. Making the bot more widely available to the discord community is a personal a long-term goal. I am hopeful that the redwood community will help facilitate that somehow.

Regards,

Barrett

PS I saw the example application README guidelines and like them. I will look to upgrade the bot’s readme to your format.

1 Like

The topic of abuse/moderation of the bot is probably something we should discuss at some point. I figure this will be initially worked out during the ‘trial’ phase, as mentioned above, or on a feature-by-feature basis.

Strategies for moderation:

  • No moderation - all commands open to all rw discord members
  • Discord roles permissions - Commands restricted to discord users with certain roles.
  • Message queue - All commands open to all rw discord members - selected messages fall into a ‘queue’ for moderators to approve/deny
  • Discord/Discourse Users - Commands open to users with verified discord/discourse username connections.

Also, rate limiting or something like it may be useful.

These are not necessarily near future things. Just thought I would toss it out as a bookmark and for feedback.

1 Like

Thanks for the elaborate reply @PantheRedEye , things are much clearer indeed.

Some use cases were clear to me, others were less obvious, but in general I see the interest of it.

I am indeed concerned about moderation issues : the strength of Discourse is that it is heavily relying on its moderation mechanisms. I would be concerned of not breaking those through a misuse of the bot.

Rate limiting is interesting to avoid spamming, and from your proposed strategies I think moderation should be enforced through Discourse’s expectations first.

Are you proposing to create and match Discord roles & permissions reflecting exactly Discourse’s, or would they be different?

Regards,

Thomas

1 Like

@noire.munich

I agree with you that a strength of discourse is its moderation mechanisms. However, right now, I am not sure what I would propose regarding roles/permissions mapping between discord/discourse. I bookmarked some links below to revisit later.

If moderation is a concern, I would like to have input from others before enabling this, then I would initially fall on the side of delegating responsibility to discord mods/trusted users. That scenario would be easier to work into the bot, since its code is heavily weighted on the discord side of things. That approach would facilitate the bot getting up and running sooner. I don’t like putting more work on people, and this would put the burden on discord mods. The idea of hooking into discourse usernames more directly is appealing from that point of view. However, I have no clue where to begin thinking about doing something like that. What are your thoughts?

However, a similar but different topic that comes to mind now is: polluting the discourse post feed with the posts that the bot makes. I wonder if there is a way to hide the posts from the bot from the ‘Latest’ filter. When I open the forums, my front page shows the latest posts. This is default, and can probably be changed (I have not looked to see), but I imagine a lot of users fall into the same view. I come to discourse to see what discussions are going on in the community. I do not necessarily want to see a list of 5-10 questions that have been asked, answered and then posted from discord.

From the thread linked above:

  • The ‘Unlist’ option will work but prevents finding things in search. That is not what we want.
  • The ‘Private’ category option also works to a certain level, but again prevents people from finding it.
  • The accepted answer is to make a private category, and then to publish the topic as a page.

This last option is interesting… the bot could essentially start a long running wiki post… Not sure how to control organization/duplicates within the post. Anyway… it seems like trying to avoid ‘list pollution’ might kill the intent of/or energy behind the bot, since there may not be a very good way to do it. Maybe letting discord mods move stuff is the best for now, since they may be able to better avoid duplication of topics.

Again, if I just get it hooked up and running, I think some of these things thoughts fall into the YAGNI category. We would initially still post to the private category. We get a sense of how things play out there, at some level, before looking to expand to the full community.

What thoughts come to your mind?

Description of various user states in Discourse (Admin / Moderator / Staff / Developer / Other)

Understanding Discourse Trust Levels

@PantheRedEye you’ve mentioned:

I would keep that in mind in any further discussions ;), but RW is the only community I’m on with Discord.


I feel like the topic of moderation is an important one for RedwoodJS, as its community is such a vital part of what Redwood actually is. Discourse is a great choice to build a community but it also lacks the energy and accessibility Discord has. They would definitely benefit from one another’s defining traits, so as a member of RedwoodJS I’d always look for what helps its community grow with the values it’s intended to have, and on a more global scope I’d be looking for a Discourse-Discord bot that supports the strengths of both tools.
This being said, we also aim at avoiding bottlenecks and the topic of moderation has come up in some occasions. Whatever solution we might come up with would be better if it didn’t require Core Team members’ dedication & time: efforts would be preferred in other things to help RW grow.

But this is somewhat a bit early to discuss, as it’s kinda very theoretical at the moment. I think what we really need to figure out is what we want to share and why, this should help us a lot more to understand what we can afford to do or not.


Migrating messages to build a new Discourse thread of question/answers/solution-s or migrating threads from the quick-help section to maintain a knowledge base would be very valuable and would also echo @dthyresson 's efforts on Discourse, who created posts at such effect.
I would definitely start with this and create a private Discourse category for the bot to bump up those knowledge bits - trial phase!

I would focus on migrating threads when a solution is found - and leave a last message posting the link to the Discourse newly created Knowledge base element/thread. In an effort to encourage a migration of the discussion, I would also simply close the thread in Discord ( is that possible? I see there are some options, like archiving a thread or changing its permissions to prevent new messages ). The OP of the thread and anyone with the core-team discord role could have a “Solution found” button. To think of it, if only the core-team role has that button, moderation would be there already.
Also, could we clean up threads with a solution found after some time? This could help with keeping things clean in Discord and making sure that no stone is left unturned.

If we can feed our Discourse Knowledge base with complete Question/answer/solution-s, that would be great. Any further discussion around the issue at hand, that could be healthy and necessary, would benefit from happening where the knowledge is stored and where the moderation is reinforced.

That’s where I’d begin thinking about it, as it seems to be a concrete, simple goal to define with clear immediate benefits. When we need more it will build up around this initial work.


Finishing thoughts FWIW: it seems to me that a Discord-Discourse bot should be thought of in regard to the community’s editorial line more than in terms of information events. RW’s Discord had a change in editorial line this year to simplify it, each community would have their own organization and purpose of content. But all those willing to use a Discourse-Discord bot will do it because they care for their community and want to keep track of meaningful content. The trap though is to get to a point where Discord and Discourse duplicate each others, where would be the point in living with/in those two?

Oh, and, I like your idea of being able to search Discourse from Discord.

1 Like

@PantheRedEye you might also be aware of this one:

Just for the sake of keeping some ressources of potential interest around.

1 Like

Yes… thank you :slight_smile: I was hoping to use that and not have to make one. He had to slow development. I believe the ruby api library was outdated and it would not work inside of threads… the js library is actively maintained and has a large discord community. Questions and answers are plentiful there, which helps.

You have inspired me to get more active on hooking up the bot! I will prioritize this.

-b

1 Like

@dom

How could the bot post a GitHub issue?

This is where username connections would be nice. Users could create, in their name, a GitHub issue directly from their chat.

1 Like
1 Like

The bot has been in a working state for a couple of weeks now. I am thinking about hosting options. I have a server I can toss it on for a while, but it will not be a long-term solution. I looked into using vercel/netlify and think I need baremetal. I may be wrong, so feel free to explore. The way it is set up, the bot has to wait for interaction responses from the user before submittal. I believe the delay in user interaction may time out any 10s serverless functions and drop the interaction context.

Anyway, I should have it up on my available server sometime this week. Any hosting thoughts are welcome.

I am lost on how to integrate this into a RW project. If this is a good long term goal to shoot for, I could use some help with this task. Perhaps this is not a good goal for this project. It may be overkill all for the sake of having an easy deploy button. I have given it a stab and am running into issues. I dropped everything in scripts and ran into problems getting it going there. I am not super clear on needing to put it in api or web side; services or functions…

I am going to scrap the redwood integration effort and just get it running as-is.