Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c9d68fa485 | |||
| 1d90756f11 | |||
| a53d523dfd | |||
| 045abf81e2 | |||
| 8a9b998946 | |||
| 85012cfbca | |||
| 85c6423704 | |||
| ed4d3f032d | |||
| bff60e7514 | |||
| 560699c81d | |||
| 1926a6deb5 | |||
| 87272f4b45 | |||
|
18a293690e
|
|||
| fb7ba5d145 | |||
|
f94a3852e8
|
|||
| 462ad2e9d6 | |||
| f1b5592045 | |||
| af4e6e2e69 | |||
|
6d0c0145ee
|
|||
| f1a488d362 |
@@ -2,13 +2,8 @@ name: Build and Push Docker Image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
tags:
|
||||||
- 'build_*'
|
- 'build_*'
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: rgy.angels-dev.fr
|
REGISTRY: rgy.angels-dev.fr
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ name: bot_tamiseur
|
|||||||
|
|
||||||
# Version du chart : doit changer si l'application change ou si la configuration du chart change
|
# Version du chart : doit changer si l'application change ou si la configuration du chart change
|
||||||
#version: 1
|
#version: 1
|
||||||
version: "1"
|
version: "1.1.0"
|
||||||
|
|
||||||
# icon (optionnel) mais génère un warning avec "helm lint"
|
# icon (optionnel) mais génère un warning avec "helm lint"
|
||||||
icon: https://helm.sh/img/helm-logo.svg
|
icon: https://helm.sh/img/helm-logo.svg
|
||||||
@@ -1,32 +1,48 @@
|
|||||||
{{- if .Values.ingress.enabled }}
|
{{- $ingress := .Values.ingress -}}
|
||||||
|
{{- if $ingress.enabled -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}
|
name: {{ $.Release.Name }}
|
||||||
|
{{- with $ingress.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
external-dns.alpha.kubernetes.io/target: omegamaestro.{{ .Values.ingress.domain }}
|
{{- range $key, $value := . }}
|
||||||
cert-manager.io/cluster-issuer: {{ .Values.ingress.issuer }}
|
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
|
||||||
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
|
{{- end }}
|
||||||
{{- if .Values.ingress.geoip }}
|
{{- end }}
|
||||||
nginx.ingress.kubernetes.io/server-snippet: |
|
labels:
|
||||||
if ($lan = yes) { set $allowed_country yes; }
|
{{- range $key, $value := $ingress.labels }}
|
||||||
if ($allowed_country = no) { return 451; }
|
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: {{ .Values.ingress.class }}
|
{{- if $ingress.ingressClassName }}
|
||||||
|
ingressClassName: {{ $ingress.ingressClassName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
{{- range $ingress.tls }}
|
||||||
- {{ .Values.ingress.subdomain }}.{{ .Values.ingress.domain }}
|
- hosts:
|
||||||
secretName: {{ .Release.Name }}-tls
|
{{- range .hosts }}
|
||||||
|
- {{ tpl . $ | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .secretName }}
|
||||||
|
secretName: {{ tpl . $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
- host: "{{ .Values.ingress.subdomain }}.{{ .Values.ingress.domain }}"
|
{{- range $ingress.rules }}
|
||||||
http:
|
- host: {{ tpl .host $ | quote }}
|
||||||
paths:
|
http:
|
||||||
- path: /
|
paths:
|
||||||
pathType: Prefix
|
{{- range .paths }}
|
||||||
backend:
|
- path: {{ tpl .path $ | quote }}
|
||||||
service:
|
pathType: {{ .pathType }}
|
||||||
name: "{{ .Release.Name }}-{{ .Values.service.name }}"
|
backend:
|
||||||
port:
|
service:
|
||||||
name: {{ .Values.service.name }}
|
name: "{{ $.Release.Name }}-{{ $.Values.service.name }}"
|
||||||
{{- end }}
|
port:
|
||||||
|
name: {{ $.Values.service.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|||||||
+23
-7
@@ -3,7 +3,7 @@ deployment:
|
|||||||
strategy: RollingUpdate
|
strategy: RollingUpdate
|
||||||
image:
|
image:
|
||||||
repository: "rgy.angels-dev.fr/prod/bot_tamiseur"
|
repository: "rgy.angels-dev.fr/prod/bot_tamiseur"
|
||||||
tag: "build_2025-06-10_01h49"
|
tag: "build_2025-08-19_22h46"
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
NODE_ENV: "production"
|
NODE_ENV: "production"
|
||||||
@@ -23,9 +23,25 @@ service:
|
|||||||
name: twurple
|
name: twurple
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
# If `true`, an Ingress is created
|
||||||
class: nginx
|
enabled: false
|
||||||
subdomain: dcb-chantier.prd
|
# The name of the Ingress Class associated with this ingress
|
||||||
domain: angels-dev.fr
|
ingressClassName: ""
|
||||||
issuer: letsencrypt-prod
|
# Ingress annotations
|
||||||
geoip: false
|
annotations: {}
|
||||||
|
# Additional Ingress labels
|
||||||
|
labels: {}
|
||||||
|
# List of rules for the Ingress
|
||||||
|
rules:
|
||||||
|
-
|
||||||
|
# Ingress host
|
||||||
|
host: discord.example.com
|
||||||
|
# Paths for the host
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
# TLS configuration
|
||||||
|
tls: []
|
||||||
|
# - hosts:
|
||||||
|
# - discord.example.com
|
||||||
|
# secretName: ""
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "bot_tamiseur",
|
"name": "bot_tamiseur",
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bot_tamiseur",
|
"name": "bot_tamiseur",
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discord-player/extractor": "^7.1.0",
|
"@discord-player/extractor": "^7.1.0",
|
||||||
"@discordjs/voice": "^0.18.0",
|
"@discordjs/voice": "^0.18.0",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "bot_tamiseur",
|
"name": "bot_tamiseur",
|
||||||
"description": "Listen to music and use fun commands with your friends!",
|
"description": "Listen to music and use fun commands with your friends!",
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Zachary Guénot"
|
"name": "Zachary Guénot"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export async function execute(interaction: ChatInputCommandInteraction) {
|
|||||||
const result = await player.search(query, { requestedBy: interaction.user })
|
const result = await player.search(query, { requestedBy: interaction.user })
|
||||||
if (!result.hasTracks()) return interaction.followUp({ content: t(interaction.locale, "player.no_track_found", { query }), flags: MessageFlags.Ephemeral })
|
if (!result.hasTracks()) return interaction.followUp({ content: t(interaction.locale, "player.no_track_found", { query }), flags: MessageFlags.Ephemeral })
|
||||||
const track = result.tracks[0]
|
const track = result.tracks[0]
|
||||||
|
if (process.env.NODE_ENV === "development") console.log(query, result, track)
|
||||||
|
|
||||||
const entry = queue.tasksQueue.acquire()
|
const entry = queue.tasksQueue.acquire()
|
||||||
await entry.getTask()
|
await entry.getTask()
|
||||||
@@ -106,6 +107,7 @@ export async function autocompleteRun(interaction: AutocompleteInteraction) {
|
|||||||
|
|
||||||
const resultsSpotify = await player.search(query, { searchEngine: `ext:${SpotifyExtractor.identifier}` })
|
const resultsSpotify = await player.search(query, { searchEngine: `ext:${SpotifyExtractor.identifier}` })
|
||||||
const resultsYouTube = await player.search(query, { searchEngine: `ext:${YoutubeiExtractor.identifier}` })
|
const resultsYouTube = await player.search(query, { searchEngine: `ext:${YoutubeiExtractor.identifier}` })
|
||||||
|
if (process.env.NODE_ENV === "development") console.log(resultsSpotify, resultsYouTube)
|
||||||
|
|
||||||
const tracksSpotify = resultsSpotify.tracks.slice(0, 5).map(t => ({
|
const tracksSpotify = resultsSpotify.tracks.slice(0, 5).map(t => ({
|
||||||
name: `Spotify: ${`${t.title} - ${t.author} (${t.duration})`.length > 75 ? `${`${t.title} - ${t.author}`.substring(0, 75)}... (${t.duration})` : `${t.title} - ${t.author} (${t.duration})`}`,
|
name: `Spotify: ${`${t.title} - ${t.author} (${t.duration})`.length > 75 ? `${`${t.title} - ${t.author}`.substring(0, 75)}... (${t.duration})` : `${t.title} - ${t.author} (${t.duration})`}`,
|
||||||
|
|||||||
@@ -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}`
|
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)
|
await connect(mongo_url).catch(console.error)
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "development") await twitchClient.eventSub.deleteAllSubscriptions()
|
|
||||||
const streamerIds: string[] = []
|
const streamerIds: string[] = []
|
||||||
|
|
||||||
await Promise.all(client.guilds.cache.map(async guild => {
|
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 }
|
if (!user) { logConsole('twitch', 'ready.user_not_found', { guild: guild.name, userId: streamer.twitchUserId }); return }
|
||||||
|
|
||||||
const userSubs = await twitchClient.eventSub.getSubscriptionsForUser(streamer.twitchUserId)
|
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")) {
|
if (!userSubs.data.find(sub => sub.transportMethod === "webhook" && sub.type === "stream.online")) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
listener.onStreamOnline(streamer.twitchUserId, onlineSub)
|
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 })
|
logConsole('twitch', 'ready.stream_offline_cleanup', { guild: guild.name, userName: user.name })
|
||||||
await cleanupMessageId(guildProfile, streamer.twitchUserId)
|
await cleanupMessageId(guildProfile, streamer.twitchUserId)
|
||||||
}
|
}
|
||||||
|
|
||||||
logConsole('twitch', 'user_operational', { name: user.name, id: streamer.twitchUserId })
|
|
||||||
}))
|
}))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user