Run black on all examples and require it for CI

This commit is contained in:
Rapptz
2022-03-24 23:39:50 -04:00
parent 968a1f366f
commit 8591cfc5e7
21 changed files with 91 additions and 44 deletions

View File

@ -30,15 +30,17 @@ class MyBot(commands.Bot):
# subclass to the super() method, which tells the bot to
# use the new MyContext class
return await super().get_context(message, cls=cls)
intents = discord.Intents.default()
intents.message_content = True
bot = MyBot(command_prefix='!', intents=intents)
@bot.command()
async def guess(ctx, number: int):
""" Guess a random number from 1 to 6. """
"""Guess a random number from 1 to 6."""
# explained in a previous example, this gives you
# a random number from 1-6
value = random.randint(1, 6)
@ -47,8 +49,9 @@ async def guess(ctx, number: int):
# or a red cross mark if it wasn't
await ctx.tick(number == value)
# IMPORTANT: You shouldn't hard code your token
# these are very important, and leaking them can
# these are very important, and leaking them can
# let people do very malicious things with your
# bot. Try to use a file or something to keep
# them private, and don't commit it to GitHub