Skip to content

Commit 448ab6f

Browse files
committed
New features
### UPDATED - Item links from RSS feed sources that have `follow-redirects` enabled will now be trottled to prevent from being flagged as an automated query ### FIXED - Missing additional space when removing source from Google News RSS feed item titles ### ADDED - Ability to only allow certain links to post from an RSS feed source - Ability to add a dynamic year to messages routed via the Message Proxy - RSS feeds will now track item titles due to some feeds changing URLs after item is published
1 parent 54e53fd commit 448ab6f

7 files changed

Lines changed: 109 additions & 32 deletions

File tree

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ __NOTE:__ For Google News RSS Feeds, the source will be stripped from the title
791791
| `rss-feeds[x].user-agent` | `string` | User agent to use when retrieving RSS feed | no | Most popular user agents found in [Tech Blog (wh)](https://techblog.willshouse.com/2012/01/03/most-common-user-agents/) |
792792
| `rss-feeds[x].follow-redirects` | `boolean` | Follow redirects for each RSS update | no | `true` or `false` |
793793
| `rss-feeds[x].remove-parameters` | `boolean` | Remove all parameters for each RSS update | no | `true` or `false` |
794+
| `rss-feeds[x].allowed-urls` | `string[]` | Allow only URLs you specify to be sent | no | Partial URL beginning with. For example, `https://www.example.com/news/example.html` is allowed if `https://www.example.com/news/` is specified |
794795
| `rss-feeds[x].payload` | `object` | Message content to send for each RSS update | yes | `BaseMessageOptions` in [discord.js Documentation](https://discord.js.org/#/docs/main/stable/typedef/BaseMessageOptions). Variables include `%ITEM_LINK%` and `%ITEM_TITLE%` |
795796
| `rss-feeds[x].channel` | `object` | | yes | |
796797
| `rss-feeds[x].channel.description` | `string` | Description of the channel used to send message content | no | |
@@ -813,6 +814,9 @@ __NOTE:__ For Google News RSS Feeds, the source will be stripped from the title
813814
"user-agent": "stonker-bot",
814815
"follow-redirects": true,
815816
"remove-parameters": true,
817+
"allowed-urls": [
818+
"https://www.example.com/news/"
819+
],
816820
"payload": {
817821
"content": "Sample: %ITEM_TITLE% - %ITEM_LINK%"
818822
},
@@ -1236,22 +1240,22 @@ __NOTE:__ Replacements will expose the entire payload using regular expression.
12361240

12371241
__NOTE:__ Message edits and deletions will not be passed onto their offsets.
12381242

1239-
| __Key__ | __Type__ | __Description__ | __Required__ | __Accepted Values__ |
1240-
|---------------------------------------------------|------------|--------------------------------------------------------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1241-
| `message-proxies` | `object[]` | | no | |
1242-
| `message-proxies[x].name` | `string` | Name of the event | no | |
1243-
| `message-proxies[x].channel` | `object` | | yes | |
1244-
| `message-proxies[x].channel.description` | `string` | Description of the channel used to detect bot messages | no | |
1245-
| `message-proxies[x].channel.channel-id` | `string` | Channel used to detect bot messages | yes | Discord channel ID |
1246-
| `message-proxies[x].replacements` | `object[]` | | no | |
1247-
| `message-proxies[x].replacements[x].description` | `string` | Description of the replacement regex | no | |
1248-
| `message-proxies[x].replacements[x].pattern` | `string` | Regex pattern | yes | Read [Writing a regular expression pattern](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#writing_a_regular_expression_pattern) |
1249-
| `message-proxies[x].replacements[x].flags` | `string` | Regex flags | no | Read [Advanced searching with flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#advanced_searching_with_flags) |
1250-
| `message-proxies[x].replacements[x].replace-with` | `string` | Replace with | yes | Read [Using a regular expression to change data format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#using_a_regular_expression_to_change_data_format) |
1251-
| `message-proxies[x].print-payload` | `boolean` | Print the "payload_json" value before and after replacements | no | `true` or `false` |
1252-
| `message-proxies[x].webhook` | `object` | | yes | |
1253-
| `message-proxies[x].webhook.description` | `string` | Description of the webhook | no | |
1254-
| `message-proxies[x].webhook.webhook-url` | `string` | Link to webhook | yes | Discord webhook link |
1243+
| __Key__ | __Type__ | __Description__ | __Required__ | __Accepted Values__ |
1244+
|---------------------------------------------------|------------|--------------------------------------------------------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1245+
| `message-proxies` | `object[]` | | no | |
1246+
| `message-proxies[x].name` | `string` | Name of the event | no | |
1247+
| `message-proxies[x].channel` | `object` | | yes | |
1248+
| `message-proxies[x].channel.description` | `string` | Description of the channel used to detect bot messages | no | |
1249+
| `message-proxies[x].channel.channel-id` | `string` | Channel used to detect bot messages | yes | Discord channel ID |
1250+
| `message-proxies[x].replacements` | `object[]` | | no | |
1251+
| `message-proxies[x].replacements[x].description` | `string` | Description of the replacement regex | no | |
1252+
| `message-proxies[x].replacements[x].pattern` | `string` | Regex pattern | yes | Read [Writing a regular expression pattern](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#writing_a_regular_expression_pattern) |
1253+
| `message-proxies[x].replacements[x].flags` | `string` | Regex flags | no | Read [Advanced searching with flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#advanced_searching_with_flags) |
1254+
| `message-proxies[x].replacements[x].replace-with` | `string` | Replace with | yes | Read [Using a regular expression to change data format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#using_a_regular_expression_to_change_data_format). Variables include `%YEAR%` |
1255+
| `message-proxies[x].print-payload` | `boolean` | Print the "payload_json" value before and after replacements | no | `true` or `false` |
1256+
| `message-proxies[x].webhook` | `object` | | yes | |
1257+
| `message-proxies[x].webhook.description` | `string` | Description of the webhook | no | |
1258+
| `message-proxies[x].webhook.webhook-url` | `string` | Link to webhook | yes | Discord webhook link |
12551259

12561260
```json
12571261
{

config-sample.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@
398398
"user-agent": "stonker-bot",
399399
"follow-redirects": true,
400400
"remove-parameters": true,
401+
"allowed-urls": [
402+
"https://www.example.com/news/"
403+
],
401404
"payload": {
402405
"content": "Sample: %ITEM_TITLE% - %ITEM_LINK%"
403406
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "discord-stocker-bot",
33
"displayName": "Discord Stonker Bot",
4-
"version": "3.2.1",
4+
"version": "3.3.0",
55
"description": "An advanced bot built for finance-related Discord servers",
66
"main": "build/src/index.js",
77
"private": true,

0 commit comments

Comments
 (0)