summaryrefslogtreecommitdiff
path: root/src/browser/mod.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-08-04 17:22:21 +0200
committerSanto Cariotti <santo@dcariotti.me>2021-08-04 17:22:21 +0200
commit909e2cbdf8cbb311f4abef2c0c1d176987580a76 (patch)
treedbcfa17a56a12c7549c9867842cd44b14c917de1 /src/browser/mod.rs
parent1be956d27668dcf2052ea82b191ae1917e6cb11b (diff)
feat: get faculties for the /room command
Diffstat (limited to 'src/browser/mod.rs')
-rw-r--r--src/browser/mod.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/browser/mod.rs b/src/browser/mod.rs
index 8359c51..2765c6d 100644
--- a/src/browser/mod.rs
+++ b/src/browser/mod.rs
@@ -1,3 +1,5 @@
+use std::collections::HashMap;
+
use self::web_browser::{Browser, WEB_BROWSER};
use crate::Config;
use thirtyfour::prelude::WebDriverResult;
@@ -17,3 +19,18 @@ pub async unsafe fn login(credentials: &Config) -> WebDriverResult<()> {
Ok(())
}
+
+pub async unsafe fn get_faculties() -> WebDriverResult<Option<HashMap<String, String>>> {
+ if let Some(driver) = &WEB_BROWSER {
+ match driver.faculties().await? {
+ Some(faculties) => {
+ return Ok(Some(faculties));
+ }
+ None => {
+ return Ok(Some(HashMap::<String, String>::new()));
+ }
+ };
+ }
+
+ Ok(Some(HashMap::<String, String>::new()))
+}