From 847c578b5d097a4187d58485c1f4c759098c131a Mon Sep 17 00:00:00 2001 From: Thongrapee Panyapatiphan Date: Fri, 1 Oct 2021 23:49:22 +0700 Subject: [PATCH] Remove custom getter --- src/commands/play.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/commands/play.ts b/src/commands/play.ts index 8971cca..7f02d5e 100644 --- a/src/commands/play.ts +++ b/src/commands/play.ts @@ -40,7 +40,8 @@ export default class implements Command { public async execute(msg: Message, args: string[]): Promise { 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); await res.start(); @@ -169,9 +170,4 @@ export default class implements Command { await player.play(); } } - - private async getPlaylistLimit(guildId: string) { - const settings = await Settings.findByPk(guildId); - return settings?.playlistLimit ?? 50; - } }