Simp-O-Matic

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

commit 04c1905b83d602f7a578977b3067923b649c5e25
parent 23ea6d7004f2fcb84ff05c3f179540b603b4dd42
Author: Demonstrandum <moi@knutsen.co>
Date:   Sat, 16 May 2020 18:48:19 +0100

Make !listen give feedback on success.

Diffstat:
Mlib/commands/listen.ts | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/commands/listen.ts b/lib/commands/listen.ts @@ -12,7 +12,7 @@ export default (home_scope: HomeScope) => { + " be either `respond`, `reject`, `replace` or `trigger`" + "\nSee `help` page for `listen` for more information."); - const index_str = args[1].trim(); + const index_str = args[1]?.trim(); const index = Number(index_str[0] === '#' ? index_str.tail() : index_str); @@ -39,4 +39,5 @@ export default (home_scope: HomeScope) => { rule.listens = []; rule.listens.push.apply(rule.listens, ids); + message.answer("Rule listener added successfully."); };