Last active
March 17, 2024 15:15
-
-
Save brian6932/4a8f336fac6fd5cfbf560f61e658fda0 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 | |
}, | |
trap = async () => { | |
const | |
fish = await execute(`fish`, `trap`, `reset`), | |
reminder = await execute(`remindme`, `${customData.get(`trap_prefix`) ? `in ` : `after:`}1h`, `\u{1faa4}`) | |
customData.set(`trap`, +reminder.slice(reminder.lastIndexOf(` `) + 1, -1)) | |
return fish + ` ` + reminder | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment