How to use Discord to display Discourse RSS feed


(Daniela) #1

So you want visualize RSS feed from your Discourse forum to your Discord server.

To do that you need a Discord Bot. You can use a hosted bot with an RSS cog and add it to your server or install a self-hosted bot and configure it.

I prefer Red-DiscordBot because it is self-hosted (you can install it on your server, it’s very easy to maintain, highly customizable and it has a very active community.)

Setting up the bot

  1. Follow this tutorial to install and configure Red.

  2. Create a new bot account on Discord and add the bot to your Discord server.

Adding the RSS feeds (custom cog)

When the bot is online on your server, you need to add a new custom cog (RSS) from the approved repositories

Install feedparser, running this command on your shell pip3 install feedparser

In your Discord channel type the follow commands:

[p]cog repo add squid-plugins https://github.com/tekulvw/Squid-Plugins

where [p] is your own bot’s prefix

You can see the author’s message in your channel, remember to type I agree to complete the installation.

[p]cog install squid-plugins rss

Installation completed. Load it now? (yes/no)

Type yes

Now you have an RSS cog to configure. Choose the channel you want to use to visualize your RSS feed.

Note that every RSS is diplayed only in the channel you send the command, so you can add more RSS in one channel or you can add RSS for more (even all) channels (e.g. in #laboratory channel I have https://meta.discourse.org/latest.rss, in #general http://my.site.net/latest.rss, in #assistance http://my.site.net/c/assistance.rss and so on…)

Type:

[p]rss add Discourse https://meta.discourse.org/latest.rss

where “Discourse” is the name I have assigned to this RSS. You can add more than one RSS, but every RSS must have a different name.

If you use more than one word in your feed name, you have to use the double quotes e.g.

[p]rss add "Discourse Support" https://meta.discourse.org/c/support.rss

Now you can add a template without link preview:

[p]rss template Discourse $name:\n$title\n<$link>

or with link preview:

[p]rss template Discourse $name:\n$title\n$link

To force the feed preview type:

[p]rss force your-feed-name (e.g. [p]rss force Discourse)

This is the result without preview:

and with a preview:

Discourse RSS feeds


Thanks to @erlend_sh for his review :slight_smile:


Discord Webhook
Can we add "feed" function on Discourse?
Discord Integration
(@SenpaiMass) #2

If you want a free hosted option, try http://nurevam.site/ it has a dedicated discourse to discord cog.


(Daniela) #3

I’m not be able to find the commands for RSS, only site statistics and some user’s info.
Can you share the RSS commands please?

EDIT: nevermind, I’m talking to maverun via chat, I have some problems with nurevam atm.
I’ll update the post if I resolve.


(Daniela) #4

Update

The command to add the RSS cog has changed from

[p]cog install squid rss

to

[p]cog install squid-plugins rss

First post edited. Thanks to @cryptic!


(Daniela) #5

Update

Added the command for feedparser (requirement) to run the RSS cog.


(Richard B ) #6

Hey, i wanted to ask you why this link doesn’t work ?
::rss add GPOC - Forum https://kokonuts.de/syndication.php?limit=15


(Daniela) #7

I’m using it with normal rss links provided by Discourse itself.
Try to ask to the author of the rss cog (@Will#4100) in his discord channel if it can works with a php forum Discord (if he doesn’t respond try to ask in the #support channel of Red Discord )


#8

I assume this only works with public forums, not with private ones…?


(Daniela) #9

Sincerly I’ve never tried with private forum. Can you send me an invite via Pm to your forum so I can try with my bot on my private discord server that I use for tests?


#10

I am still building my forum, can’t really invite anyone yet. But it can’t work with a private forum. The bot won’t be able to pull the RSS feed unless it can access the forum - which it only can if it’s a member.