Skip to content

Fixes glacier command #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2020
Merged

Fixes glacier command #580

merged 2 commits into from
Jun 12, 2020

Conversation

Elinvynia
Copy link
Contributor

This updates octocrab to fix the issue mentioned in: rust-lang/glacier#231
Also, it fixes my mistake in parsing the URL. This also allows ANY gist to be used instead of just a playground link.

@@ -64,7 +64,7 @@ async fn handle_input(ctx: &Context, event: &Event, cmd: GlacierCommand) -> anyh
};

let url = cmd.source;
let response = ctx.github.raw().get(&format!("{}{}", url.replace("github", "githubusercontent"), "/playground.rs")).send().await?;
let response = ctx.github.raw().get(&format!("{}{}", url, "/raw")).send().await?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to just directly send a request to the relevant URL? That would give more flexibility and be easier to understand I think-- just saying "please provide a URL resolving to plain-text rust code" makes a lot of sense I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll change it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants