Skip to content

Commit

Permalink
Added auth token to youtube extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
Casca0 committed Jul 21, 2024
1 parent 5cb09f3 commit 739d033
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SpotifyExtractor } from '@discord-player/extractor';
import {
YoutubeiExtractor,
createYoutubeiStream,
generateOauthTokens,
} from 'discord-player-youtubei';
import { CommandKit } from 'commandkit';
import {
Expand All @@ -16,6 +17,8 @@ import { registerPlayerEvents } from '#bot/player/registerEvents';
import express from 'express';
import { connect } from 'mongoose';

const tokens = await generateOauthTokens();

const client = new Client({
intents: ['Guilds', 'GuildVoiceStates', 'GuildMembers', 'DirectMessages'],
partials: [Partials.GuildMember, Partials.User],
Expand All @@ -40,7 +43,9 @@ new CommandKit({

await registerPlayerEvents();

await player.extractors.register(YoutubeiExtractor, {});
await player.extractors.register(YoutubeiExtractor, {
authentication: tokens as unknown as string,
});

await player.extractors.register(SpotifyExtractor, {
clientId: process.env.SPOTIFY_CLIENT_ID,
Expand Down

0 comments on commit 739d033

Please sign in to comment.