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

Method stream_guild_logs

components/scheduler/src/rpc_server.rs:118–132  ·  view source on GitHub ↗
(
        &self,
        payload: GuildSpecifier,
    )

Source from the content-addressed store, hash-verified

116 }
117
118 async fn stream_guild_logs(
119 &self,
120 payload: GuildSpecifier,
121 ) -> Result<service::SseStream<guild_logger::LogEntry>, StatusCode> {
122 let guild_id = payload.guild_id;
123
124 let mut rx = self.log_subscriber.subscribe(guild_id);
125 let out = async_stream::try_stream! {
126 while let Ok(next) = rx.recv().await{
127 yield next;
128 }
129 };
130
131 Ok(SseStream::new(out))
132 }
133}

Callers 1

subscribe_logsMethod · 0.80

Calls 1

subscribeMethod · 0.80

Tested by

no test coverage detected