-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
feed2discord.ini
154 lines (133 loc) · 6.14 KB
/
feed2discord.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Copy this to feed2discord.local.ini and THEN edit it.
[MAIN]
# 0 just prints some basic info as thing runs
# 1 prints debug stuff for this bot
# 2 and above start printing debug stuff for libraries, etc
# 4 and above includes full parsed items, which can be quite verbose...
debug = 0
# email/password combo is the old method.
# I recommend creating a separate bot account.
#login_email = blah@example.com
#login_password = PASSWORD HERE
# The timezone of the machine you're running the client on.
# On most Linux/Unix systems, you can run "ls -l /etc/localtime" to see what
# it is.
timezone = utc
# timezone = America/Los_Angeles
# now you need to get a bot token.
# https://discordapp.com/developers/docs/topics/oauth2
# https://discordapp.com/developers/applications/me#top
login_token = abc123
# You can just leave this alone, unless you might try to run from other than
# current directory:
db_path = feed2discord.db
# If you have a server with "NEWS" / "Announcement" feature on
# and publish=1, then any channel with NEWS on that the bot has "manage_messages" permissions in,
# will have its messages "published" so that they show up on any servers that Follow that channel.
publish = 0
# Can set the "game played" to whatever you want
#gameplayed = discord_rss_bot
# Or pick a different "avatar" icon:
#avatarfile = avatars/avatar.png
# Log in as your bot account, accept any required invites, get all the roles
# you need, etc...
# The the last bit of the link is the id needed.
# The name here is purely internal to the bot, and doesn't need to match.
[CHANNELS]
one = MAGIC CHANNEL ID HERE
two = ANOTHER MAGIC ID
three = YET ANOTHER MAGIC ID
testing = 81402706320699392
[DEFAULT]
# maximum time before feed first gets refreshed;
# actual time is randomly chosen from 0 to this number,
# to minimize startup impact, especially on the servers we pull feeds from.
# defaults to rss_refresh_time.
# start_skew = 900
# minimum sleep time at startup; defaults to 1 second
start_skew_min = 1
# time between refreshes of a feed
rss_refresh_time = 900
# maximum age of a post before it's discarded:
max_age = 86400
# only do the typing activity thing to one room
one.send_typing = 1
two.send_typing = 0
# This is a fairly typical Drupal RSS feed:
[ednews]
# channel ids from [CHANNELS], separated by commas
channels = two
# The RSS or Atom feed URL:
feed_url = https://community.elitedangerous.com/taxonomy/term/6/feed
# fields, separated by commas
# Special handling:
# - a field in "quotes" just returns the bit inside the quotes instead of
# the actual field ("Feed Name" or "@everyone"?)
# - a field in *asterisks* or _underscores_ gets italicized
# - a field in **double-asterisks** gets bolded
# - ***triple*** gets you bold italics
# - A field in `backquotes` gets marked up as code
# - A field in <anglebrackets> won't get a link preview embedded
# - The "link" field is always assumed to be a URL, and relative URLs will
# automatically be turned into absolute URLs.
# - For a code block, wrap in ```
# - a field with no markup here will have the HTML in it replaced with
# markdown (discord's format language)
# If you want a field that contains HTML to have a chance of not being
# horrifyingly ugly, do the plain option.
fields = link,**title**,_published_,description
# Despite the name, this is an atom feed.
# I'm not sure if the date thing they do is unusual for Atom feeds or not:
[discordreddit]
channels = testing
feed_url = https://www.reddit.com/r/discordapp/new/.rss
# discord formats reddit links pretty nicely already...
fields = link
# busy, so only look at last hour's posts:
max_age = 3600
# Galnet doesn't have URLs in the feed, but they can be calculated. Unusual:
[galnet]
channels = one,two
feed_url = https://community.elitedangerous.com/galnet-rss
# if you set item_url_base, then when the guid field is encountered, it gets
# the item_url_base stuck to the start.
# If you need a guid-based URL *and* a guid, do something like: guid,*guid*
item_url_base = https://community.elitedangerous.com/galnet/uid/
#filter_field = title
#filter_exclude = ^Galactic News: (Weekly .* (List|Report|Digest)|Focus on Democracy)$
fields = guid,**title**,_published_,description
# for just one channel, ping @everyone
two.fields = "@everyone",guid,**title**,_published_,description
# 5 second delay to the other room
one.delay = 5
# Project Gazelle RSS
[gazelle]
channels = one,two
feed_url = https://what.cd/feeds.php?feed=torrents_all&user=xxx&auth=xxx&authkey=xxx
# Suppose you have one feed with different types of content, which you want to redirect posts to different channels
# Use python regex!
# Regex is done on the title field of the entry
# Channel one receives all entries which have a space-padded "MP3" or "AAC" in the title
one.filter =(\bMP3\b|\bAAC\b)
# Channel two receives all entries which do not have space-padded "MP3" or "AAC" in the title
two.filter =^((?!(\bMP3\b|\bAAC\b)).)*$
# Channel three also receives entries which do not have space-padded "MP3" or "AAC", but in the comments
three.filter_exclude =(\bMP3\b|\bAAC\b)
three.filter_field = comments
# and all other rooms only get the OGG files...
filter = (\bOGG\b|\bM4A\b)
# If a channel has no filter field, it always passes (yet to test)
# Consider a feed which provides a list of tags of a entry
# And that some users want to be notified of these posts
# Use the @ formatting!
fields = **title**,comments,@category,"------------------------------"
# @ format tag turns a field with a space-seperated list of tags into @mentions, provided the @[tag] role exists in the discord server
# For example, a entry with the list of tags "jazz, piano" will be turned into
# "<@&[id for jazz role]>, piano" provided a role @jazz exists
# and when posted it will mention everyone with the @jazz role, and print "@jazz, piano"
# Personal recommendation is to create user classes which DO NOT conflict with tag names
# And also create a user role which is able to modify their own role, hence modifying their subscriptions
# For example, a role hierarchy would be, in descending order:
# Admin, bots, special users, user (this is what you promote everyone to, probably automatically)
# (tag roles here) house, jazz, piano, dubstep
# (finally the @everyone) @everyone