From a9e82aeabd25fa528c4c9c0d8a5b03e0d2b91125 Mon Sep 17 00:00:00 2001 From: Elnath Date: Sun, 13 Jun 2021 18:45:57 +0200 Subject: [PATCH] Game creation: send a welcome message to each player channel --- GameFiles/Game.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GameFiles/Game.py b/GameFiles/Game.py index 73a7e86..8440ef3 100644 --- a/GameFiles/Game.py +++ b/GameFiles/Game.py @@ -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)))