Simp-O-Matic

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

commit f22f68bc01c89b4629399c8f1ded0d9fd4d4ad01
parent 2408e8fda34d33175e29d0ea7c3d8f84d7dfcc4a
Author: Demonstrandum <moi@knutsen.co>
Date:   Wed, 18 Mar 2020 22:33:49 +0000

Fix alias command rebuilding.

Diffstat:
Mlib/commands/reject.ts | 4++++
Mlib/main.ts | 2+-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/commands/reject.ts b/lib/commands/reject.ts @@ -37,6 +37,10 @@ export default home_scope => { do { if (phrase.slice(i, i + 2) === '\\/') i += 2; // escaped /. else if (phrase[i] === '/') break; // end of regex. + if (i >= phrase.length) { + message.answer('Having real trouble parsing that m8...'); + return; + } else i += 1; // nothing interesting. } while (true); i += 1; diff --git a/lib/main.ts b/lib/main.ts @@ -116,7 +116,7 @@ export class SimpOMatic { if (expanded_command_words.length > 1) { // This means the alias has expanded to more than just one word. expanded = expanded_command_words.shift(); - expanded_command_words.each(e => args.unshift(e)); + expanded_command_words.each(e => args.push(e)); } return expanded };