reformat with black

This commit is contained in:
mudkipdev
2023-05-07 14:05:02 -06:00
parent e7cf787b3f
commit 3fd4729766

View File

@@ -344,11 +344,11 @@ class AnnouncementBuilderView(discord.ui.View):
announcement = self.announcement_builder.announcement announcement = self.announcement_builder.announcement
role = announcement.ping role = announcement.ping
allowed_mentions = discord.AllowedMentions( allowed_mentions = (
everyone=False, discord.AllowedMentions(everyone=False, users=False, roles=[role])
users=False, if role
roles=[role] else discord.AllowedMentions.none()
) if role else discord.AllowedMentions.none() )
if self.announcement_builder.edit: if self.announcement_builder.edit:
await interaction.response.send_message( await interaction.response.send_message(
@@ -360,8 +360,7 @@ class AnnouncementBuilderView(discord.ui.View):
embed.remove_footer() embed.remove_footer()
await self.announcement_builder.message.edit( await self.announcement_builder.message.edit(
content=role.mention if role else None, content=role.mention if role else None, embed=embed
embed=embed
) )
return return
@@ -383,19 +382,20 @@ class AnnouncementBuilderView(discord.ui.View):
) )
self.stop() self.stop()
message = await announcement.channel.send(embed=await announcement.get_embed(bot=interaction.client),) message = await announcement.channel.send(
embed=await announcement.get_embed(bot=interaction.client),
)
if announcement.will_notify: if announcement.will_notify:
await message.publish() await message.publish()
if announcement.ping and announcement.ping_preview: if announcement.ping and announcement.ping_preview:
await announcement.channel.send( await announcement.channel.send(
f"{announcement.ping.mention} - {announcement.ping_preview}", f"{announcement.ping.mention} - {announcement.ping_preview}",
allowed_mentions=allowed_mentions allowed_mentions=allowed_mentions,
) )
elif announcement.ping: elif announcement.ping:
await announcement.channel.send( await announcement.channel.send(
announcement.ping.mention, announcement.ping.mention, allowed_mentions=allowed_mentions
allowed_mentions=allowed_mentions
) )