aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorLuis Ávila <[email protected]>2021-09-15 23:12:48 +0100
committerLuis Ávila <[email protected]>2021-09-15 23:12:48 +0100
commitcd9d5248acae76a48930d77842cf7845fb1fbe0e (patch)
treea7a033c54a28084b6d07bb269bd561d0e43e637a /src/commands
parentc97206bb8b691c5b43932fa9a4f575d57914d731 (diff)
downloadmuse-cd9d5248acae76a48930d77842cf7845fb1fbe0e.tar.xz
muse-cd9d5248acae76a48930d77842cf7845fb1fbe0e.zip
Join the message sender's channel if possible
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/play.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/commands/play.ts b/src/commands/play.ts
index c301fe9..a67b318 100644
--- a/src/commands/play.ts
+++ b/src/commands/play.ts
@@ -4,7 +4,7 @@ import {TYPES} from '../types';
import {inject, injectable} from 'inversify';
import {QueuedSong, STATUS} from '../services/player';
import PlayerManager from '../managers/player';
-import {getMostPopularVoiceChannel} from '../utils/channels';
+import {getMostPopularVoiceChannel, getMemberVoiceChannel} from '../utils/channels';
import LoadingMessage from '../utils/loading-message';
import errorMsg from '../utils/error-msg';
import Command from '.';
@@ -36,8 +36,8 @@ export default class implements Command {
this.getSongs = getSongs;
}
- public async execute(msg: Message, args: string []): Promise<void> {
- const [targetVoiceChannel] = getMostPopularVoiceChannel(msg.guild!);
+ public async execute(msg: Message, args: string[]): Promise<void> {
+ const [targetVoiceChannel] = getMemberVoiceChannel(msg.member!) ?? getMostPopularVoiceChannel(msg.guild!);
const res = new LoadingMessage(msg.channel as TextChannel);
await res.start();