Game creation: send a welcome message to each player channel

This commit is contained in:
Elnath 2021-06-13 18:45:57 +02:00
parent 0792753673
commit a9e82aeabd
1 changed files with 3 additions and 1 deletions

View File

@ -274,8 +274,10 @@ class Game:
gm_role: discord.PermissionOverwrite(read_messages = True),
observer_role: discord.PermissionOverwrite(read_messages = True, send_messages = False),
}
self.config["player_info"][str(player.id)]["channel"] = (await game_category.create_text_channel(player.name, overwrites = perms, position = position)).id
player_channel = await game_category.create_text_channel(player.name, overwrites = perms, position = position)
self.config["player_info"][str(player.id)]["channel"] = player_channel.id
logger.debug(f"[{self.guild.name}] Created channel for player {player.name}")
asyncio.create_task(player_channel.send(f"Hello! This is your private channel.\nIn here you can cast your votes, interact with the <@&{self.get_gm_role_id()}>, and write freely.\nHave a nice game!", allowed_mentions = discord.AllowedMentions.none()))
for i, player in enumerate(player_role.members):
tasks.append(asyncio.create_task(create_player_channel(player, 5 + i)))