Merge pull request #17 from Fluffy-Bean/deepsource-transform-614273da

format code with black
This commit is contained in:
Michał Gdula 2023-09-11 23:33:27 +01:00 committed by GitHub
commit 9b4d44f142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 15 deletions

View file

@ -17,14 +17,18 @@ class Animals(commands.Cog):
animal_choice = animal_choice.lower().strip() or None animal_choice = animal_choice.lower().strip() or None
if not animal_choice: if not animal_choice:
error = f"You need to specify an animal! " \ error = (
f"Try one of these: {', '.join(TINYFOX_ANIMALS)}" f"You need to specify an animal! "
f"Try one of these: {', '.join(TINYFOX_ANIMALS)}"
)
await ctx.reply(embed=error_message(error)) await ctx.reply(embed=error_message(error))
return return
if animal_choice not in TINYFOX_ANIMALS: if animal_choice not in TINYFOX_ANIMALS:
error = f"That animal doesn't exist! " \ error = (
f"Try one of these: {', '.join(TINYFOX_ANIMALS)}" f"That animal doesn't exist! "
f"Try one of these: {', '.join(TINYFOX_ANIMALS)}"
)
await ctx.reply(embed=error_message(error)) await ctx.reply(embed=error_message(error))
return return

View file

@ -15,7 +15,7 @@ class Help(commands.Cog):
"stop": "Stop the current song and leave the voice channel", "stop": "Stop the current song and leave the voice channel",
"animal <animal>": "Get a random image of an animal!", "animal <animal>": "Get a random image of an animal!",
"overlay <image> <style>": "Overlay an image with a " "overlay <image> <style>": "Overlay an image with a "
"style, e.g. `bubble mask`", "style, e.g. `bubble mask`",
"saveable": "Turn image into a GIF to save within Discord", "saveable": "Turn image into a GIF to save within Discord",
} }

View file

@ -64,8 +64,10 @@ class Img(commands.Cog):
return return
if overlay_style not in IMAGE_OVERLAYS[overlay_choice]["options"]: if overlay_style not in IMAGE_OVERLAYS[overlay_choice]["options"]:
error = f"{overlay_choice} has these " \ error = (
f"options: {', '.join(IMAGE_OVERLAYS[overlay_choice]['options'])}" f"{overlay_choice} has these "
f"options: {', '.join(IMAGE_OVERLAYS[overlay_choice]['options'])}"
)
await ctx.reply(embed=error_message(error)) await ctx.reply(embed=error_message(error))
return return
@ -75,8 +77,10 @@ class Img(commands.Cog):
).lower() ).lower()
file_extension = file_name.split(".")[-1] file_extension = file_name.split(".")[-1]
if file_extension not in IMAGE_EXTENSIONS: if file_extension not in IMAGE_EXTENSIONS:
error = f"Unsupported file type! Use one " \ error = (
f"of these: {', '.join(IMAGE_EXTENSIONS)}" f"Unsupported file type! Use one "
f"of these: {', '.join(IMAGE_EXTENSIONS)}"
)
await ctx.reply(embed=error_message(error)) await ctx.reply(embed=error_message(error))
return return
@ -191,8 +195,10 @@ class Img(commands.Cog):
).lower() ).lower()
file_extension = file_name.split(".")[-1] file_extension = file_name.split(".")[-1]
if file_extension not in IMAGE_EXTENSIONS: if file_extension not in IMAGE_EXTENSIONS:
error = f"Unsupported file type! Use one " \ error = (
f"of these: {', '.join(IMAGE_EXTENSIONS)}" f"Unsupported file type! Use one "
f"of these: {', '.join(IMAGE_EXTENSIONS)}"
)
await ctx.reply(embed=error_message(error)) await ctx.reply(embed=error_message(error))
return return

View file

@ -24,10 +24,7 @@ class Music(commands.Cog):
async with ctx.typing(): async with ctx.typing():
song_info = ytdl.extract_info(url, download=False) song_info = ytdl.extract_info(url, download=False)
ctx.voice_client.play( ctx.voice_client.play(
discord.FFmpegPCMAudio( discord.FFmpegPCMAudio(song_info["url"], **ffmpeg_options)
song_info["url"],
**ffmpeg_options
)
) )
embed = discord.Embed( embed = discord.Embed(