Skip to content

Commit

Permalink
fix: Read github links
Browse files Browse the repository at this point in the history
  • Loading branch information
Brayan-724 committed Sep 26, 2024
1 parent 5aa1e3b commit 2460c28
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bot/events/read_github_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,18 @@ pub async fn message(ctx: &Context, msg: &Message) -> bool {
})
} else {
return false;
};
}.replace("https://github.com/", "https://raw.githubusercontent.com/");

let without_hidden = hidden_link_regex.replace_all(&replaced, "");

let without_spaces = split_message_regex.split(&without_hidden);


let links = without_spaces
.filter(|s| s.starts_with("https://raw.githubusercontent.com/"));

let mut dup: Vec<&str> = Vec::new();
for link in without_spaces {
for link in links {
if dup.contains(&link) {
continue;
}
Expand Down

0 comments on commit 2460c28

Please sign in to comment.