Skip to content

Commit

Permalink
Remove obsolete base url, make title link more clear on single results.
Browse files Browse the repository at this point in the history
  • Loading branch information
Saladoc committed Oct 30, 2018
1 parent f80f867 commit a1a0bb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/javacord/bot/commands/WikiCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private void populatePages(DiscordApi api, EmbedBuilder embed, Predicate<WikiPag

sentences++;
}
embed.setDescription(cleanedDescription.substring(0, length+1));
embed.setDescription(String.format("**[%s](%s)**\n\n", page.getTitle(), WikiParser.BASE_URL + page.getUrl())
+ cleanedDescription.substring(0, length + 1));
} else {
embed.setTitle("Javacord Wiki");
embed.setUrl(WikiParser.BASE_URL + "/wiki/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ public class WikiParser {

private final DiscordApi discordApi;
private final String apiUrl;
private final String baseUrl;

public WikiParser(DiscordApi api) {
this(api, API_URL, BASE_URL);
this(api, API_URL);
}

public WikiParser(DiscordApi api, String apiUrl, String baseUrl) {
public WikiParser(DiscordApi api, String apiUrl) {
this.discordApi = api;
this.apiUrl = apiUrl;
this.baseUrl = baseUrl.endsWith("/") ? baseUrl.substring(0, baseUrl.length()-1) : baseUrl;
}

public CompletableFuture<Set<WikiPage>> getPages() {
Expand Down

0 comments on commit a1a0bb9

Please sign in to comment.