Created
January 14, 2022 20:16
-
-
Save insyri/0faf33aa7a96a7913d3957719fdd1cd9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const commmands: Map<String, Function> = new Map(); | |
commmands.set("help", () => console.log("This is the help command")); | |
const message = "/help".slice(1); | |
commmands.has(message) | |
? commmands.get(message)() | |
: console.log("Command not found"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment