MCPcopy Create free account
hub / github.com/Botloader/botloader / onInterval

Method onInterval

components/runtime/src/ts/script.ts:318–333  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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;

Callers 12

interval2.tsFile · 0.80
interval.tsFile · 0.80
polls.tsFile · 0.80
leveling.tsFile · 0.80
giveaways.tsFile · 0.80
tickets_2.tsFile · 0.80
automod.tsFile · 0.80
tickets_3.tsFile · 0.80
giveaways_2.tsFile · 0.80
automod_3.tsFile · 0.80
tickets.tsFile · 0.80
automod_2.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected