Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ Repo is only here for reference.
## Docker deployment

Automated container builds are pushed to [ghcr.io/apinat/riotesportsrewardsbot](https://github.com/aPinat/RiotEsportsRewardsBot/pkgs/container/riotesportsrewardsbot) with `latest`, `{BRANCH}`, `sha-{COMMIT_SHA}` available as tags.

### Environment Variables to Use

| ENV VAR Name | Description |
| --- |------------------------------------|
| RIOT_X_API_KEY | Personal API key from https://developer.riotgames.com |
| RIOT_ACCESS_TOKEN | Access Token gained from reading Network Transfer on https://lolesports.com |
| HL_TAG | Your Locale Tag provided by your Geolocation (this have to be ident with your geolocation) |
3 changes: 2 additions & 1 deletion RiotEsportsRewardsBot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

var riotXApiKey = Environment.GetEnvironmentVariable("RIOT_X_API_KEY") ?? throw new ApplicationException("RIOT_X_API_KEY missing.");
var riotAccessToken = Environment.GetEnvironmentVariable("RIOT_ACCESS_TOKEN") ?? throw new ApplicationException("RIOT_ACCESS_TOKEN missing.");
var hlTag = Environment.GetEnvironmentVariable("HL_TAG") ?? throw new ApplicationException("HL_TAG missing.");

var esports = new HttpClient();
esports.DefaultRequestHeaders.TryAddWithoutValidation("x-api-key", riotXApiKey);
Expand All @@ -15,7 +16,7 @@
{
try
{
var livedata = await esports.GetFromJsonAsync<LiveData>("https://esports-api.lolesports.com/persisted/gw/getLive?hl=en-GB");
var livedata = await esports.GetFromJsonAsync<LiveData>($"https://esports-api.lolesports.com/persisted/gw/getLive?hl={hlTag}");
if (livedata?.Data?.Schedule?.Events == null)
goto END;

Expand Down