junepark678 / GIRRewrite

f-string used without any expression PTC-W0027
Anti-pattern
Major
a year agoa year old
f-string used without any expression
 20
 21def format_meme_page(_, entries, current_page, all_pages):
 22    embed = discord.Embed(
 23        title=f'All memes', color=discord.Color.blurple()) 24    for meme in entries:
 25        desc = f"Added by: {meme.added_by_tag}\nUsed {format_number(meme.use_count)} {'time' if meme.use_count == 1 else 'times'}"
 26        if meme.image.read() is not None:
f-string used without any expression
146            _file = discord.File(BytesIO(
147                _file), filename="image.gif" if meme.image.content_type == "image/gif" else "image.png")
148
149        await ctx.respond(f"Added new meme!", file=_file or discord.utils.MISSING, embed=await self.prepare_meme_embed(meme))150
151    @mod_and_up()
152    @memes.command(description="Edit an existing meme")
f-string used without any expression
200            _file = discord.File(BytesIO(
201                _file), filename="image.gif" if meme.image.content_type == "image/gif" else "image.png")
202
203        await ctx.respond(f"Meme edited!", file=_file or discord.utils.MISSING, embed=await self.prepare_meme_embed(meme))204
205    @mod_and_up()
206    @memes.command(description="Delete a meme")
f-string used without any expression
276        db_guild = guild_service.get_guild()
277        is_mod = gatekeeper.has(ctx.guild, ctx.author, 5)
278        if ctx.channel.id not in [db_guild.channel_general, db_guild.channel_botspam] and not is_mod:
279            raise commands.BadArgument(f"This command can't be used here.")280
281        if not is_mod:
282            bucket = self.res_cooldown.get_bucket(ctx.guild.name)
f-string used without any expression
345        db_guild = guild_service.get_guild()
346        is_mod = gatekeeper.has(ctx.guild, ctx.author, 5)
347        if ctx.channel.id not in [db_guild.channel_general, db_guild.channel_botspam] and not is_mod:
348            raise commands.BadArgument(f"This command can't be used here.")349
350        if not is_mod:
351            bucket = self.memegen_cooldown.get_bucket(ctx.guild.name)