Simp-O-Matic

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

commit d07655b8e6f8be3c0113a2b8f016eba905c438ce
parent 400440e00ec488b5010bafcf09267faf6224cb0e
Author: Demonstrandum <moi@knutsen.co>
Date:   Fri, 20 Mar 2020 00:27:18 +0000

Format get.

Diffstat:
Mlib/main.ts | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/main.ts b/lib/main.ts @@ -188,11 +188,15 @@ export class SimpOMatic { // Accessing invalid fields will be caught. try { const accessors = args[0].trim().split('.').squeeze(); + const resolution = JSON.stringify( recursive_regex_to_string( deep_copy(access(CONFIG, accessors))), null, 4); - const msgs = glue_strings((' ⇒ \n```\n' + resolution + '\n```') - .split('\n')) + + const msgs = glue_strings(resolution + .replace(/(\n)/g, '$1@@@').split('@@@')) + .map(s => '```js\n' + s + '\n```'); + for (const msg of msgs) message.channel.send(msg); } catch (e) {