-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features: Shuffle command, auto leave voice channel, bot status command. Fix: Play command #335
Conversation
)) as VoiceChannel; | ||
// this.logger.log(voiceChannel?.name); | ||
if (!voiceChannel) return; | ||
const members = voiceChannel.members.filter((s) => !s.user?.bot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename s
const voiceChannel = (await mem.guild.channels.fetch( | ||
this.voiceChannelId, | ||
)) as VoiceChannel; | ||
// this.logger.log(voiceChannel?.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented out code or decrease log level
this.voiceConnection?.on(VoiceConnectionStatus.Disconnected, () => { | ||
if (this.voiceConnection !== undefined) { | ||
this.playbackService.getPlaylistOrDefault().clear(); | ||
this.disconnect(); | ||
} | ||
}); | ||
|
||
const mem = member; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
|
||
const mem = member; | ||
setTimeout(() => { | ||
// leaving channel cuz no listener left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// leaving channel cuz no listener left | |
// leaving channel because no listener is left |
// this.logger.log(voiceChannel?.name); | ||
if (!voiceChannel) return; | ||
const members = voiceChannel.members.filter((s) => !s.user?.bot); | ||
// this.logger.log(members.size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented out code or decrease log level
dmPermission: false, | ||
}) | ||
@Injectable() | ||
export class BotStatusCommand { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question, we don't want to persist the state anywhere?
And we also don't want to set the current song as the status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the constantly updating bot status a bit annoying, maybe the current song as status can be an option? Either way it should definitely be persistent.
// bot status command params | ||
// /bot-status [activity like playing, watching..] [indicator eg online, dnd..] [text] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a valid JsDoc comment, fix or remove
export enum ClientPresenceStatus { | ||
Online = 'online', | ||
Idle = 'idle', | ||
DoNotDisturb = 'dnd', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use abbreviations, use doNotDisturb
as the enum value
await interaction.reply({ | ||
embeds: [ | ||
this.discordMessageService.buildErrorMessage({ | ||
title: 'tracks length is less than 2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sentence start should be uppercase
/** | ||
** shuffle tracks | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless comment, document what this function actually does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Randomize the order of tracks in the current playlist"
For future reference, never push multiple features into the same branch or pull request. See https://dev.to/amalv/a-cleaner-github-workflow-one-commit-per-pull-pequest-3ic1 , https://jun-sheng.medium.com/linear-git-history-part-i-b97184dde252, https://stackoverflow.com/questions/20348629/what-are-the-advantages-of-keeping-linear-history-in-git for reference. |
#319
#307