diff options
Diffstat (limited to 'bot/exts/evergreen')
| -rw-r--r-- | bot/exts/evergreen/minesweeper.py | 17 | ||||
| -rw-r--r-- | bot/exts/evergreen/snakes/snakes_cog.py | 8 | 
2 files changed, 16 insertions, 9 deletions
| diff --git a/bot/exts/evergreen/minesweeper.py b/bot/exts/evergreen/minesweeper.py index ae057b30..3e40f493 100644 --- a/bot/exts/evergreen/minesweeper.py +++ b/bot/exts/evergreen/minesweeper.py @@ -141,9 +141,20 @@ class Minesweeper(commands.Cog):              await ctx.message.delete(delay=2)              return +        try: +            await ctx.author.send( +                f"Play by typing: `{Client.prefix}ms reveal xy [xy]` or `{Client.prefix}ms flag xy [xy]` \n" +                f"Close the game with `{Client.prefix}ms end`\n" +            ) +        except discord.errors.Forbidden: +            log.debug(f"{ctx.author.name} ({ctx.author.id}) has disabled DMs from server members") +            await ctx.send(f":x: {ctx.author.mention}, please enable DMs to play minesweeper.") +            return +          # Add game to list          board: GameBoard = self.generate_board(bomb_chance)          revealed_board: GameBoard = [["hidden"] * 10 for _ in range(10)] +        dm_msg = await ctx.author.send(f"Here's your board!\n{self.format_for_discord(revealed_board)}")          if ctx.guild:              await ctx.send(f"{ctx.author.mention} is playing Minesweeper") @@ -151,12 +162,6 @@ class Minesweeper(commands.Cog):          else:              chat_msg = None -        await ctx.author.send( -            f"Play by typing: `{Client.prefix}ms reveal xy [xy]` or `{Client.prefix}ms flag xy [xy]` \n" -            f"Close the game with `{Client.prefix}ms end`\n" -        ) -        dm_msg = await ctx.author.send(f"Here's your board!\n{self.format_for_discord(revealed_board)}") -          self.games[ctx.author.id] = Game(              board=board,              revealed=revealed_board, diff --git a/bot/exts/evergreen/snakes/snakes_cog.py b/bot/exts/evergreen/snakes/snakes_cog.py index 36c176ce..b3896fcd 100644 --- a/bot/exts/evergreen/snakes/snakes_cog.py +++ b/bot/exts/evergreen/snakes/snakes_cog.py @@ -945,13 +945,15 @@ class Snakes(Cog):              title="About the snake cog",              description=(                  "The features in this cog were created by members of the community " -                "during our first ever [code jam event](https://gitlab.com/discord-python/code-jams/code-jam-1). \n\n" +                "during our first ever " +                "[code jam event](https://pythondiscord.com/pages/code-jams/code-jam-1-snakes-bot/). \n\n"                  "The event saw over 50 participants, who competed to write a discord bot cog with a snake theme over "                  "48 hours. The staff then selected the best features from all the best teams, and made modifications "                  "to ensure they would all work together before integrating them into the community bot.\n\n"                  "It was a tight race, but in the end, <@!104749643715387392> and <@!303940835005825024> " -                "walked away as grand champions. Make sure you check out `!snakes sal`, `!snakes draw` " -                "and `!snakes hatch` to see what they came up with." +                f"walked away as grand champions. Make sure you check out `{ctx.prefix}snakes sal`," +                f"`{ctx.prefix}snakes draw` and `{ctx.prefix}snakes hatch` " +                "to see what they came up with."              )          ) | 
