瀏覽代碼

Accept more general parameters

Elinvynia 4 年之前
父節點
當前提交
1a5884a763
共有 2 個文件被更改,包括 3 次插入5 次删除
  1. 2 3
      parser/src/command/glacier.rs
  2. 1 2
      src/handlers/glacier.rs

+ 2 - 3
parser/src/command/glacier.rs

@@ -1,14 +1,13 @@
 //! The glacier command parser.
 //!
-//! This adds the option to track ICEs. The link must be in quotes.
+//! This adds the option to track ICEs. The <code-source> must be in quotes.
 //!
 //! The grammar is as follows:
 //!
 //! ```text
 //! Command: `@bot glacier <code-source>`
 //!
-//! <code-source>:
-//!   - "https://gist.github.com/.*"
+//! <code-source>: any URL that resolves to plain-text Rust code
 //! ```
 
 use crate::error::Error;

+ 1 - 2
src/handlers/glacier.rs

@@ -63,8 +63,7 @@ async fn handle_input(ctx: &Context, event: &Event, cmd: GlacierCommand) -> anyh
         return Ok(())
     };
 
-    let url = cmd.source;
-    let response = ctx.github.raw().get(&format!("{}{}", url, "/raw")).send().await?;
+    let response = ctx.github.raw().get(&cmd.source).send().await?;
     let body = response.text().await?;
 
     let number = event.issue().unwrap().number;