Simp-O-Matic

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

commit 6d11b6f5253a42caada39a44fec2ecfe69deb06e
parent 120dbd5dcceab1f6e756b962d0afc83f73fa8023
Author: Daniel <23189912+danyisill@users.noreply.github.com>
Date:   Thu, 19 Mar 2020 16:02:43 +0300

Code by https://github.com/Accelarion
Diffstat:
Alib/commands/b.ts | 26++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)

diff --git a/lib/commands/b.ts b/lib/commands/b.ts @@ -0,0 +1,26 @@ +import { Message } from 'discord.js'; + +export default home_scope => { + const { message, args } + : { message: Message, args: string[] } = home_scope; + + let input: string; + + if (args.length === 0) + input = "b"; + else + input = args.join(' ').toLowerCase(); + + const alphabet = 'pb'; + + let letters = [...input].map((chr: any) => { + if (isNaN(chr) && alphabet.includes(chr)) + chr.bee() : `b`.bee(); + else if (chr === ' ') + return chr; + else + return chr; + }) + + message.channel.send(letters.join(' ')); +};