* Creates or resumes a interval timer. * * @param name The name of the timer, this is not namespaced to the current script. You could overwrite a timer from another script with the same name. * @param interval The interval, either in minutes for running the callback at every x minute
(name: string, interval: string | number, callback: () => any)
| 316 | * ``` |
| 317 | */ |
| 318 | onInterval(name: string, interval: string | number, callback: () => any) { |
| 319 | let timerType; |
| 320 | if (typeof interval === "number") { |
| 321 | timerType = { minutes: interval }; |
| 322 | } else { |
| 323 | timerType = { cron: interval }; |
| 324 | } |
| 325 | |
| 326 | this.intervalTimers.push({ |
| 327 | callback, |
| 328 | timer: { |
| 329 | name: name, |
| 330 | interval: timerType, |
| 331 | } |
| 332 | }); |
| 333 | } |
| 334 | |
| 335 | on(eventType: "MESSAGE_DELETE", cb: (evt: EventSystem.EventTypes["MESSAGE_DELETE"]) => void): void; |
| 336 | on(eventType: "MESSAGE_UPDATE", cb: (evt: EventSystem.EventTypes["MESSAGE_UPDATE"]) => void): void; |
no outgoing calls
no test coverage detected