Ajout RSS + Tentative fix lecture de musique HS
This commit is contained in:
+38
-29
@@ -1,30 +1,39 @@
|
||||
import { Events, Client, ActivityType } from 'discord.js'
|
||||
import { useMainPlayer } from 'discord-player'
|
||||
import replay from '../utilsPlayer/replay'
|
||||
import disco from '../utilsPlayer/disco'
|
||||
import 'dotenv/config'
|
||||
|
||||
declare module "discord.js" {
|
||||
export interface Client {
|
||||
disco: { interval: NodeJS.Timeout }
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
once: true,
|
||||
async execute(client: Client) {
|
||||
console.log(`Ready! Logged in as ${client.user?.tag ?? 'unknown'}`)
|
||||
client.user?.setActivity('some bangers...', { type: ActivityType.Listening })
|
||||
|
||||
await useMainPlayer().extractors.loadDefault(ext => ext === 'YouTubeExtractor' || ext === 'SpotifyExtractor').then(() => console.log('YouTube and Spotify extractors loaded.')).catch(console.error)
|
||||
|
||||
if (process.env.DISCORD_MUSIC_CURRENT_TRACK) await replay(client)
|
||||
|
||||
client.disco = { interval: {} as NodeJS.Timeout }
|
||||
client.disco.interval = setInterval(async () => {
|
||||
let state = await disco(client)
|
||||
if (state === 'clear') clearInterval(client.disco.interval)
|
||||
}, 2000)
|
||||
}
|
||||
import { Events, Client, ActivityType } from 'discord.js'
|
||||
import { useMainPlayer } from 'discord-player'
|
||||
import replay from '../utilsPlayer/replay'
|
||||
import disco from '../utilsPlayer/disco'
|
||||
import rss from '../utils/rss'
|
||||
import 'dotenv/config'
|
||||
|
||||
declare module "discord.js" {
|
||||
export interface Client {
|
||||
disco: { interval: NodeJS.Timeout },
|
||||
rss: { interval: NodeJS.Timeout }
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
once: true,
|
||||
async execute(client: Client) {
|
||||
console.log(`Ready! Logged in as ${client.user?.tag ?? 'unknown'}`)
|
||||
client.user?.setActivity('some bangers...', { type: ActivityType.Listening })
|
||||
|
||||
await useMainPlayer().extractors.loadDefault(ext => ext === 'YouTubeExtractor' || ext === 'SpotifyExtractor').then(() => console.log('YouTube and Spotify extractors loaded.')).catch(console.error)
|
||||
|
||||
//if (process.env.DISCORD_MUSIC_CURRENT_TRACK) await replay(client)
|
||||
|
||||
client.disco = { interval: {} as NodeJS.Timeout }
|
||||
client.disco.interval = setInterval(async () => {
|
||||
let state = await disco(client)
|
||||
if (state === 'clear') clearInterval(client.disco.interval)
|
||||
}, 2000)
|
||||
|
||||
client.rss = { interval: {} as NodeJS.Timeout }
|
||||
client.rss.interval = setInterval(async () => {
|
||||
let state = await rss(client)
|
||||
if (state === 'clear') clearInterval(client.rss.interval)
|
||||
}, 30000)
|
||||
rss(client)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user