Skip to content

Commit

Permalink
remove logs and add missing music connect
Browse files Browse the repository at this point in the history
  • Loading branch information
galnir committed Jul 24, 2023
1 parent 382c508 commit 0d37e90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 0 additions & 3 deletions apps/bot/src/commands/music/play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export class PlayCommand extends Command {
const isCustomPlaylist =
interaction.options.getString('is-custom-playlist');

console.log('isCustomPlaylist', isCustomPlaylist);

const shufflePlaylist = interaction.options.getString('shuffle-playlist');

const interactionMember = interaction.member?.user;
Expand Down Expand Up @@ -131,7 +129,6 @@ export class PlayCommand extends Command {
message = `Added songs from **${playlist}** to the queue!`;
} else {
const trackTuple = await searchSong(query, interaction.user);
console.log('trackTuple', trackTuple);
if (!trackTuple[1].length) {
return await interaction.followUp({ content: trackTuple[0] as string }); // error
}
Expand Down
8 changes: 7 additions & 1 deletion apps/bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ApplicationCommandRegistries,
RegisterBehavior
} from '@sapphire/framework';
import { ActivityType } from 'discord.js';

ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(
RegisterBehavior.Overwrite
Expand All @@ -23,7 +24,12 @@ if (env.SPOTIFY_CLIENT_ID && env.SPOTIFY_CLIENT_SECRET) {
const client = new ExtendedClient();

client.on('ready', () => {
console.log('Bot is ready!');
client.music.connect(client.user!.id);
client.user?.setActivity('/', {
type: ActivityType.Watching
});

client.user?.setStatus('online');
});

client.on('chatInputCommandError', err => {
Expand Down
4 changes: 0 additions & 4 deletions apps/bot/src/lib/music/classes/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,13 @@ export class Queue {

// Start the queue
public async start(replaying = false): Promise<boolean> {
console.log('here in queue start');
const np = await this.nowPlaying();
if (!np) return this.next();

try {
console.log('here in queue start try');
this.player.setVolume(await this.getVolume());
console.log('np.song', np.song);
await this.player.play(np.song as Song);
} catch (err) {
console.log('here in queue start catch');
console.log(err);
// Logger.error(err);
await this.leave();
Expand Down

0 comments on commit 0d37e90

Please sign in to comment.