Authorization stuff
This commit is contained in:
parent
13155d68fb
commit
0973651870
2 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ public class WakaTimeCommand implements Command {
|
|||
@Override
|
||||
public void executed(String[] args, CommandEvent event) {
|
||||
if (args.length == 1) {
|
||||
Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).build();
|
||||
Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).addHeader("Authorization", "Basic " + event.getConfig().getWakaTimeToken()).build();
|
||||
|
||||
try {
|
||||
Response response = new OkHttpClient().newCall(request).execute();
|
||||
|
|
|
|||
|
|
@ -103,6 +103,10 @@ public class Config {
|
|||
return config.getJSONObject("Tokens").getString("GitHub");
|
||||
}
|
||||
|
||||
public String getWakaTimeToken() {
|
||||
return config.getJSONObject("Tokens").getString("WakaTime");
|
||||
}
|
||||
|
||||
public String getMythicalBotListToken() {
|
||||
return config.getJSONObject("Tokens").getString("MythicalBotList");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue