2022-04-13 21:38:59 +02:00
|
|
|
import { GuildScheduledEvent } from "discord.js"
|
2022-04-21 19:46:03 +02:00
|
|
|
import { repetitionMarkerIsFound } from "../handler/repeatingEvents/helper"
|
2022-04-13 21:38:59 +02:00
|
|
|
import { handleRepeatingEvent } from "../handler/repeatingEvents/repeatingEvents.controller"
|
|
|
|
|
|
|
|
|
2022-03-05 01:24:05 +01:00
|
|
|
export const name = 'guildScheduledEventUpdate'
|
2022-04-12 22:39:47 +02:00
|
|
|
export function execute(oldguildScheduledEvent: GuildScheduledEvent, newguildScheduledEvent: GuildScheduledEvent) {
|
|
|
|
console.dir(oldguildScheduledEvent)
|
|
|
|
console.dir(newguildScheduledEvent)
|
|
|
|
|
2022-04-13 21:38:59 +02:00
|
|
|
if (oldguildScheduledEvent.description && repetitionMarkerIsFound(oldguildScheduledEvent.description)) {
|
2022-04-12 22:39:47 +02:00
|
|
|
// valid repeating event
|
2022-04-13 21:38:59 +02:00
|
|
|
if (newguildScheduledEvent.status === 'COMPLETED')
|
|
|
|
handleRepeatingEvent(oldguildScheduledEvent, newguildScheduledEvent)
|
2022-04-12 22:39:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|