Quantcast
Channel: Display a Discourse RSS feed in Discord
Viewing all articles
Browse latest Browse all 12

How to use Discord to display Discourse RSS feed

$
0
0

@Dax wrote:

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 Discourse Meta - Latest topics, 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:

Read full topic


Viewing all articles
Browse latest Browse all 12

Trending Articles