add support for ETAs

This commit is contained in:
Ryan Cao 2022-06-10 19:43:29 +08:00
parent fc5f7fdc82
commit 8b08bb9d22
No known key found for this signature in database
GPG key ID: 528A2C1B6656B97F
4 changed files with 21 additions and 5 deletions

View file

@ -11,6 +11,7 @@
"@cliqz/adblocker": "^1.23.8",
"discord-command-parser": "^1.5.3",
"discord.js": "^13.8.0",
"just-random": "^3.0.1",
"kleur": "^4.1.4",
"node-fetch": "^3.2.5",
"remove-markdown": "^0.5.0",

View file

@ -16,6 +16,7 @@ import {
type SuccessfulParsedMessage,
} from 'discord-command-parser';
import random from 'just-random';
import { readFile } from 'fs/promises';
import { join } from 'path';
@ -98,6 +99,20 @@ client.once('ready', async () => {
return;
}
if (e.cleanContent.includes('eta')) {
await e.reply(
`${random([
'Sometime',
'Some day',
'Not far',
'The future',
'Never',
'Perhaps tomorrow?',
'There are no ETAs',
])} <:pofat:964546613194420294>`
);
}
const commanded = await parseMsg(e);
if (commanded) return;

View file

@ -62,11 +62,6 @@
"name": "build",
"text": "https://polymc.org/wiki/development/build-instructions/"
},
{
"name": "eta",
"text": "Sometime <:potat:964543999769706556>",
"aliases": ["wen", "when"]
},
{
"name": "why",
"text": "https://polymc.org/wiki/overview/faq/#why-did-our-community-choose-to-fork https://polymc.org/news/moving-on/",

View file

@ -1100,6 +1100,11 @@ json-stable-stringify-without-jsonify@^1.0.1:
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
just-random@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/just-random/-/just-random-3.0.1.tgz#7bee212808686683a755d93842f1af86a02b3026"
integrity sha512-JOp2xkWZcPNEsDRJOWupw/qJhqUakcNi1gXCqRyix00jUJP37aJUaHuyjeQLC1Vg6ts+cNWWGifdHmP88A6uvA==
kleur@^4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d"