Skip to content

Commit

Permalink
last year counter for jason
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietzler committed Jan 1, 2024
1 parent 928cf94 commit cfceaf2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/events/messageEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { RequestError } from '@octokit/request-error';
const PREVIEW_BLACKLIST = [Constants.Urls.Immich, Constants.Urls.GitHub];
const octokit = new Octokit();

let _counter = 3;

@Discord()
export class MessageEvents {
@On({ event: 'messageCreate' })
Expand All @@ -16,7 +18,7 @@ export class MessageEvents {
return;
}

await Promise.all([this.handleGithubShortLinks(message)]);
await Promise.all([this.handleGithubShortLinks(message), this.handleJason(message)]);
}

@On({ event: 'messageUpdate' })
Expand All @@ -30,6 +32,16 @@ export class MessageEvents {
}
}

private async handleJason(message: Message<boolean>) {
if (message.author.id !== '613523742479483183') {
return;
}

if (message.content.toLowerCase().includes('last year')) {
await message.reply(String(++_counter));
}
}

private async handleGithubShortLinks(message: Message<boolean>) {
const links = await this.getGithubLinks(message.content);
if (links.length !== 0) {
Expand Down

0 comments on commit cfceaf2

Please sign in to comment.