I have created an object with the ES6 documentation, and have been successful! However, when I attempt to call the functions by doing shardHandler('help') or such, the console shows Promise { <pending> } but the 1, 2, 3, 4, etc. is never called.
Below is my code. How can I call the functions from inside the object?
const shardHandler = async (arg) => ({
"ids": (client, message) => {
console.log('1')
},
"respawn": (client, message) => {
console.log('2')
},
"kill": (client, message) => {
console.log('3')
},
"restart": (client, message) => {
console.log('4')
},
"help": (message) => {
console.log('5')
}
})[arg] || "help";
const run = async () => shardHandler('kill');
run()