mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 08:20:58 -05:00
Buhbye tokens.json
!
This commit is contained in:
parent
4cd3b6729a
commit
b5caf8125a
@ -1,18 +1,15 @@
|
||||
import Discord from 'discord.js';
|
||||
import TClient from '../client.js';
|
||||
import TSClient from '../helpers/TSClient.js';
|
||||
import {Player,useTimeline,useQueue} from 'discord-player';
|
||||
import {SpotifyExtractor} from '@discord-player/extractor';
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {Tokens} from 'src/typings/interfaces';
|
||||
const token:Tokens = JSON.parse(readFileSync('src/tokens.json', 'utf8'));
|
||||
// TODO: Fix above.
|
||||
|
||||
export default {
|
||||
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
||||
if (!client.config.botSwitches.music && !client.config.whitelist.includes(interaction.user.id)) return interaction.reply({content:'Music module is currently disabled.',ephemeral:true});
|
||||
if (!client.isStaff(interaction.member) && !client.config.whitelist.includes(interaction.member.id)) return interaction.reply('Music module is close to being completed, some parts may be incomplete or broken, so it has been restricted to staff for time-being.');
|
||||
const player = Player.singleton(client);
|
||||
await player.extractors.register(SpotifyExtractor,{clientId: token.spotify.client, clientSecret: token.spotify.secret});
|
||||
await player.extractors.register(SpotifyExtractor,{clientId: (await TSClient.Token()).spotify.client, clientSecret: (await TSClient.Token()).spotify.secret});
|
||||
if (!interaction.member.voice.channel) return interaction.reply('Please join a voice channel first to use the command.');
|
||||
player.nodes.create(interaction.guildId, {
|
||||
metadata: {
|
||||
|
6
src/typings/interfaces.d.ts
vendored
6
src/typings/interfaces.d.ts
vendored
@ -111,12 +111,6 @@ export interface FSCareerSavegame {
|
||||
interface XMLText {
|
||||
_text: string
|
||||
}
|
||||
export interface Tokens {
|
||||
spotify: {
|
||||
client: string,
|
||||
secret: string
|
||||
}
|
||||
}
|
||||
export interface Config {
|
||||
embedColor: Discord.ColorResolvable,
|
||||
embedColorGreen: Discord.ColorResolvable,
|
||||
|
Loading…
Reference in New Issue
Block a user