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

Method script_started

components/scheduler/src/interval_timer_manager.rs:97–116  ·  view source on GitHub ↗
(&mut self, timers: Vec<IntervalTimerContrib>)

Source from the content-addressed store, hash-verified

95 }
96
97 pub async fn script_started(&mut self, timers: Vec<IntervalTimerContrib>) {
98 if timers.is_empty() {
99 return;
100 }
101
102 info!("initializing {} timers", timers.len());
103 let all_guild_timers = self
104 .storage
105 .get_all_guild_interval_timers(self.guild_id)
106 .await
107 .unwrap();
108
109 for script_timer in timers {
110 let db_timer = all_guild_timers
111 .iter()
112 .find(|v| v.name == script_timer.name && v.plugin_id == script_timer.plugin_id);
113
114 self.init_timer(script_timer, db_timer).await.unwrap();
115 }
116 }
117
118 pub fn clear_loaded_timers(&mut self) {
119 self.loaded_intervals.clear();

Callers 1

script_loadedMethod · 0.45

Calls 2

init_timerMethod · 0.80

Tested by

no test coverage detected