mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 05:17:35 +00:00
fix(discord): notification groupings
This commit is contained in:
@@ -17,7 +17,7 @@ You can test your notification configuration by running `npm run test:notificati
|
|||||||
|
|
||||||
| Environment variable | Description |
|
| Environment variable | Description |
|
||||||
|:---:|---|
|
|:---:|---|
|
||||||
| `DISCORD_NOTIFY_GROUP` | Discord group you would like to notify. Can be comma separated |
|
| `DISCORD_NOTIFY_GROUP` | Discord group you would like to notify |
|
||||||
| `DISCORD_NOTIFY_GROUP_3060TI` | Discord group to notify on 3060 Ti stock |
|
| `DISCORD_NOTIFY_GROUP_3060TI` | Discord group to notify on 3060 Ti stock |
|
||||||
| `DISCORD_NOTIFY_GROUP_3070` | Discord group to notify on 3070 stock |
|
| `DISCORD_NOTIFY_GROUP_3070` | Discord group to notify on 3070 stock |
|
||||||
| `DISCORD_NOTIFY_GROUP_3080` | Discord group to notify on 3080 stock |
|
| `DISCORD_NOTIFY_GROUP_3080` | Discord group to notify on 3080 stock |
|
||||||
@@ -34,9 +34,8 @@ You can test your notification configuration by running `npm run test:notificati
|
|||||||
| `DISCORD_WEB_HOOK` | Discord Web Hook URL. Can be comma separated. Use whole webhook URL |
|
| `DISCORD_WEB_HOOK` | Discord Web Hook URL. Can be comma separated. Use whole webhook URL |
|
||||||
|
|
||||||
???+ note
|
???+ note
|
||||||
If you don't assign a value to a series group it will always fallback to `DISCORD_NOTIFY_GROUP`.
|
All ground can be comma separated. `DISCORD_NOTIFY_GROUP` is always used if set.
|
||||||
|
|
||||||
???+ note
|
|
||||||
- If you're using a role, please use `<@&2834729847239842>`
|
- If you're using a role, please use `<@&2834729847239842>`
|
||||||
- If you're using a user, please use `<@2834729847239842>`
|
- If you're using a user, please use `<@2834729847239842>`
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,14 @@ export function sendDiscordMessage(link: Link, store: Store) {
|
|||||||
|
|
||||||
let notifyText: string[] = [];
|
let notifyText: string[] = [];
|
||||||
|
|
||||||
|
if (notifyGroup) {
|
||||||
|
notifyText = notifyText.concat(notifyGroup);
|
||||||
|
}
|
||||||
|
|
||||||
if (Object.keys(notifyGroupSeries).indexOf(link.series) !== 0) {
|
if (Object.keys(notifyGroupSeries).indexOf(link.series) !== 0) {
|
||||||
notifyText = notifyText.concat(
|
notifyText = notifyText.concat(
|
||||||
notifyGroupSeries[link.series]
|
notifyGroupSeries[link.series]
|
||||||
);
|
);
|
||||||
} else if (notifyGroup) {
|
|
||||||
notifyText = notifyText.concat(notifyGroup); // If there is no group for the series we
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user