commit 457b8991418e540dab1e7adf90065917cb898dc8
parent b5b4f159dc6dfb888b901a93e324ac2bb8603084
Author: danyisill <danyisill@users.noreply.github.com>
Date: Thu, 19 Mar 2020 16:14:40 +0300
Create cowsay.ts and figlet.ts
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/commands/cowsay.ts b/lib/commands/cowsay.ts
@@ -0,0 +1,5 @@
+import { execFileSync } from 'child_process'
+export default home_scope => {
+ const { message, args } = home_scope
+ message.answer('``` \n' + execFileSync('/bin/cowsay', args) + '```') // this is safe because no shell is spawned
+}+
\ No newline at end of file
diff --git a/lib/commands/figlet.ts b/lib/commands/figlet.ts
@@ -0,0 +1,5 @@
+import { execFileSync } from 'child_process'
+export default home_scope => {
+ const { message, args } = home_scope
+ message.answer('``` \n' + execFileSync('/bin/figlet', args) + '```') // this is safe because no shell is spawned
+}+
\ No newline at end of file