From d3646bee0c5078e0eb499a32a86ded1c4ae9d021 Mon Sep 17 00:00:00 2001 From: jateute Date: Mon, 20 Jun 2022 17:28:02 +0200 Subject: [PATCH 1/5] Updated the Twitch-Notifications module --- default-locales.json | 3 +- .../twitch-notifications/configs/config.json | 58 ----------------- .../configs/streamers.json | 64 +++++++++++++++++++ .../twitch-notifications/events/botReady.js | 28 ++++---- modules/twitch-notifications/module.json | 5 +- 5 files changed, 84 insertions(+), 74 deletions(-) create mode 100644 modules/twitch-notifications/configs/streamers.json diff --git a/default-locales.json b/default-locales.json index 45ab6fcc..60370137 100644 --- a/default-locales.json +++ b/default-locales.json @@ -327,7 +327,8 @@ }, "twitch-notifications": { "channel-not-found": "Channel with ID %c could not be found", - "user-not-on-twitch": "Could not find user %u on twitch" + "user-not-on-twitch": "Could not find user %u on twitch", + "message-not-found": "The Message for the Streamer %s is invalid" }, "economy-system": { "work-earned-money": "The user %u gained %m %c by working", diff --git a/modules/twitch-notifications/configs/config.json b/modules/twitch-notifications/configs/config.json index 9f9f41d7..4badffc6 100644 --- a/modules/twitch-notifications/configs/config.json +++ b/modules/twitch-notifications/configs/config.json @@ -3,54 +3,6 @@ "humanname-de": "Konfiguration", "humanname-en": "Configuration", "content": [ - { - "field_name": "liveMessage", - "humanname-de": "Live-Nachricht", - "humanname-en": "Live-Messages", - "default-en": "Hey, %streamer% is live on Twitch streaming %game%! Check it out: %url%", - "default-de": "Hi, %streamer% ist Live auf Twitch und streamt %game%! Jetzt anschauen: %url%", - "type": "string", - "allowEmbed": true, - "description-en": "Message that gets send if the streamer goes live", - "description-de": "Nachricht, die gesendet wird, wenn ein Streamer anfängt zu streamen", - "params-en": [ - { - "name": "%streamer%", - "description": "Name of the Streamer" - }, - { - "name": "%game%", - "description": "Game which is streamed" - }, - { - "name": "%url%", - "description": "Link to the stream" - } - ], - "params-de": [ - { - "name": "%streamer%", - "description": "Name des Streamers" - }, - { - "name": "%game%", - "description": "Spiel, welches gestreamt wird" - }, - { - "name": "%url%", - "description": "Link zum Twitch-Stream" - } - ] - }, - { - "field_name": "liveMessageChannels", - "humanname-en": "Channel", - "default": [], - "type": "array", - "content": "channelID", - "description-en": "Channel in which live-messages should get sent", - "description-de": "Kanal, in welchen Benachrichtigungen gesendet werden sollen" - }, { "field_name": "twitchClientID", "default": "", @@ -65,16 +17,6 @@ "type": "string", "description": "Secret of the Twitch-Client, which is used to check if the Streamer is live" }, - { - "field_name": "streamers", - "humanname-en": "Streamers", - "humanname-de": "Streamer", - "default": [], - "type": "array", - "content": "string", - "description-en": "Streamers where a notification should send when they start streaming", - "description-de": "Steamer, bei denen eine Benachrichtigung gesendet werden soll, wenn sie anfangen, zu streamen" - }, { "field_name": "interval", "default": 180, diff --git a/modules/twitch-notifications/configs/streamers.json b/modules/twitch-notifications/configs/streamers.json new file mode 100644 index 00000000..8096525f --- /dev/null +++ b/modules/twitch-notifications/configs/streamers.json @@ -0,0 +1,64 @@ +{ + "filename": "streamers.json", + "humanname-de": "Streamers", + "humanname-en": "Streamers", + "configElements": true, + "content": [ + { + "field_name": "liveMessage", + "humanname-de": "Live-Nachricht", + "humanname-en": "Live-Messages", + "default-en": "Hey, %streamer% is live on Twitch streaming %game%! Check it out: %url%", + "default-de": "Hi, %streamer% ist Live auf Twitch und streamt %game%! Jetzt anschauen: %url%", + "type": "string", + "allowEmbed": true, + "description-en": "Message that gets send if the streamer goes live", + "description-de": "Nachricht, die gesendet wird, wenn ein Streamer anfängt zu streamen", + "params-en": [ + { + "name": "%streamer%", + "description": "Name of the Streamer" + }, + { + "name": "%game%", + "description": "Game which is streamed" + }, + { + "name": "%url%", + "description": "Link to the stream" + } + ], + "params-de": [ + { + "name": "%streamer%", + "description": "Name des Streamers" + }, + { + "name": "%game%", + "description": "Spiel, welches gestreamt wird" + }, + { + "name": "%url%", + "description": "Link zum Twitch-Stream" + } + ] + }, + { + "field_name": "liveMessageChannel", + "humanname-en": "Channel", + "default": "", + "type": "channelID", + "description-en": "Channel in which live-message should get sent", + "description-de": "Kanal, in welchen Benachrichtigung gesendet werden soll" + }, + { + "field_name": "streamer", + "humanname-en": "Streamer", + "humanname-de": "Streamer", + "default": "", + "type": "string", + "description-en": "Streamer where a notification should send when they start streaming", + "description-de": "Steamer, bei denen eine Benachrichtigung gesendet werden soll, wenn sie anfangen, zu streamen" + } + ] +} \ No newline at end of file diff --git a/modules/twitch-notifications/events/botReady.js b/modules/twitch-notifications/events/botReady.js index 693480af..a6967f69 100644 --- a/modules/twitch-notifications/events/botReady.js +++ b/modules/twitch-notifications/events/botReady.js @@ -3,18 +3,18 @@ */ const {embedType} = require('../../../src/functions/helpers'); -const {ApiClient} = require('twitch'); -const {ClientCredentialsAuthProvider} = require('twitch-auth'); +const {ApiClient} = require('@twurple/api'); +const {ClientCredentialsAuthProvider} = require('@twurple/auth'); const {localize} = require('../../../src/functions/localize'); /** * General program - * @param {object} client Discord js Client + * @param {Client} client Discord js Client * @param {object} apiClient Twitch API Client * @private */ function twitchNotifications(client, apiClient) { - const config = client.configurations['twitch-notifications']['config']; + const streamers = client.configurations['twitch-notifications']['streamers']; /** * Sends the live-message @@ -22,13 +22,15 @@ function twitchNotifications(client, apiClient) { * @param {string} game Game that is streamed * @param {string} thumbnailUrl URL of the thumbnail of the stream * @param {number} channelID ID of the live-message-channel + * @param {number} i Index of the config-element-object * @returns {*} * @private */ - function sendMsg(username, game, thumbnailUrl, channelID) { + function sendMsg(username, game, thumbnailUrl, channelID, i) { const channel = client.channels.cache.get(channelID); if (!channel) return client.logger.fatal(`[twitch-notifications] ` + localize('twitch-notifications', 'channel-not-found', {c: channelID})); - channel.send(embedType(config['liveMessage'], { + if (!streamers[i]['liveMessage']) return client.logger.fatal(`[twitch-notifications] ` + localize('twitch-notifications', 'message-not-found', {s: username})); + channel.send(embedType(streamers[i]['liveMessage'], { '%streamer%': username, '%game%': game, '%url%': `https://twitch.tv/${username.toLowerCase()}`, @@ -43,12 +45,12 @@ function twitchNotifications(client, apiClient) { * @private */ async function isStreamLive(userName) { - const user = await apiClient.helix.users.getUserByName(userName.toLowerCase()); + const user = await apiClient.users.getUserByName(userName.toLowerCase()); if (!user) return 'userNotFound'; return await user.getStream(); } - config['streamers'].forEach(start); + streamers.forEach(start); /** * Starts checking if the streamer is live @@ -60,22 +62,22 @@ function twitchNotifications(client, apiClient) { async function start(value, index) { const streamer = await client.models['twitch-notifications']['streamer'].findOne({ where: { - name: value.toLowerCase() + name: value.streamer.toLowerCase() } }); - const stream = await isStreamLive(value); + const stream = await isStreamLive(value.streamer); if (stream === 'userNotFound') { return client.logger.error(`[twitch-notifications] ` + localize('twitch-notifications', 'user-not-on-twitch', {u: value})); } else if (stream !== null && !streamer) { client.models['twitch-notifications']['streamer'].create({ - name: value.toLowerCase(), + name: value.streamer.toLowerCase(), startedAt: stream.startDate.toString() }); - sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, config['liveMessageChannels'][index]); + sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, streamers[index]['liveMessageChannel'], index); } else if (stream !== null && stream.startDate.toString() !== streamer.startedAt) { streamer.startedAt = stream.startDate.toString(); streamer.save(); - sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, config['liveMessageChannels'][index]); + sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, streamers[index]['liveMessageChannel'], index); } } } diff --git a/modules/twitch-notifications/module.json b/modules/twitch-notifications/module.json index 161e7f3f..5dbcc4ba 100644 --- a/modules/twitch-notifications/module.json +++ b/modules/twitch-notifications/module.json @@ -1,7 +1,7 @@ { "name": "twitch-notifications", "author": { - "name": "ja.teute", + "name": "jateute", "link": "https://github.com/jateute", "scnxOrgID": "4" }, @@ -10,6 +10,7 @@ "events-dir": "/events", "models-dir": "/models", "config-example-files": [ - "configs/config.json" + "configs/config.json", + "configs/streamers.json" ] } \ No newline at end of file From c446dabee788d058a37d5b64948ea2ab2861763a Mon Sep 17 00:00:00 2001 From: jateute Date: Mon, 20 Jun 2022 18:11:03 +0200 Subject: [PATCH 2/5] Updated dependencies --- package-lock.json | 498 +++++++++++++++++++++++----------------------- package.json | 6 +- 2 files changed, 247 insertions(+), 257 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d44fbb7..562c71d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,19 @@ { "name": "customdcbot", - "version": "3.2.0", + "version": "3.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "customdcbot", - "version": "3.2.0", + "version": "3.3.0", "license": "GPL-3.0-or-later", "dependencies": { "@androz2091/discord-invites-tracker": "1.1.0", "@pixelfactory/privatebin": "2.6.1", "@scnetwork/api": "1.0.1", + "@twurple/api": "^5.1.6", + "@twurple/auth": "^5.1.6", "age-calculator": "1.0.0", "bs58": "4.0.1", "bufferutil": "4.0.6", @@ -27,8 +29,6 @@ "parse-duration": "1.0.2", "sequelize": "6.20.1", "sqlite3": "5.0.8", - "twitch": "4.6.7", - "twitch-auth": "4.6.7", "utf-8-validate": "5.0.9", "zlib-sync": "0.1.7" }, @@ -2197,21 +2197,6 @@ "node": ">=6.9.0" } }, - "node_modules/@d-fischer/cache-decorators": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@d-fischer/cache-decorators/-/cache-decorators-2.1.3.tgz", - "integrity": "sha512-MlM8ipg5Exkc0Ok//sG83smBW4mLRL+/ZngfxYQ8IgxBjfpM3m2M+Y2X+a9St3EyJfYoVKHR8RWdICsU+W3gSA==", - "dependencies": { - "@d-fischer/shared-utils": "^3.0.1", - "@types/node": "^14.14.22", - "tslib": "^2.1.0" - } - }, - "node_modules/@d-fischer/cache-decorators/node_modules/@types/node": { - "version": "14.17.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.15.tgz", - "integrity": "sha512-D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA==" - }, "node_modules/@d-fischer/cross-fetch": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@d-fischer/cross-fetch/-/cross-fetch-4.1.0.tgz", @@ -2220,20 +2205,6 @@ "node-fetch": "2.6.7" } }, - "node_modules/@d-fischer/deprecate": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@d-fischer/deprecate/-/deprecate-2.0.2.tgz", - "integrity": "sha512-wlw3HwEanJFJKctwLzhfOM6LKwR70FPfGZGoKOhWBKyOPXk+3a9Cc6S9zhm6tka7xKtpmfxVIReGUwPnMbIaZg==" - }, - "node_modules/@d-fischer/logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-3.1.0.tgz", - "integrity": "sha512-kNg9PjmiyH9DMr70mAWU+i+dy3+e1hI0lR+No5RJduQtexI247NmEzNd0pethpwm+1uA0MRf3w9QnqZ1PHKvyA==", - "dependencies": { - "detect-node": "^2.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/@d-fischer/promise.allsettled": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@d-fischer/promise.allsettled/-/promise.allsettled-2.0.2.tgz", @@ -2264,35 +2235,6 @@ "url": "https://github.com/sponsors/d-fischer" } }, - "node_modules/@d-fischer/rate-limiter": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/@d-fischer/rate-limiter/-/rate-limiter-0.4.5.tgz", - "integrity": "sha512-Q6TSDCbQcHShZAmX7UqG4ipPLjedAE2N5eV+30tr9c3QrejE5zTlNVY6CyX2bydXu+tVKmsajFix89ydpc9fWA==", - "dependencies": { - "@d-fischer/logger": "^4.0.0", - "@d-fischer/promise.allsettled": "^2.0.2", - "@types/node": "^12.12.5", - "tslib": "^2.0.3" - } - }, - "node_modules/@d-fischer/rate-limiter/node_modules/@d-fischer/logger": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.1.0.tgz", - "integrity": "sha512-e4NUW00Abq7QwWI2g0l4WdlDom5DWLRaU3fS/kNM69ylwq0G/pndX8bi06eBR5ytnI6/HhhdGpnvzgvv8RL6Ug==", - "dependencies": { - "@d-fischer/shared-utils": "^3.2.0", - "detect-node": "^2.0.4", - "tslib": "^2.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/@d-fischer/rate-limiter/node_modules/@types/node": { - "version": "12.20.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", - "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==" - }, "node_modules/@d-fischer/shared-utils": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@d-fischer/shared-utils/-/shared-utils-3.2.0.tgz", @@ -4792,6 +4734,127 @@ "node": ">= 6" } }, + "node_modules/@twurple/api": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/api/-/api-5.1.6.tgz", + "integrity": "sha512-je97EQQYKAFUL+wJbsqAvRUIcay6+6p9oeA/Fem6xMXMTdOcL80OfYgRhy/oKbh+JqQYwZRF2+a/dr8zVlt5Xg==", + "dependencies": { + "@d-fischer/cache-decorators": "^3.0.0", + "@d-fischer/logger": "^4.0.0", + "@d-fischer/rate-limiter": "^0.5.0", + "@d-fischer/shared-utils": "^3.2.0", + "@twurple/api-call": "^5.1.6", + "@twurple/common": "^5.1.6", + "tslib": "^2.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "@twurple/auth": "^5.0.0" + } + }, + "node_modules/@twurple/api-call": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/api-call/-/api-call-5.1.6.tgz", + "integrity": "sha512-8bUKcXBsvPMhifrhXQt9g/kf1XFXsvrTV+d6UryFB1RL8L/vDyI3FbCX4hZSJaXGK14zVL+obAngqcXn3ex4cw==", + "dependencies": { + "@d-fischer/cross-fetch": "^4.0.2", + "@d-fischer/qs": "^7.0.2", + "@twurple/common": "^5.1.6", + "@types/node-fetch": "^2.5.7", + "tslib": "^2.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/@twurple/api/node_modules/@d-fischer/cache-decorators": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@d-fischer/cache-decorators/-/cache-decorators-3.0.0.tgz", + "integrity": "sha512-mYUCjrp5hJgimceC5bof3zzmElyxzW4ty+73IjY12wvxLAqsq0CbgLGspnJm6KgwEfGoeRnISZD4EXJidG3FvA==", + "dependencies": { + "@d-fischer/shared-utils": "^3.0.1", + "@types/node": "^14.14.22", + "tslib": "^2.1.0" + } + }, + "node_modules/@twurple/api/node_modules/@d-fischer/logger": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.2.0.tgz", + "integrity": "sha512-Hgm/GfeZfv2UPcRY4uF4S7OtCCv6Xxx++q7FAXc1qMrInaowKrmpo6YdFwRfZ8z53gzXFhc6H8j1Ttm0046uTw==", + "dependencies": { + "@d-fischer/shared-utils": "^3.2.0", + "detect-node": "^2.0.4", + "tslib": "^2.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/@twurple/api/node_modules/@d-fischer/rate-limiter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@d-fischer/rate-limiter/-/rate-limiter-0.5.0.tgz", + "integrity": "sha512-bYxZ//vhtRSHx/K7vpcLxglCA80FGRAuRbNI//HsJmJcJ6abCO7ed/JlSJT9t4exRUPanM8igvEFEkffA4P4ug==", + "dependencies": { + "@d-fischer/logger": "^4.0.0", + "@d-fischer/promise.allsettled": "^2.0.2", + "@d-fischer/shared-utils": "^3.2.0", + "@types/node": "^12.12.5", + "tslib": "^2.0.3" + } + }, + "node_modules/@twurple/api/node_modules/@d-fischer/rate-limiter/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + }, + "node_modules/@twurple/api/node_modules/@types/node": { + "version": "14.18.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.21.tgz", + "integrity": "sha512-x5W9s+8P4XteaxT/jKF0PSb7XEvo5VmqEWgsMlyeY4ZlLK8I6aH6g5TPPyDlLAep+GYf4kefb7HFyc7PAO3m+Q==" + }, + "node_modules/@twurple/auth": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/auth/-/auth-5.1.6.tgz", + "integrity": "sha512-XnhNaJWEifr2aL1vvshhXj7v3yck38IJSVu7lzZ8csUFAzi7xphLit3LHlFGrrVYPkGQeNUx6crj0cDEUv7mtg==", + "dependencies": { + "@d-fischer/logger": "^4.0.0", + "@d-fischer/shared-utils": "^3.2.0", + "@twurple/api-call": "^5.1.6", + "@twurple/common": "^5.1.6", + "tslib": "^2.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/@twurple/auth/node_modules/@d-fischer/logger": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.2.0.tgz", + "integrity": "sha512-Hgm/GfeZfv2UPcRY4uF4S7OtCCv6Xxx++q7FAXc1qMrInaowKrmpo6YdFwRfZ8z53gzXFhc6H8j1Ttm0046uTw==", + "dependencies": { + "@d-fischer/shared-utils": "^3.2.0", + "detect-node": "^2.0.4", + "tslib": "^2.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/@twurple/common": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/common/-/common-5.1.6.tgz", + "integrity": "sha512-mFDcCDbqx8MWmxGQmn0kSV7nEqTDjF7CLimRm34MMPl5gskp+isbKVdkXBy68VftQvtz92U/HRF25eTdOpDyEw==", + "dependencies": { + "@d-fischer/shared-utils": "^3.2.0", + "klona": "^2.0.4", + "tslib": "^2.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, "node_modules/@types/asn1js": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-2.0.2.tgz", @@ -10627,6 +10690,14 @@ "node": ">=6" } }, + "node_modules/klona": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", + "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==", + "engines": { + "node": ">= 8" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -15173,11 +15244,6 @@ "node": ">=0.6" } }, - "node_modules/top-package": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/top-package/-/top-package-1.0.1.tgz", - "integrity": "sha512-tsuhQlHSigOTTvonxHXwqSKEVSnWMh2GvpTvXa5YmoyOwL5YvU4lTd/KNVZlKM5v7gqx44UEuQxyPQEpmaIHdg==" - }, "node_modules/toposort-class": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", @@ -15212,76 +15278,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, - "node_modules/twitch": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch/-/twitch-4.6.7.tgz", - "integrity": "sha512-inOFFLFhTcls/sskGcQWIfPgvhAF92fDo3uoGHdk0YRzo87NUHprvPE/LJJKh2IsysOPCmA1/mpnjReAgr5opA==", - "deprecated": "This package was renamed to @twurple/api. Please check out the migration guide at https://twurple.js.org/docs/migration/", - "hasInstallScript": true, - "dependencies": { - "@d-fischer/cache-decorators": "^2.1.1", - "@d-fischer/deprecate": "^2.0.2", - "@d-fischer/logger": "^3.1.0", - "@d-fischer/rate-limiter": "^0.4.3", - "@d-fischer/shared-utils": "^3.0.1", - "top-package": "^1.0.0", - "tslib": "^2.0.3", - "twitch-api-call": "^4.6.7", - "twitch-auth": "^4.6.7", - "twitch-common": "^4.6.7" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/twitch-api-call": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch-api-call/-/twitch-api-call-4.6.7.tgz", - "integrity": "sha512-JPiboygoHX3O2jdeWrmwW+VxpJbBYQJRg6+Th9GmqrsHivFFiyjBQproSMVJEgtrViGV1gHw6xlw1wHpoSU4Mw==", - "deprecated": "This package was renamed to @twurple/api-call. Please check out the migration guide at https://twurple.js.org/docs/migration/", - "dependencies": { - "@d-fischer/cross-fetch": "^4.0.2", - "@d-fischer/qs": "^7.0.2", - "@types/node-fetch": "^2.5.7", - "node-fetch": "^2.6.1", - "tslib": "^2.0.3", - "twitch-common": "^4.6.7" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/twitch-auth": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch-auth/-/twitch-auth-4.6.7.tgz", - "integrity": "sha512-9AkenhrZfXVdL1P2hJ7rLFKWOOGnkgf5isTJbjGD/GP2NYFYS+Oh8TYp8uyjW3/jQODIFuZeHPIhE6AIK5TVIA==", - "deprecated": "This package was renamed to @twurple/auth. Please check out the migration guide at https://twurple.js.org/docs/migration/", - "dependencies": { - "@d-fischer/deprecate": "^2.0.2", - "@d-fischer/logger": "^3.1.0", - "@d-fischer/shared-utils": "^3.0.1", - "tslib": "^2.0.3", - "twitch-api-call": "^4.6.7", - "twitch-common": "^4.6.7" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/twitch-common": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch-common/-/twitch-common-4.6.7.tgz", - "integrity": "sha512-Jwhp8bPnrzGjarPw/sA6jBLjjJnpNGptSJpZcKDzXXShFh2KxxRD7RwKPSLQS8st/SZ5iDwQs+jjSoWugOBJxg==", - "deprecated": "This package was renamed to @twurple/common. Please check out the migration guide at https://twurple.js.org/docs/migration/", - "dependencies": { - "@d-fischer/logger": "^3.1.0", - "@d-fischer/shared-utils": "^3.0.1", - "tslib": "^2.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -17718,23 +17714,6 @@ "to-fast-properties": "^2.0.0" } }, - "@d-fischer/cache-decorators": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@d-fischer/cache-decorators/-/cache-decorators-2.1.3.tgz", - "integrity": "sha512-MlM8ipg5Exkc0Ok//sG83smBW4mLRL+/ZngfxYQ8IgxBjfpM3m2M+Y2X+a9St3EyJfYoVKHR8RWdICsU+W3gSA==", - "requires": { - "@d-fischer/shared-utils": "^3.0.1", - "@types/node": "^14.14.22", - "tslib": "^2.1.0" - }, - "dependencies": { - "@types/node": { - "version": "14.17.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.15.tgz", - "integrity": "sha512-D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA==" - } - } - }, "@d-fischer/cross-fetch": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@d-fischer/cross-fetch/-/cross-fetch-4.1.0.tgz", @@ -17743,20 +17722,6 @@ "node-fetch": "2.6.7" } }, - "@d-fischer/deprecate": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@d-fischer/deprecate/-/deprecate-2.0.2.tgz", - "integrity": "sha512-wlw3HwEanJFJKctwLzhfOM6LKwR70FPfGZGoKOhWBKyOPXk+3a9Cc6S9zhm6tka7xKtpmfxVIReGUwPnMbIaZg==" - }, - "@d-fischer/logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-3.1.0.tgz", - "integrity": "sha512-kNg9PjmiyH9DMr70mAWU+i+dy3+e1hI0lR+No5RJduQtexI247NmEzNd0pethpwm+1uA0MRf3w9QnqZ1PHKvyA==", - "requires": { - "detect-node": "^2.0.4", - "tslib": "^2.0.3" - } - }, "@d-fischer/promise.allsettled": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@d-fischer/promise.allsettled/-/promise.allsettled-2.0.2.tgz", @@ -17775,34 +17740,6 @@ "resolved": "https://registry.npmjs.org/@d-fischer/qs/-/qs-7.0.2.tgz", "integrity": "sha512-yAu3xDooiL+ef84Jo8nLjDjWBRk7RXk163Y6aTvRB7FauYd3spQD/dWvgT7R4CrN54Juhrrc3dMY7mc+jZGurQ==" }, - "@d-fischer/rate-limiter": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/@d-fischer/rate-limiter/-/rate-limiter-0.4.5.tgz", - "integrity": "sha512-Q6TSDCbQcHShZAmX7UqG4ipPLjedAE2N5eV+30tr9c3QrejE5zTlNVY6CyX2bydXu+tVKmsajFix89ydpc9fWA==", - "requires": { - "@d-fischer/logger": "^4.0.0", - "@d-fischer/promise.allsettled": "^2.0.2", - "@types/node": "^12.12.5", - "tslib": "^2.0.3" - }, - "dependencies": { - "@d-fischer/logger": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.1.0.tgz", - "integrity": "sha512-e4NUW00Abq7QwWI2g0l4WdlDom5DWLRaU3fS/kNM69ylwq0G/pndX8bi06eBR5ytnI6/HhhdGpnvzgvv8RL6Ug==", - "requires": { - "@d-fischer/shared-utils": "^3.2.0", - "detect-node": "^2.0.4", - "tslib": "^2.0.3" - } - }, - "@types/node": { - "version": "12.20.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", - "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==" - } - } - }, "@d-fischer/shared-utils": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@d-fischer/shared-utils/-/shared-utils-3.2.0.tgz", @@ -19905,6 +19842,112 @@ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "optional": true }, + "@twurple/api": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/api/-/api-5.1.6.tgz", + "integrity": "sha512-je97EQQYKAFUL+wJbsqAvRUIcay6+6p9oeA/Fem6xMXMTdOcL80OfYgRhy/oKbh+JqQYwZRF2+a/dr8zVlt5Xg==", + "requires": { + "@d-fischer/cache-decorators": "^3.0.0", + "@d-fischer/logger": "^4.0.0", + "@d-fischer/rate-limiter": "^0.5.0", + "@d-fischer/shared-utils": "^3.2.0", + "@twurple/api-call": "^5.1.6", + "@twurple/common": "^5.1.6", + "tslib": "^2.0.3" + }, + "dependencies": { + "@d-fischer/cache-decorators": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@d-fischer/cache-decorators/-/cache-decorators-3.0.0.tgz", + "integrity": "sha512-mYUCjrp5hJgimceC5bof3zzmElyxzW4ty+73IjY12wvxLAqsq0CbgLGspnJm6KgwEfGoeRnISZD4EXJidG3FvA==", + "requires": { + "@d-fischer/shared-utils": "^3.0.1", + "@types/node": "^14.14.22", + "tslib": "^2.1.0" + } + }, + "@d-fischer/logger": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.2.0.tgz", + "integrity": "sha512-Hgm/GfeZfv2UPcRY4uF4S7OtCCv6Xxx++q7FAXc1qMrInaowKrmpo6YdFwRfZ8z53gzXFhc6H8j1Ttm0046uTw==", + "requires": { + "@d-fischer/shared-utils": "^3.2.0", + "detect-node": "^2.0.4", + "tslib": "^2.0.3" + } + }, + "@d-fischer/rate-limiter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@d-fischer/rate-limiter/-/rate-limiter-0.5.0.tgz", + "integrity": "sha512-bYxZ//vhtRSHx/K7vpcLxglCA80FGRAuRbNI//HsJmJcJ6abCO7ed/JlSJT9t4exRUPanM8igvEFEkffA4P4ug==", + "requires": { + "@d-fischer/logger": "^4.0.0", + "@d-fischer/promise.allsettled": "^2.0.2", + "@d-fischer/shared-utils": "^3.2.0", + "@types/node": "^12.12.5", + "tslib": "^2.0.3" + }, + "dependencies": { + "@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + } + } + }, + "@types/node": { + "version": "14.18.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.21.tgz", + "integrity": "sha512-x5W9s+8P4XteaxT/jKF0PSb7XEvo5VmqEWgsMlyeY4ZlLK8I6aH6g5TPPyDlLAep+GYf4kefb7HFyc7PAO3m+Q==" + } + } + }, + "@twurple/api-call": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/api-call/-/api-call-5.1.6.tgz", + "integrity": "sha512-8bUKcXBsvPMhifrhXQt9g/kf1XFXsvrTV+d6UryFB1RL8L/vDyI3FbCX4hZSJaXGK14zVL+obAngqcXn3ex4cw==", + "requires": { + "@d-fischer/cross-fetch": "^4.0.2", + "@d-fischer/qs": "^7.0.2", + "@twurple/common": "^5.1.6", + "@types/node-fetch": "^2.5.7", + "tslib": "^2.0.3" + } + }, + "@twurple/auth": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/auth/-/auth-5.1.6.tgz", + "integrity": "sha512-XnhNaJWEifr2aL1vvshhXj7v3yck38IJSVu7lzZ8csUFAzi7xphLit3LHlFGrrVYPkGQeNUx6crj0cDEUv7mtg==", + "requires": { + "@d-fischer/logger": "^4.0.0", + "@d-fischer/shared-utils": "^3.2.0", + "@twurple/api-call": "^5.1.6", + "@twurple/common": "^5.1.6", + "tslib": "^2.0.3" + }, + "dependencies": { + "@d-fischer/logger": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@d-fischer/logger/-/logger-4.2.0.tgz", + "integrity": "sha512-Hgm/GfeZfv2UPcRY4uF4S7OtCCv6Xxx++q7FAXc1qMrInaowKrmpo6YdFwRfZ8z53gzXFhc6H8j1Ttm0046uTw==", + "requires": { + "@d-fischer/shared-utils": "^3.2.0", + "detect-node": "^2.0.4", + "tslib": "^2.0.3" + } + } + } + }, + "@twurple/common": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@twurple/common/-/common-5.1.6.tgz", + "integrity": "sha512-mFDcCDbqx8MWmxGQmn0kSV7nEqTDjF7CLimRm34MMPl5gskp+isbKVdkXBy68VftQvtz92U/HRF25eTdOpDyEw==", + "requires": { + "@d-fischer/shared-utils": "^3.2.0", + "klona": "^2.0.4", + "tslib": "^2.0.3" + } + }, "@types/asn1js": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-2.0.2.tgz", @@ -24547,6 +24590,11 @@ "optional": true, "peer": true }, + "klona": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz", + "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==" + }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -28171,11 +28219,6 @@ "optional": true, "peer": true }, - "top-package": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/top-package/-/top-package-1.0.1.tgz", - "integrity": "sha512-tsuhQlHSigOTTvonxHXwqSKEVSnWMh2GvpTvXa5YmoyOwL5YvU4lTd/KNVZlKM5v7gqx44UEuQxyPQEpmaIHdg==" - }, "toposort-class": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", @@ -28210,59 +28253,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, - "twitch": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch/-/twitch-4.6.7.tgz", - "integrity": "sha512-inOFFLFhTcls/sskGcQWIfPgvhAF92fDo3uoGHdk0YRzo87NUHprvPE/LJJKh2IsysOPCmA1/mpnjReAgr5opA==", - "requires": { - "@d-fischer/cache-decorators": "^2.1.1", - "@d-fischer/deprecate": "^2.0.2", - "@d-fischer/logger": "^3.1.0", - "@d-fischer/rate-limiter": "^0.4.3", - "@d-fischer/shared-utils": "^3.0.1", - "top-package": "^1.0.0", - "tslib": "^2.0.3", - "twitch-api-call": "^4.6.7", - "twitch-auth": "^4.6.7", - "twitch-common": "^4.6.7" - } - }, - "twitch-api-call": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch-api-call/-/twitch-api-call-4.6.7.tgz", - "integrity": "sha512-JPiboygoHX3O2jdeWrmwW+VxpJbBYQJRg6+Th9GmqrsHivFFiyjBQproSMVJEgtrViGV1gHw6xlw1wHpoSU4Mw==", - "requires": { - "@d-fischer/cross-fetch": "^4.0.2", - "@d-fischer/qs": "^7.0.2", - "@types/node-fetch": "^2.5.7", - "node-fetch": "^2.6.1", - "tslib": "^2.0.3", - "twitch-common": "^4.6.7" - } - }, - "twitch-auth": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch-auth/-/twitch-auth-4.6.7.tgz", - "integrity": "sha512-9AkenhrZfXVdL1P2hJ7rLFKWOOGnkgf5isTJbjGD/GP2NYFYS+Oh8TYp8uyjW3/jQODIFuZeHPIhE6AIK5TVIA==", - "requires": { - "@d-fischer/deprecate": "^2.0.2", - "@d-fischer/logger": "^3.1.0", - "@d-fischer/shared-utils": "^3.0.1", - "tslib": "^2.0.3", - "twitch-api-call": "^4.6.7", - "twitch-common": "^4.6.7" - } - }, - "twitch-common": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/twitch-common/-/twitch-common-4.6.7.tgz", - "integrity": "sha512-Jwhp8bPnrzGjarPw/sA6jBLjjJnpNGptSJpZcKDzXXShFh2KxxRD7RwKPSLQS8st/SZ5iDwQs+jjSoWugOBJxg==", - "requires": { - "@d-fischer/logger": "^3.1.0", - "@d-fischer/shared-utils": "^3.0.1", - "tslib": "^2.0.3" - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 0e5172a4..4e7e4a1c 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "@androz2091/discord-invites-tracker": "1.1.0", "@pixelfactory/privatebin": "2.6.1", "@scnetwork/api": "1.0.1", + "@twurple/api": "^5.1.6", + "@twurple/auth": "^5.1.6", "age-calculator": "1.0.0", "bs58": "4.0.1", "bufferutil": "4.0.6", @@ -38,12 +40,10 @@ "parse-duration": "1.0.2", "sequelize": "6.20.1", "sqlite3": "5.0.8", - "twitch": "4.6.7", - "twitch-auth": "4.6.7", "utf-8-validate": "5.0.9", "zlib-sync": "0.1.7" }, "devDependencies": { "eslint": "^7.32.0" } -} \ No newline at end of file +} From 4a8f6fba37ef8fbc6c39d088eb5d2b946fa5f8e6 Mon Sep 17 00:00:00 2001 From: Ole Date: Mon, 20 Jun 2022 18:20:23 +0200 Subject: [PATCH 3/5] Update package.json Co-authored-by: Simon --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4e7e4a1c..7e7d1d55 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "@androz2091/discord-invites-tracker": "1.1.0", "@pixelfactory/privatebin": "2.6.1", "@scnetwork/api": "1.0.1", - "@twurple/api": "^5.1.6", - "@twurple/auth": "^5.1.6", + "@twurple/api": "5.1.6", + "@twurple/auth": "5.1.6", "age-calculator": "1.0.0", "bs58": "4.0.1", "bufferutil": "4.0.6", From 3163ebba8364647de1e982b6f4c62b615761c5b4 Mon Sep 17 00:00:00 2001 From: jateute Date: Sun, 26 Jun 2022 19:28:30 +0200 Subject: [PATCH 4/5] Update: Added a Variable for the title --- modules/twitch-notifications/configs/streamers.json | 8 ++++++++ modules/twitch-notifications/events/botReady.js | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/modules/twitch-notifications/configs/streamers.json b/modules/twitch-notifications/configs/streamers.json index 8096525f..8da4c8bb 100644 --- a/modules/twitch-notifications/configs/streamers.json +++ b/modules/twitch-notifications/configs/streamers.json @@ -26,6 +26,10 @@ { "name": "%url%", "description": "Link to the stream" + }, + { + "name": "%title%", + "description": "Title of the Stream" } ], "params-de": [ @@ -40,6 +44,10 @@ { "name": "%url%", "description": "Link zum Twitch-Stream" + }, + { + "name": "%title%", + "description": "Titel des Streams" } ] }, diff --git a/modules/twitch-notifications/events/botReady.js b/modules/twitch-notifications/events/botReady.js index a6967f69..84c9a194 100644 --- a/modules/twitch-notifications/events/botReady.js +++ b/modules/twitch-notifications/events/botReady.js @@ -10,7 +10,7 @@ const {localize} = require('../../../src/functions/localize'); /** * General program * @param {Client} client Discord js Client - * @param {object} apiClient Twitch API Client + * @param {ApiClient} apiClient Twitch API Client * @private */ function twitchNotifications(client, apiClient) { @@ -26,7 +26,7 @@ function twitchNotifications(client, apiClient) { * @returns {*} * @private */ - function sendMsg(username, game, thumbnailUrl, channelID, i) { + function sendMsg(username, game, thumbnailUrl, channelID, title, i) { const channel = client.channels.cache.get(channelID); if (!channel) return client.logger.fatal(`[twitch-notifications] ` + localize('twitch-notifications', 'channel-not-found', {c: channelID})); if (!streamers[i]['liveMessage']) return client.logger.fatal(`[twitch-notifications] ` + localize('twitch-notifications', 'message-not-found', {s: username})); @@ -34,14 +34,15 @@ function twitchNotifications(client, apiClient) { '%streamer%': username, '%game%': game, '%url%': `https://twitch.tv/${username.toLowerCase()}`, - '%thumbnailUrl': thumbnailUrl + '%thumbnailUrl': thumbnailUrl, + '%title%': title })); } /** * Checks if the streamer is live * @param {string} userName Name of the Streamer - * @returns {object} + * @returns {HelixStream} * @private */ async function isStreamLive(userName) { @@ -73,11 +74,11 @@ function twitchNotifications(client, apiClient) { name: value.streamer.toLowerCase(), startedAt: stream.startDate.toString() }); - sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, streamers[index]['liveMessageChannel'], index); + sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, streamers[index]['liveMessageChannel'], stream.title, index); } else if (stream !== null && stream.startDate.toString() !== streamer.startedAt) { streamer.startedAt = stream.startDate.toString(); streamer.save(); - sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, streamers[index]['liveMessageChannel'], index); + sendMsg(stream.userDisplayName, stream.gameName, stream.thumbnailUrl, streamers[index]['liveMessageChannel'], stream.title, index); } } } From e22ffdb7e5fdd2d98d54fd0e08f2d13849b8fa56 Mon Sep 17 00:00:00 2001 From: jateute Date: Sun, 26 Jun 2022 21:32:46 +0200 Subject: [PATCH 5/5] Updated the %thumbnailUrl% param --- modules/twitch-notifications/configs/streamers.json | 8 ++++++++ modules/twitch-notifications/events/botReady.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/twitch-notifications/configs/streamers.json b/modules/twitch-notifications/configs/streamers.json index 8da4c8bb..c9197d88 100644 --- a/modules/twitch-notifications/configs/streamers.json +++ b/modules/twitch-notifications/configs/streamers.json @@ -30,6 +30,10 @@ { "name": "%title%", "description": "Title of the Stream" + }, + { + "name": "%thumbnailUrl%", + "description": "The Link to the thumbnail of the Stream" } ], "params-de": [ @@ -48,6 +52,10 @@ { "name": "%title%", "description": "Titel des Streams" + }, + { + "name": "%thumbnailUrl%", + "description": "Link zum Thumbnail des Streams" } ] }, diff --git a/modules/twitch-notifications/events/botReady.js b/modules/twitch-notifications/events/botReady.js index 84c9a194..a04c75ef 100644 --- a/modules/twitch-notifications/events/botReady.js +++ b/modules/twitch-notifications/events/botReady.js @@ -34,7 +34,7 @@ function twitchNotifications(client, apiClient) { '%streamer%': username, '%game%': game, '%url%': `https://twitch.tv/${username.toLowerCase()}`, - '%thumbnailUrl': thumbnailUrl, + '%thumbnailUrl%': thumbnailUrl, '%title%': title })); }