mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-11 12:21:37 +02:00
Join the message sender's channel if possible
This commit is contained in:
parent
c97206bb8b
commit
cd9d5248ac
3 changed files with 23 additions and 11 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue