Accounts handler¶
init()
.give_account()
and send_account()
to hand an account to an in-match player.terminate_account()
to remove the account from the player.-
init
(secret_file: str)¶ Initialize the accounts from the google sheet. If called later, reload the account usernames and passwords.
- Parameters
secret_file – Name of the gspread authentication json file.
-
async
give_account
(a_player: classes.players.ActivePlayer) → bool¶ Give an account to a_player. We want each player to use as little accounts as possible. So we try to give an account the player already used.
- Parameters
a_player – Player to give account to.
- Returns
True is account given, False if not enough accounts available.
-
async
send_account
(channel: discord.channel.TextChannel, a_player: classes.players.ActivePlayer)¶ Actually send its account to the player.
- Parameters
channel – Current match channel.
a_player – Player to send the account to.
-
async
terminate_account
(a_player: classes.players.ActivePlayer)¶ Terminate the account: ask the user to log off and remove the reaction.
- Parameters
a_player – Player whose account should be terminated.
-
get_not_validated_accounts
(team: classes.teams.Team) → list¶ Find all the accounts that were not validated within the team.
- Parameters
team – Team to check
- Returns
List containing the players who didn’t accept their accounts.