Пример #1
0
    async def _get_game(self, ctx: commands.Context, game_code=None):
        guild: discord.Guild = ctx.guild

        if guild is None:
            # Private message, can't get guild
            await ctx.send("Cannot start game from PM!")
            return None
        if guild.id not in self.games or self.games[guild.id].game_over:
            await ctx.send("Starting a new game...")
            success, role, category, channel, log_channel = await self._get_settings(ctx)

            if not success:
                await ctx.send("Cannot start a new game")
                return None

            self.games[guild.id] = Game(guild, role, category, channel, log_channel, game_code)

        return self.games[guild.id]