Last active
March 17, 2024 15:17
-
-
Save brian6932/604e7b4e581dd5abad6cbdb327266e44 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 | |
execute = async function () { | |
const cmd = await command.execute(...arguments) | |
if (!cmd.success) { | |
let acc = `` | |
for (const argument of arguments) | |
acc += argument + ` ` | |
throw Error(`$${acc}\u{2022} ${cmd.reason ?? cmd.reply}`) | |
} | |
return cmd.reply | |
}, | |
fish = async () => { | |
const | |
cmd = await execute(`fish`, `skipStory:true`), | |
reminder = `\u{1f41f}\u{23f2}` | |
if (cmd[0] !== `N`) | |
return cmd + ` \u{2022} ` + await execute(`remindme`, `in 30m`, reminder) | |
let c, parenthesis | |
loop: | |
for (let i = cmd.length;i;--i) | |
switch (cmd[i]) { | |
case `(`: | |
parenthesis = i | |
break loop | |
case `c`: | |
c = i | |
} | |
return cmd + ` \u{2022} ` + await execute(`remindme`, `in ${cmd.slice(parenthesis + 1, c - 1)}`, reminder) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment