mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Run black on all examples and require it for CI
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user