Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit 177288fd79c46a48ce01fc254e7fc1a77cbea00d
parent bf5dc3b95724632f09bc0f7df68d61589544a758
Author: Demonstrandum <moi@knutsen.co>
Date:   Wed, 11 Nov 2020 04:04:51 +0000

Update highWaterMark.

Diffstat:
Mlib/commands/vc.ts | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/commands/vc.ts b/lib/commands/vc.ts @@ -4,7 +4,9 @@ import ytdl from 'ytdl-core'; const DL_OPTIONS : any = { filter: 'audioonly', dlChunkSize: 0, - quality: 'highestaudio' + quality: 'highestaudio', + // Helps fix random cut-off towards end of playback. + highWaterMark: 1 << 25 }; export default async(home_scope: HomeScope) => { @@ -39,7 +41,7 @@ export default async(home_scope: HomeScope) => { if (message.member.voice.channel) { GID.vc = await message.member.voice.channel.join(); CONFIG.vc_channel = message.channel.id; - message.reply("Joined your voice chat."); + message.reply("Joined voice chat."); } else { message.reply("Join a voice channel first."); } @@ -53,11 +55,10 @@ export default async(home_scope: HomeScope) => { } break; } case "pause": { - if (GID.vc_dispatcher) { + if (GID.vc_dispatcher && !GID.vc_dispatcher.paused) { GID.vc_dispatcher.pause(); message.answer("Paused playback."); - } - else { + } else { message.answer("Nothing is playing"); } break;