Remove custom getter

This commit is contained in:
Thongrapee Panyapatiphan 2021-10-01 23:49:22 +07:00
parent 4364f459be
commit 847c578b5d
No known key found for this signature in database
GPG key ID: 4B08AEC7F50F1967

View file

@ -40,7 +40,8 @@ export default class implements Command {
public async execute(msg: Message, args: string[]): Promise<void> { public async execute(msg: Message, args: string[]): Promise<void> {
const [targetVoiceChannel] = getMemberVoiceChannel(msg.member!) ?? getMostPopularVoiceChannel(msg.guild!); const [targetVoiceChannel] = getMemberVoiceChannel(msg.member!) ?? getMostPopularVoiceChannel(msg.guild!);
const playlistLimit = await this.getPlaylistLimit(msg.guild!.id); const settings = await Settings.findByPk(msg.guild!.id);
const {playlistLimit} = settings!;
const res = new LoadingMessage(msg.channel as TextChannel); const res = new LoadingMessage(msg.channel as TextChannel);
await res.start(); await res.start();
@ -169,9 +170,4 @@ export default class implements Command {
await player.play(); await player.play();
} }
} }
private async getPlaylistLimit(guildId: string) {
const settings = await Settings.findByPk(guildId);
return settings?.playlistLimit ?? 50;
}
} }