finalized league ownership

This commit is contained in:
Sakimori 2021-01-15 16:24:00 -05:00
parent 6cdfa1bd5b
commit eead0c9309

View File

@ -894,14 +894,15 @@ class LeagueAddOwnersCommand(Command):
league_name = command.split("\n")[0].strip() league_name = command.split("\n")[0].strip()
if league_exists(league_name): if league_exists(league_name):
league = leagues.load_league_file(league_name) league = leagues.load_league_file(league_name)
if league.owner is not None and (msg.author.id in league.owner or msg.author.id in config()["owners"]): if (league.owner is not None and msg.author.id in league.owner) or (league.owner is not None and msg.author.id in config()["owners"]):
for user in msg.mentions: for user in msg.mentions:
if user.id not in league.owner: if user.id not in league.owner:
league.owner.append(user.id) league.owner.append(user.id)
await msg.channel.send(f"The new {league} front office is now up and running.") leagues.save_league(league)
await msg.channel.send(f"The new {league.name} front office is now up and running.")
return return
else: else:
await msg.channel.send(f"That league hasn't been claimed yet. Try m;claimleague first.") await msg.channel.send(f"That league isn't yours, boss.")
return return
else: else:
await msg.channel.send("Can't find that league, boss.") await msg.channel.send("Can't find that league, boss.")