Skip to content

Commit

Permalink
Merge pull request #15 from DezBirdss/deepsource-autofix-5eb85bf3
Browse files Browse the repository at this point in the history
refactor: remove unnecessary f-string
  • Loading branch information
bugsbirb authored Apr 12, 2024
2 parents e79b86c + f97cd28 commit 6f2b10f
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Cogs/Configuration/Configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ async def callback(self, interaction: discord.Interaction):
embed = discord.Embed(title=f"<:command1:1199456319363633192> Custom Commands ({amount}/25)", description="", color=discord.Color.dark_embed())
embed.set_thumbnail(url=interaction.guild.icon)
embed.set_author(name=interaction.guild.name, icon_url=interaction.guild.icon)
embed.add_field(name=f"<:settings:1207368347931516928> Custom Commands Configuration", value=f"{replytop}**Enabled:** {modulemsg}\n{replybottom}**Logging Channel:** {loggingmsg}")
embed.add_field(name="<:settings:1207368347931516928> Custom Commands Configuration", value=f"{replytop}**Enabled:** {modulemsg}\n{replybottom}**Logging Channel:** {loggingmsg}")
for result in commands:
permissions = result.get('permissionroles', 'None')
if permissions == 'None':
Expand Down
8 changes: 4 additions & 4 deletions Cogs/Configuration/Views/CustomCommandsView.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def on_submit(self, interaction: discord.Interaction):
if amount >= 25:
embed = discord.Embed()
embed.title = f"{redx} {amount}/25"
embed.description=f"You have reached the maximum amount of custom commands."
embed.description="You have reached the maximum amount of custom commands."
embed.color = discord.Color.brand_red()
await interaction.response.edit_message(embed=embed, view=None)

Expand All @@ -91,7 +91,7 @@ async def on_submit(self, interaction: discord.Interaction):
embed = discord.Embed()
embed.title = f"{redx} That already exists!"
embed.color = discord.Color.brand_red()
embed.description=f"Please try again."
embed.description="Please try again."
await interaction.response.edit_message(embed=embed, view=None)
return
name = self.name.value
Expand Down Expand Up @@ -121,7 +121,7 @@ async def on_submit(self, interaction: discord.Interaction):
embed = interaction.message.embeds[0]
if result is None:
embed.title = f"{redx} I could not find that."
embed.description=f"I could not find the command you were trying to edit please try again."
embed.description="I could not find the command you were trying to edit please try again."
embed.color = discord.Color.brand_red()
embed.clear_fields()
await interaction.response.edit_message(embed=embed, view=None)
Expand Down Expand Up @@ -879,7 +879,7 @@ async def refreshembed(interaction):
embed = discord.Embed(title=f"<:command1:1199456319363633192> Custom Commands ({amount}/25)", description="", color=discord.Color.dark_embed())
embed.set_thumbnail(url=interaction.guild.icon)
embed.set_author(name=interaction.guild.name, icon_url=interaction.guild.icon)
embed.add_field(name=f"<:settings:1207368347931516928> Custom Commands Configuration", value=f"{replytop}**Enabled:** {modulemsg}\n{replybottom}**Logging Channel:** {loggingmsg}")
embed.add_field(name="<:settings:1207368347931516928> Custom Commands Configuration", value=f"{replytop}**Enabled:** {modulemsg}\n{replybottom}**Logging Channel:** {loggingmsg}")
for result in commands:
permissions = result.get('permissionroles', 'None')
if permissions == 'None':
Expand Down
4 changes: 2 additions & 2 deletions Cogs/Configuration/Views/Customationview.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def callback(self, interaction: discord.Interaction):
color=discord.Colour.brand_red())
return await interaction.response.send_message(embed=embed, ephemeral=True)
if color == "Promotions":
embed = discord.Embed(title=f"Staff Promotion", color=0x2b2d31, description="* **User:** {staff.mention}\n* **Updated Rank:** {newrank}\n* **Reason:** {reason}")
embed = discord.Embed(title="Staff Promotion", color=0x2b2d31, description="* **User:** {staff.mention}\n* **Updated Rank:** {newrank}\n* **Reason:** {reason}")
embed.set_author(name="Signed, {author.name}", icon_url=interaction.user.display_avatar)
embed.set_thumbnail(url=interaction.user.display_avatar)
view = Infraction(interaction.user, color)
Expand All @@ -81,7 +81,7 @@ async def callback(self, interaction: discord.Interaction):
embed = discord.Embed(title="Staff Consequences & Discipline", description="* **Staff Member:** {staff.mention}\n* **Action:** {action}\n* **Reason:** {reason}", color=discord.Color.dark_embed())
embed.set_thumbnail(url=interaction.user.display_avatar)
embed.set_author(name="Signed, {author.name}", icon_url=interaction.user.display_avatar)
embed.set_footer(text=f"Infraction ID | Test")
embed.set_footer(text="Infraction ID | Test")
view = Infraction(interaction.user, color)
await interaction.response.edit_message(embed=embed, view=view)
embed = discord.Embed(title="Embed Variables", description="**Infractions**\n**Author Name:** {author.name}\n**Staff Name:** {staff}\n**Notes:** {notes}\n**Action:** {action}\n**Reason:** {reason}\n\n**Promotions**\n**Author Name:** {author.name}\n**Staff Name:** {staff}\n**New Rank:** {newrank}\n**Expiration:** {expiration}", color=discord.Color.dark_embed())
Expand Down
12 changes: 6 additions & 6 deletions Cogs/Configuration/Views/applicationsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async def on_submit(self, interaction: discord.Interaction):
return
await application.insert_one({'guild_id': interaction.guild.id, 'name': self.name.value, 'saved': False})
view = SectionButtons(author=self.author, name=self.name.value)
embed = discord.Embed(title=f"Application Builder", description=f"No added sections...", color=discord.Colour.dark_embed())
embed = discord.Embed(title="Application Builder", description="No added sections...", color=discord.Colour.dark_embed())
embed.set_thumbnail(url=interaction.guild.icon)
embed.set_author(
name=interaction.user.name,
Expand Down Expand Up @@ -357,7 +357,7 @@ async def on_submit(self, interaction: discord.Interaction):
await interaction.response.send_message(f"{no} I couldn't find the application specified.", ephemeral=True)
return
view = SectionButtons(author=self.author, name=self.name.value)
embed = discord.Embed(title=f"Application Builder", description="", color=discord.Colour.dark_embed())
embed = discord.Embed(title="Application Builder", description="", color=discord.Colour.dark_embed())
embed.set_thumbnail(url=interaction.guild.icon)
embed.set_author(
name=interaction.user.name,
Expand Down Expand Up @@ -395,7 +395,7 @@ async def on_submit(self, interaction: discord.Interaction):
view.section5.disabled = False
view.save.disabled = False
else:
embed.description = f"No sections found for this application."
embed.description = "No sections found for this application."



Expand Down Expand Up @@ -447,7 +447,7 @@ async def section5(self, interaction: discord.Interaction, button: discord.ui.Bu
return await interaction.response.send_message(embed=embed, ephemeral=True)
await interaction.response.send_modal(Section5(author=self.author, name=self.name))

@discord.ui.button(style=discord.ButtonStyle.gray, label="Required Roles", emoji=f"<:Role:1162074735803387944>")
@discord.ui.button(style=discord.ButtonStyle.gray, label="Required Roles", emoji="<:Role:1162074735803387944>")
async def role(self, interaction: discord.Interaction, button:discord.ui.Button):
if interaction.user.id != self.author.id:
embed = discord.Embed(description=f"**{interaction.user.global_name},** this is not your view",
Expand All @@ -457,7 +457,7 @@ async def role(self, interaction: discord.Interaction, button:discord.ui.Button)
view.add_item(RequiredRoles(self.author, self.name))
await interaction.response.send_message(view=view, ephemeral=True)

@discord.ui.button(style=discord.ButtonStyle.gray, label="Accepted Roles", emoji=f"<:Role:1162074735803387944>")
@discord.ui.button(style=discord.ButtonStyle.gray, label="Accepted Roles", emoji="<:Role:1162074735803387944>")
async def acceptedroles(self, interaction: discord.Interaction, button:discord.ui.Button):
if interaction.user.id != self.author.id:
embed = discord.Embed(description=f"**{interaction.user.global_name},** this is not your view",
Expand All @@ -477,7 +477,7 @@ async def save(self, interaction: discord.Interaction, button:discord.ui.Button)
await application.update_one({'guild_id': interaction.guild.id, 'name': self.name}, {'$set': {'saved': True}})
embed = discord.Embed(color=discord.Color.brand_green())
embed.title =f"{greencheck} Succesfully Saved"
embed.description = f"Application Successfully saved!"
embed.description = "Application Successfully saved!"
await interaction.response.edit_message(
embed=embed,
view=None
Expand Down
4 changes: 2 additions & 2 deletions Cogs/Configuration/Views/staffpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ async def Finish(self, interaction: discord.Interaction, button: discord.ui.Butt
Customisation.update_one({"name": "Staff Panel", "guild_id": interaction.guild.id}, {"$set": embed_data}, upsert=True)
embed = discord.Embed()
embed.title = f"{greencheck} Succesfully Updated"
embed.description = f"Start by using /staffpanel"
embed.description = "Start by using /staffpanel"
embed.color = discord.Colour.brand_green()
await interaction.response.edit_message(content=None, embed=embed, view=None)

Expand Down Expand Up @@ -472,7 +472,7 @@ async def Finish(self, interaction: discord.Interaction, button: discord.ui.Butt
await Customisation.update_one({"name": "Staff Panel", "guild_id": interaction.guild.id}, {"$set": embed_data}, upsert=True)
embed = discord.Embed()
embed.title = f"{greencheck} Succesfully Updated"
embed.description = f"Start by using /staff panel"
embed.description = "Start by using /staff panel"
embed.color = discord.Colour.brand_green()
await interaction.response.edit_message(content=None, embed=embed, view=None)

Expand Down
6 changes: 3 additions & 3 deletions Cogs/Configuration/Views/welcomeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ async def Finish(self, interaction: discord.Interaction, button: discord.ui.Butt
await welcome.update_one({"guild_id": interaction.guild.id}, {"$set": embed_data}, upsert=True)
embed = discord.Embed()
embed.title = f"{greencheck} Success!"
embed.description = f"Your welcome message has been updated!"
embed.description = "Your welcome message has been updated!"
embed.color = discord.Colour.brand_green()
await interaction.response.edit_message(content=None, embed=embed, view=None)

Expand Down Expand Up @@ -678,7 +678,7 @@ async def Finish(self, interaction: discord.Interaction, button: discord.ui.Butt
await welcome.update_one({"guild_id": interaction.guild.id}, {"$set": embed_data}, upsert=True)
embed = discord.Embed()
embed.title = f"{greencheck} Success!"
embed.description = f"Your welcome message has been updated!"
embed.description = "Your welcome message has been updated!"
embed.color = discord.Colour.brand_green()
await interaction.response.edit_message(content=None, embed=embed, view=None)

Expand Down Expand Up @@ -718,6 +718,6 @@ async def refreshembed(interaction):
class Button(discord.ui.View):
def __init__(self):
super().__init__()
url = f'https://discord.gg/DhWdgfh3hN'
url = 'https://discord.gg/DhWdgfh3hN'

self.add_item(discord.ui.Button(label='All Variables', url="https://docs.astrobirb.dev/astro-birb/configuration/variables", style=discord.ButtonStyle.blurple, emoji="📚"))
2 changes: 1 addition & 1 deletion Cogs/Events/AstroSupport/topgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def update_stats(self):
await self.client.topggpy.post_guild_count()
print(f"[🔝] Posted server count ({self.client.topggpy.guild_count})")
except Exception as e:
print(f"[⬇️] Failed to post server count")
print("[⬇️] Failed to post server count")



Expand Down
2 changes: 1 addition & 1 deletion Cogs/Events/AstroSupport/webhookguilds.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def on_guild_join(self, guild: discord.Guild):
class Support(discord.ui.View):
def __init__(self):
super().__init__()
url1 = f'https://discord.gg/DhWdgfh3hN'
url1 = 'https://discord.gg/DhWdgfh3hN'
self.add_item(discord.ui.Button(label='Support Server', url=url1, style=discord.ButtonStyle.blurple, emoji="<:link:1206670134064717904>"))
self.add_item(discord.ui.Button(label='Documentation', url="https://docs.astrobirb.dev/overview", style=discord.ButtonStyle.blurple, emoji="📚"))

Expand Down
6 changes: 3 additions & 3 deletions Cogs/Events/modmailevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def on_message(self, message: discord.Message):
if isinstance(message.channel, discord.DMChannel):
user_id = message.author.id
modmail_data = await modmail.find_one({'user_id': user_id})
if message.content == f"!close":
if message.content == "!close":
if not modmail_data:
await message.author.send(f"{no} You are not in a modmail conversation.")
return
Expand Down Expand Up @@ -211,7 +211,7 @@ def check(response):
if modmailpingresult:
modmailroles = [f'<@&{roleid}>' for sublist in modmailpingresult['modmailping'] for roleid in sublist if selected_server.get_role(roleid) is not None]
modmailroles = ", ".join(filter(None, modmailroles))
info = discord.Embed(title=f"Member Information", description=f"* **User:** {message.author.mention}\n* **Joined:** <t:{int(user.joined_at.timestamp())}:F>\n* **Created:** <t:{int(user.created_at.timestamp())}:F>",timestamp=datetime.utcnow(), color=discord.Color.dark_embed())
info = discord.Embed(title="Member Information", description=f"* **User:** {message.author.mention}\n* **Joined:** <t:{int(user.joined_at.timestamp())}:F>\n* **Created:** <t:{int(user.created_at.timestamp())}:F>",timestamp=datetime.utcnow(), color=discord.Color.dark_embed())
if user_roles:
info.add_field(name=f"Roles [{rolecount}]", value=user_roles, inline=False)
info.set_author(name=message.author, icon_url=message.author.display_avatar)
Expand Down Expand Up @@ -239,7 +239,7 @@ def check(response):
await msg.reply("<:Image:1195058849741295748> **Attachment(s)** sent by the user.", files=files)
return
else:
await channel.send(f"<:Image:1195058849741295748> **Attachment(s)** sent by the user.", files=files)
await channel.send("<:Image:1195058849741295748> **Attachment(s)** sent by the user.", files=files)
return
try:
await channel.send(embed=embed)
Expand Down
8 changes: 4 additions & 4 deletions Cogs/Modules/adminpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def on_submit(self, interaction: discord.Interaction):

if channel:
embed = discord.Embed(
title=f"LOA Created",
title="LOA Created",
description=f"* **User:** {self.user.mention}\n* **Start Date**: <t:{int(start_time.timestamp())}:f>\n* **End Date:** <t:{int(end_time.timestamp())}:f>\n* **Reason:** {self.reason}",
color=discord.Color.dark_embed(),
)
Expand Down Expand Up @@ -338,7 +338,7 @@ async def on_submit(self, interaction: discord.Interaction):
else:

embed = discord.Embed(
title=f"Staff Promotion",
title="Staff Promotion",
color=0x2B2D31,
description=f"* **User:** {self.user.mention}\n* **Updated Rank:** {role.mention}\n* **Reason:** {reason}",
)
Expand Down Expand Up @@ -1188,7 +1188,7 @@ async def LOA(self, interaction: discord.Interaction, button: discord.ui.Button)

embed = discord.Embed(
title="Leave Of Absense",
description=f"\n".join(description),
description="\n".join(description),
color=discord.Color.dark_embed(),
)
embed.set_thumbnail(url=self.user.display_avatar)
Expand All @@ -1203,7 +1203,7 @@ async def LOA(self, interaction: discord.Interaction, button: discord.ui.Button)
reason = loaa["reason"]

embed = discord.Embed(
title=f"Leave Of Absence",
title="Leave Of Absence",
color=discord.Color.dark_embed(),
description=f"{loa} **Active LOA**\n{arrow}**Start Date:** <t:{int(start_time.timestamp())}:f>\n{arrow}**End Date:** <t:{int(end_time.timestamp())}:f>\n{arrow}**Reason:** {reason}",
)
Expand Down
4 changes: 2 additions & 2 deletions Cogs/Modules/astro.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def analytics(self, ctx: commands.Context):
embed = discord.Embed(title="Command Analytics", description=description, color=discord.Color.dark_embed())
embed.set_thumbnail(url=ctx.guild.icon)
embed.set_author(name=ctx.guild.name, icon_url=ctx.guild.icon)
embed.set_footer(text=f"Analytics started on 14th December 2024",
embed.set_footer(text="Analytics started on 14th December 2024",
icon_url="https://media.discordapp.net/ephemeral-attachments/1114281227579559998/1197680763341111377/1158064756104630294.png?ex=65bc2621&is=65a9b121&hm=9e278e5e96573663fb42396dd52e56ece56ba6af59e53f9720873ca484fabf19&=&format=webp&quality=lossless")
await ctx.send(embed=embed)

Expand Down Expand Up @@ -124,7 +124,7 @@ async def guildinfo(self, ctx: commands.Context, guildid: int):
embed.add_field(name=f"{Settings} Basic Settings",
value=f"**Admin Roles:** {adminrolemessage}\n**Staff Roles:** {staffrolemessage}")
if modules_info:
embed.add_field(name=f"Modules", value=modules_info, inline=False)
embed.add_field(name="Modules", value=modules_info, inline=False)
embed.set_author(name=guild.name, icon_url=guild.icon)

await ctx.send(embed=embed)
Expand Down
4 changes: 2 additions & 2 deletions Cogs/Modules/customcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async def run(self, ctx: commands.Context, command, channel: discord.TextChannel
loggingchannel = self.client.get_channel(loggingdata["channel_id"])
if loggingchannel:
embed = discord.Embed(
title=f"Custom Command Usage",
title="Custom Command Usage",
description=f"Command **{command}** was used by {ctx.author.mention} in {ctx.channel.mention}",
color=discord.Color.dark_embed(),
)
Expand Down Expand Up @@ -234,7 +234,7 @@ async def run(self, ctx: commands.Context, command, channel: discord.TextChannel
loggingchannel = self.client.get_channel(loggingdata["channel_id"])
if loggingchannel:
embed = discord.Embed(
title=f"Custom Command Usage",
title="Custom Command Usage",
description=f"Command **{command}** was used by {ctx.author.mention} in {ctx.channel.mention}",
color=discord.Color.dark_embed(),
)
Expand Down
Loading

0 comments on commit 6f2b10f

Please sign in to comment.