Skip to content

Instantly share code, notes, and snippets.

@brian6932
Last active March 17, 2024 15:15
Show Gist options
  • Save brian6932/4a8f336fac6fd5cfbf560f61e658fda0 to your computer and use it in GitHub Desktop.
Save brian6932/4a8f336fac6fd5cfbf560f61e658fda0 to your computer and use it in GitHub Desktop.
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