Merge pull request 'Fix logs debug twitch' (#16) from develop into master

Reviewed-on: #16
This commit is contained in:
2025-08-19 22:51:07 +02:00
5 changed files with 8 additions and 12 deletions

View File

@@ -2,13 +2,8 @@ name: Build and Push Docker Image
on:
push:
branches:
- master
tags:
- 'build_*'
pull_request:
branches:
- master
env:
REGISTRY: rgy.angels-dev.fr

View File

@@ -3,7 +3,7 @@ deployment:
strategy: RollingUpdate
image:
repository: "rgy.angels-dev.fr/prod/bot_tamiseur"
tag: "build_2025-06-10_01h49"
tag: "build_2025-08-19_22h46"
pullPolicy: IfNotPresent
env:
NODE_ENV: "production"

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bot_tamiseur",
"version": "4.0.0",
"version": "4.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bot_tamiseur",
"version": "4.0.0",
"version": "4.0.1",
"dependencies": {
"@discord-player/extractor": "^7.1.0",
"@discordjs/voice": "^0.18.0",

View File

@@ -1,7 +1,7 @@
{
"name": "bot_tamiseur",
"description": "Listen to music and use fun commands with your friends!",
"version": "4.0.0",
"version": "4.0.1",
"author": {
"name": "Zachary Guénot"
},

View File

@@ -27,7 +27,6 @@ export async function execute(client: Client) {
const mongo_url = `mongodb://${process.env.MONGOOSE_USER}:${process.env.MONGOOSE_PASSWORD}@${process.env.MONGOOSE_HOST}/${process.env.MONGOOSE_DATABASE}`
await connect(mongo_url).catch(console.error)
if (process.env.NODE_ENV === "development") await twitchClient.eventSub.deleteAllSubscriptions()
const streamerIds: string[] = []
await Promise.all(client.guilds.cache.map(async guild => {
@@ -71,6 +70,10 @@ export async function execute(client: Client) {
if (!user) { logConsole('twitch', 'ready.user_not_found', { guild: guild.name, userId: streamer.twitchUserId }); return }
const userSubs = await twitchClient.eventSub.getSubscriptionsForUser(streamer.twitchUserId)
if (process.env.NODE_ENV === "development") {
console.log(userSubs)
userSubs.data.forEach(sub => { console.log(sub) })
}
if (!userSubs.data.find(sub => sub.transportMethod === "webhook" && sub.type === "stream.online")) {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
listener.onStreamOnline(streamer.twitchUserId, onlineSub)
@@ -106,8 +109,6 @@ export async function execute(client: Client) {
logConsole('twitch', 'ready.stream_offline_cleanup', { guild: guild.name, userName: user.name })
await cleanupMessageId(guildProfile, streamer.twitchUserId)
}
logConsole('twitch', 'user_operational', { name: user.name, id: streamer.twitchUserId })
}))
}))