diff --git a/src/assets/wakeup.gif b/src/assets/wakeup.gif new file mode 100644 index 0000000..208973f Binary files /dev/null and b/src/assets/wakeup.gif differ diff --git a/src/assets/wakeup.mp4 b/src/assets/wakeup.mp4 new file mode 100644 index 0000000..39ff0e5 Binary files /dev/null and b/src/assets/wakeup.mp4 differ diff --git a/src/modules/cron-tasks/cron-scheduler.ts b/src/modules/cron-tasks/cron-scheduler.ts index 679702e..0afd715 100644 --- a/src/modules/cron-tasks/cron-scheduler.ts +++ b/src/modules/cron-tasks/cron-scheduler.ts @@ -4,6 +4,7 @@ import BirthdayShoutoutTask from './tasks/birthday-shoutout.task' import * as cron from 'node-cron' import { Inject } from '@nestjs/common' import { BirthdayEntryService } from '../birthday/service/birthday-entry.service' +import WakeUpTask from './tasks/wake-up.task' interface TaskEntry { @@ -30,6 +31,13 @@ class CronScheduler { this.client.channels.cache.find((channel) => channel.id === '447554141724737548') as TextChannel,birthdayService ), }, + { + name: 'first-of-the-month', + schedule: '0 12 1 * *', + task: new WakeUpTask( + this.client.channels.cache.find((channel) => channel.id === '447554141724737548') as TextChannel, + ), + }, ] CronScheduler.instance = this diff --git a/src/modules/cron-tasks/task.module.ts b/src/modules/cron-tasks/task.module.ts index 0c4558f..d6accfa 100644 --- a/src/modules/cron-tasks/task.module.ts +++ b/src/modules/cron-tasks/task.module.ts @@ -1,7 +1,5 @@ import { Module } from "@nestjs/common"; import { BirthdayEntryModule } from "../birthday/module/birthday-entry.module"; -import BirthdayShoutoutTask from "./tasks/birthday-shoutout.task"; -import { CronScheduler } from "./cron-scheduler"; @Module({ diff --git a/src/modules/cron-tasks/tasks/wake-up.task.ts b/src/modules/cron-tasks/tasks/wake-up.task.ts new file mode 100644 index 0000000..9d45bdc --- /dev/null +++ b/src/modules/cron-tasks/tasks/wake-up.task.ts @@ -0,0 +1,22 @@ +import { EmbedBuilder, TextChannel } from 'discord.js' +import { ITask } from './interfaces/task.interface' + +export default class WakeUpTask implements ITask { + private channel: TextChannel + + constructor(channel: TextChannel) { + this.channel = channel + } + + async execute(): Promise { + + let embed = new EmbedBuilder() + .setTitle(`🚨 WAKE UP 🚨`) + .setColor('Random') + .setDescription(`🎉 it's the first of the month 🎉`) + .setTimestamp(new Date()).setImage("https://raw.githubusercontent.com/Blvckleg/BingusBoingus/master/src/assets/wakeup.gif").setFooter({text: 'party bingus',}) + + await this.channel.send({ embeds: [embed] }) + + } +} \ No newline at end of file