From 45b19808e0ef82084686177fdcf7ee3a4d8494b0 Mon Sep 17 00:00:00 2001 From: adan-ea <57812567+adan-ea@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:19:49 +0100 Subject: [PATCH] feat(twitch): Add notification change [adroidea/bot#75] --- package-lock.json | 4 ++-- package.json | 6 ++++-- src/index.ts | 21 +++++++++++++++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c4f404..6fcbafc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "adroi.d.ea", - "version": "1.0.8", + "version": "1.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "adroi.d.ea", - "version": "1.0.8", + "version": "1.0.9", "license": "AGPL-3.0", "devDependencies": { "@types/jest": "^29.5.11", diff --git a/package.json b/package.json index 281bbf1..258dbcd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "adroi.d.ea", "description": "Types for the discord bot of the same name: Adroid_ea.", - "version": "1.0.8", + "version": "1.0.9", "author": "adan-ea", "license": "AGPL-3.0", "repository": { @@ -27,7 +27,9 @@ ], "scripts": { "build": "tsc", - "test": "jest --passWithNoTests" + "watch": "tsc -w", + "test": "jest --passWithNoTests", + "publish": "node .github/publish.js" }, "devDependencies": { "@types/jest": "^29.5.11", diff --git a/src/index.ts b/src/index.ts index b5d87cb..a461140 100644 --- a/src/index.ts +++ b/src/index.ts @@ -136,11 +136,18 @@ export interface ITMAlerts { streamerName: string; // The name of the streamer infoLiveChannel: string; // The channel where the bot will send the message when the streamer is live pingedRole: string; // The role that will be pinged when the streamer is live + notifyChange: boolean; // If the bot should notify when the streamer change their game + ignoredCategories: string[]; // The list of categories that the bot should ignore + message: { + // The messages that the bot will send + streamStart: string[]; + gameChange: string[]; + }; } export interface ITMAutoRoles { enabled: boolean; - streamingRoleId: string; // The role that will be given to the streamer when he is streaming + streamingRoleId: string; // The role that will be given to the streamer when they are streaming streamers: ITMStreamersData[]; // The list of streamers } @@ -249,7 +256,17 @@ export function createGuildObject(guild: any): IGuild { liveProfilePicture: '', streamerName: 'adan_ea', infoLiveChannel: '', - pingedRole: '' + pingedRole: '', + notifyChange: false, + ignoredCategories: [], + message: { + streamStart: [ + "{role}, **{streamer.name}** est en live ! C'est l'heure de laisser la réalité derrière toi et de plonger dans le monde de {game.name} !" + ], + gameChange: [ + 'Après avoir dit au revoir à {oldGame.name}. Le moment est venu de jouer à {newGame.name} ! Quelles aventures nous attendent cette fois-ci ?' + ] + } }, autoRoles: { enabled: false,