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

Method get_all_guild_interval_timers

components/stores/src/timers.rs:36–54  ·  view source on GitHub ↗
(
        &self,
        guild_id: Id<GuildMarker>,
    )

Source from the content-addressed store, hash-verified

34
35impl Db {
36 pub async fn get_all_guild_interval_timers(
37 &self,
38 guild_id: Id<GuildMarker>,
39 ) -> TimerStoreResult<Vec<IntervalTimer>> {
40 let res = sqlx::query_as!(
41 DbIntervalTimer,
42 "SELECT guild_id, plugin_id, timer_name, interval_minutes, interval_cron, \
43 last_run_at, created_at, updated_at
44 FROM interval_timers WHERE guild_id=$1;",
45 guild_id.get() as i64,
46 )
47 .fetch_all(&self.pool)
48 .await?;
49
50 Ok(res
51 .into_iter()
52 .filter_map(|v| IntervalTimer::try_from(v).ok())
53 .collect())
54 }
55
56 pub async fn update_interval_timer(
57 &self,

Callers 1

script_startedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected