diff --git a/commands/fediverse/flood.js b/commands/fediverse/flood.js index eec2f4a..b016abd 100644 --- a/commands/fediverse/flood.js +++ b/commands/fediverse/flood.js @@ -12,7 +12,8 @@ exports.runQuery = function (roomId) { const len = events.length; for (let i = len - 1; i >= 0; i--) { if (past.findIndex((x) => x.created_at === events[i].created_at) === -1) { - if (events[i].created_at < past.slice(18, 19)[0].created_at) return; + const lastStored = past.slice(past.length - 1, past.length); + if (events[i].created_at < lastStored[0].created_at) return; events[i].label = 'status'; fediverse.utils.formatter(events[i], roomId); } diff --git a/commands/fediverse/notify.js b/commands/fediverse/notify.js index 04a3f18..c77c6b1 100644 --- a/commands/fediverse/notify.js +++ b/commands/fediverse/notify.js @@ -12,7 +12,8 @@ exports.runQuery = function (roomId) { const len = events.length; for (let i = len - 1; i >= 0; i--) { if (past.findIndex((x) => x.created_at === events[i].created_at) === -1) { - if (events[i].created_at < past.slice(18, 19)[0].created_at) return; + const lastStored = past.slice(past.length - 1, past.length); + if (events[i].created_at < lastStored[0].created_at) return; events[i].label = 'notifications'; fediverse.utils.formatter(events[i], roomId); } diff --git a/config.example.js b/config.example.js index 3524c62..ebc4c85 100644 --- a/config.example.js +++ b/config.example.js @@ -25,12 +25,12 @@ module.exports = { nitter: { domain: 'nitter.fdn.fr', userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', - domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com', 'mobile.twitter.com', 'm.twitter.com' ], + domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com', 'mobile.twitter.com', 'm.twitter.com', 'nitter.fdn.fr' ], check: '(✅)' }, invidious: { domain: 'invidious.fdn.fr', userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', - domains: [ 'invidious.snopyta.org', 'invidious.xyz', 'youtube.com', 'www.youtube.com', 'youtu.be', 'm.youtube.com' ] + domains: [ 'invidious.snopyta.org', 'invidious.xyz', 'youtube.com', 'www.youtube.com', 'youtu.be', 'm.youtube.com', 'invidious.fdn.fr' ] } };