@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
Follow this tutorial to install and configure Red.
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 prefixYou 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:
![]()
Discourse RSS feeds
http://your.site.net/posts.rss
latest posts (if your site is medium or big this link can create a lot of traffic in your Discord channel. Maybe create a channel only for RSS feed is better).http://your.site.net/t/title-of-the-topic/number-id.rss
for a particular topic (e.g.https://meta.discourse.org/t/babble-a-chat-plugin/31753.rss
to follow the thread about Babble plugin)http://your.site.net/latest.rss
latest topicshttp://your.site.net/top.rss
top rated topicshttp://your.site.net/c/support.rss
posts and topics from a category (e.g. #support)http://your.site.net/users/someone/activity.rss
latest posts from someone (changesomeone
with an username, e.g.codinghorror
)http://your.site.net/users/someone/activity/topics.rss
latest topics from someone (changesomeone
with an username, e.g.codinghorror
)http://your.site.net/groups/team/posts.rss
all the public posts from a group (changeteam
with the name of your group).http://your.site.net/tags/tag-name.rss
all the public topics with a particular tag (e.g.https://meta.discourse.org/tags/docker.rss
to follow all the topics tagged #docker)
Thanks to @erlend_sh for his review