Skip to content

Commit fb82954

Browse files
committed
add silly little prank to annie
1 parent d4d311b commit fb82954

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/plugins/reply.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ModuleProps } from "../plugins";
2+
import { Emoji } from "../style";
23
import * as utils from "../utils";
34

45
export default ({ config, commands }: ModuleProps) => {
@@ -8,6 +9,27 @@ export default ({ config, commands }: ModuleProps) => {
89
async (msg, args, thread) => {
910
if (!thread) return;
1011

12+
// Temporary joke referencing Annie's dream.
13+
function isLessThanSixHoursAgo(date: Date): boolean {
14+
const sixHoursInMs = 6 * 60 * 60 * 1000;
15+
return Date.now() - date.getTime() < sixHoursInMs;
16+
}
17+
18+
if (
19+
msg.author.id === "756447259159166978" &&
20+
isLessThanSixHoursAgo(thread.created_at)
21+
) {
22+
// @ts-ignore
23+
await msg.channel.send(
24+
`${Emoji.Banned} Could not send reply: Thread is less than 6 hours old.`,
25+
);
26+
27+
setTimeout(() => {
28+
// @ts-ignore
29+
await msg.channel.send(`🥃 Swish... just kidding :)`);
30+
}, 3000);
31+
}
32+
1133
if (!args.text && msg.attachments.size === 0) {
1234
utils.postError(msg.channel, "Text or attachment required");
1335
return;

0 commit comments

Comments
 (0)