Fix code style issues with Black
This commit is contained in:
@@ -6,13 +6,12 @@ import discord
|
||||
class CounterBot(commands.Bot):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
command_prefix=commands.when_mentioned_or('$'),
|
||||
intents=discord.Intents(guilds=True, messages=True)
|
||||
command_prefix=commands.when_mentioned_or("$"), intents=discord.Intents(guilds=True, messages=True)
|
||||
)
|
||||
|
||||
async def on_ready(self):
|
||||
print(f'Logged in as {self.user} (ID: {self.user.id})')
|
||||
print('------')
|
||||
print(f"Logged in as {self.user} (ID: {self.user.id})")
|
||||
print("------")
|
||||
|
||||
|
||||
# Define a simple View that gives us a counter button
|
||||
@@ -22,7 +21,7 @@ class Counter(discord.ui.View):
|
||||
# When pressed, this increments the number displayed until it hits 5.
|
||||
# When it hits 5, the counter button is disabled and it turns green.
|
||||
# note: The name of the function does not matter to the library
|
||||
@discord.ui.button(label='0', style=discord.ButtonStyle.red)
|
||||
@discord.ui.button(label="0", style=discord.ButtonStyle.red)
|
||||
async def count(self, button: discord.ui.Button, interaction: discord.Interaction):
|
||||
number = int(button.label) if button.label else 0
|
||||
if number + 1 >= 5:
|
||||
@@ -40,7 +39,7 @@ bot = CounterBot()
|
||||
@bot.command()
|
||||
async def counter(ctx: commands.Context):
|
||||
"""Starts a counter for pressing."""
|
||||
await ctx.send('Press!', view=Counter())
|
||||
await ctx.send("Press!", view=Counter())
|
||||
|
||||
|
||||
bot.run('token')
|
||||
bot.run("token")
|
||||
|
Reference in New Issue
Block a user