Skip to content

Instantly share code, notes, and snippets.

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