We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51ac06c commit 1e188f4Copy full SHA for 1e188f4
src/adapters/http/mod.rs
@@ -39,6 +39,7 @@ impl HttpAdapter {
39
});
40
41
let app = Router::new()
42
+ .route("/{guild_id}/status", get(queue_status))
43
.route("/{guild_id}/queue", get(list_queue))
44
.route("/{guild_id}/queue/ws", any(list_queue_ws))
45
.layer(ServiceBuilder::new().layer(TraceLayer::new_for_http()))
@@ -51,6 +52,12 @@ impl HttpAdapter {
51
52
}
53
54
55
+async fn queue_status(State(state): State<Arc<AppState>>, Path(guild_id): Path<String>) -> String {
56
+ let is_open = state.queue.is_open(&guild_id);
57
+ let status = if is_open { "open" } else { "closed" };
58
+ status.to_string()
59
+}
60
+
61
async fn list_queue(
62
State(state): State<Arc<AppState>>,
63
Path(guild_id): Path<String>,
0 commit comments