From cd9d5248acae76a48930d77842cf7845fb1fbe0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81vila?= Date: Wed, 15 Sep 2021 23:12:48 +0100 Subject: Join the message sender's channel if possible --- src/commands/play.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/commands') 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 { - const [targetVoiceChannel] = getMostPopularVoiceChannel(msg.guild!); + public async execute(msg: Message, args: string[]): Promise { + const [targetVoiceChannel] = getMemberVoiceChannel(msg.member!) ?? getMostPopularVoiceChannel(msg.guild!); const res = new LoadingMessage(msg.channel as TextChannel); await res.start(); -- cgit v1.2.3