diff options
| author | Nathan Perry <np@nathanperry.dev> | 2020-06-20 15:14:35 -0400 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2020-06-20 15:14:35 -0400 |
| commit | 7cd17b04f7422dcce1410ec26922cba161cd6e0d (patch) | |
| tree | 978f8d9e506cfb0f0c4852d9a726122157f803c2 /src/game.rs | |
| parent | eca7b5c981650217bc259329e2687df44f3845c0 (diff) | |
fix user id parsing
Diffstat (limited to 'src/game.rs')
| -rw-r--r-- | src/game.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game.rs b/src/game.rs index 9e6997a..02f3f45 100644 --- a/src/game.rs +++ b/src/game.rs @@ -45,7 +45,6 @@ use lazy_static::lazy_static; use crate::{ must_env_lookup, Result, - Error, util::CtxExt, VOICE_CHANNEL_ID, }; @@ -70,6 +69,11 @@ lazy_static! { static ref STEAM_API_KEY: String = must_env_lookup("STEAM_API_KEY"); static ref SPREADSHEET_ID: String = must_env_lookup("SPREADSHEET_ID"); static ref MAX_SHEET_COLUMN: String = must_env_lookup("MAX_SHEET_COLUMN"); + + static ref SPREADSHEET_URL: Url = Url::parse(&format!( + "https://sheets.googleapis.com/v4/spreadsheets/{}/values:batchGet", + *SPREADSHEET_ID, + )).expect("prasing spreadsheet url"); } #[derive(Deserialize, Debug, Clone, PartialEq, Eq, Hash)] @@ -377,8 +381,7 @@ fn _game(ctx: &mut Context, msg: &Message, mut args: Args, min_status: GameStatu } fn load_spreadsheet() -> Result<Vec<Vec<String>>> { - let mut u = Url::parse( - &format!("https://sheets.googleapis.com/v4/spreadsheets/{}/values:batchGet", *SPREADSHEET_ID))?; + let mut u = SPREADSHEET_URL.clone(); u.query_pairs_mut() .append_pair("ranges", &format!("a1:{}", &*MAX_SHEET_COLUMN)) @@ -524,4 +527,4 @@ pub fn updategaem(ctx: &mut Context, msg: &Message, mut args: Args) -> Result<() } else { ctx.send(msg.channel_id, "up to date", msg.tts) } -}
\ No newline at end of file +} |
