use uuid::Uuid;
use super::SlackState;
impl SlackState {
pub async fn set_pending_followups(&self, session_id: Uuid, options: Vec<String>) {
self.pending_followups
.lock()
.await
.insert(session_id, options);
}
pub async fn take_pending_followup(&self, session_id: Uuid, idx: usize) -> Option<String> {
let options = self.pending_followups.lock().await.remove(&session_id)?;
options.get(idx).cloned()
}
pub async fn clear_pending_followups(&self, session_id: Uuid) {
self.pending_followups.lock().await.remove(&session_id);
}
}