1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Fix readme

This commit is contained in:
Steffo 2020-07-11 02:21:58 +02:00
parent 395313f9cb
commit 950642728b
Signed by: steffo
GPG key ID: 896A80F55F7C97F0
2 changed files with 30 additions and 29 deletions

View file

@ -17,33 +17,6 @@ Imgur.token = "1234567890abcde"
# A Steam Web API key (https://steamcommunity.com/dev/apikey)
Steam.web_api_key = "123567890ABCDEF123567890ABCDEF12"
# Should Royalnet automatically update the Dota ranks of all users?
Dota.updater.enabled = false
# How many seconds should there be between two Dota updates?
Dota.updater.delay = 86400
# Should Royalnet automatically update the League of Legends ranks of all users?
Lol.updater.enabled = false
# How many seconds should there be between two League of Legends updates?
Lol.updater.delay = 86400
# A League of Legends API token (https://developer.riotgames.com/)
Lol.token = "RGAPI-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
# The region where your players are located
Lol.region = "euw1"
# Should Royalnet automatically update the Brawlhalla ranks of all users?
Brawlhalla.updater.enabled = false
# How many seconds should there be between two League of Legends updates?
Brawlhalla.updater.delay = 86400
# A Brawlhalla API key (https://dev.brawlhalla.com/)
Brawlhalla.api_key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
# The Peertube instance you want to use for new video notifications
Peertube.instance_url = "https://pt.steffo.eu"
@ -62,4 +35,29 @@ Play.max_song_duration = 7230
# The Telegram channel where matchmaking messages should be sent in
Matchmaking.mm_chat_id = -1001204402796
[Packs."royalpack"."dota".updater]
enabled = true
period = 86400
delay = 1
target = -1001153723135
[Packs."royalpack"."brawlhalla"]
token = "1234567890ABCDEFGHJKLMNOPQRST"
[Packs."royalpack"."brawlhalla".updater]
enabled = true
period = 86400
delay = 1
target = -1001153723135
[Packs."royalpack"."leagueoflegends"]
token = "RGAPI-AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
region = "euw1"
[Packs."royalpack"."leagueoflegends".updater]
enabled = true
period = 86400
delay = 1
target = -1001153723135
```

View file

@ -25,6 +25,9 @@ class BrawlhallaCommand(LinkerCommand):
syntax: str = ""
def token(self):
return self.config['Brawlhalla']['token']
async def get_updatables_of_user(self, session, user: rbt.User) -> List[Brawlhalla]:
return user.steam
@ -42,7 +45,7 @@ class BrawlhallaCommand(LinkerCommand):
bh: Brawlhalla = obj.brawlhalla
if bh is None:
log.debug(f"Checking if player has an account...")
async with hcs.get(f"https://api.brawlhalla.com/search?steamid={obj.steamid.as_64}&api_key={self.config['Brawlhalla']['api_key']}") as response:
async with hcs.get(f"https://api.brawlhalla.com/search?steamid={obj.steamid.as_64}&api_key={self.token()}") as response:
if response.status != 200:
raise ExternalError(f"Brawlhalla API /search returned {response.status}!")
j = await response.json()
@ -57,7 +60,7 @@ class BrawlhallaCommand(LinkerCommand):
session.add(bh)
session.flush()
async with hcs.get(f"https://api.brawlhalla.com/player/{bh.brawlhalla_id}/ranked?api_key={self.config['Brawlhalla']['api_key']}") as response:
async with hcs.get(f"https://api.brawlhalla.com/player/{bh.brawlhalla_id}/ranked?api_key={self.token()}") as response:
if response.status != 200:
raise ExternalError(f"Brawlhalla API /ranked returned {response.status}!")
j = await response.json()