Skip to content

Commit

Permalink
black format
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkyIsAKing committed Nov 28, 2024
1 parent ec363c7 commit df4d7ec
Showing 1 changed file with 40 additions and 43 deletions.
83 changes: 40 additions & 43 deletions redbot/cogs/streams/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ async def _streamset_refresh_timer(self, ctx: commands.Context, refresh_time: in

await self.config.refresh_timer.set(refresh_time)
await ctx.send(
_("Refresh timer set to {refresh_time} seconds").format(refresh_time=refresh_time))
_("Refresh timer set to {refresh_time} seconds").format(refresh_time=refresh_time)
)

@streamset.command()
@commands.is_owner()
Expand Down Expand Up @@ -614,32 +615,31 @@ async def check_messages(self, ctx: commands.Context, streamer_name: str):
if stream.name.lower() == streamer_name.lower():
try:
await ctx.send(
_(
"`{}`'s nomention message is set as: `{}`").format(
streamer_name, stream.nomention_message
)
_("`{}`'s nomention message is set as: `{}`").format(
streamer_name, stream.nomention_message
)
)
except AttributeError:
await ctx.send(
_("`{}` does not have a nomention message.").format(streamer_name))
_("`{}` does not have a nomention message.").format(streamer_name)
)
try:
await ctx.send(
_(
"`{}`'s mention message is set as: `{}` to `{}`").format(
streamer_name, stream.mention_message, stream.who_to_mention
)
_("`{}`'s mention message is set as: `{}` to `{}`").format(
streamer_name, stream.mention_message, stream.who_to_mention
)
)
except AttributeError:
await ctx.send(
_("`{}` does not have a mention message.").format(streamer_name))
_("`{}` does not have a mention message.").format(streamer_name)
)
return

await ctx.send(
_(
"Streamer `{}` is not registered and therefore does not have any custom messages.").format(
streamer_name
)
)
"Streamer `{}` is not registered and therefore does not have any custom messages."
).format(streamer_name)
)
return

# @checks.mod_or_permissions(manage_channels=True)
Expand Down Expand Up @@ -687,11 +687,10 @@ async def custom_message(
msg = to_mention + " " + msg
stream.nomention_message = msg
await ctx.send(
_(
"Custom nomention message streamer `{streamer}` set").format(
streamer=streamer_name
)
_("Custom nomention message streamer `{streamer}` set").format(
streamer=streamer_name
)
)
await self.save_streams()
break
else:
Expand All @@ -701,10 +700,9 @@ async def custom_message(
if not_found:
await ctx.send(
_(
"Streamer `{streamer}` not registered, please look at `[p]streamalert help`").format(
streamer=streamer_name
)
)
"Streamer `{streamer}` not registered, please look at `[p]streamalert help`"
).format(streamer=streamer_name)
)
return

@message.command(name="remove")
Expand Down Expand Up @@ -751,7 +749,8 @@ async def remove_message(self, ctx: commands.Context, name: str, mention: str):

if not_found:
await ctx.send(
_("Streamer `{}` not registered. No message(s) to remove.").format(name))
_("Streamer `{}` not registered. No message(s) to remove.").format(name)
)
return

await self.save_streams()
Expand All @@ -770,32 +769,31 @@ async def check_messages(self, ctx: commands.Context, streamer_name: str):
if stream.name.lower() == streamer_name.lower():
try:
await ctx.send(
_(
"`{}`'s nomention message is set as: `{}`").format(
streamer_name, stream.nomention_message
)
_("`{}`'s nomention message is set as: `{}`").format(
streamer_name, stream.nomention_message
)
)
except AttributeError:
await ctx.send(
_("`{}` does not have a nomention message.").format(streamer_name))
_("`{}` does not have a nomention message.").format(streamer_name)
)
try:
await ctx.send(
_(
"`{}`'s mention message is set as: `{}` to `{}`").format(
streamer_name, stream.mention_message, stream.who_to_mention
)
_("`{}`'s mention message is set as: `{}` to `{}`").format(
streamer_name, stream.mention_message, stream.who_to_mention
)
)
except AttributeError:
await ctx.send(
_("`{}` does not have a mention message.").format(streamer_name))
_("`{}` does not have a mention message.").format(streamer_name)
)
return

await ctx.send(
_(
"Streamer `{}` is not registered and therefore does not have any custom messages.").format(
streamer_name
)
)
"Streamer `{}` is not registered and therefore does not have any custom messages."
).format(streamer_name)
)
return

# @checks.mod_or_permissions(manage_channels=True)
Expand Down Expand Up @@ -1226,11 +1224,10 @@ async def check_streams(self):
channel.guild
).live_message_mention()
if hasattr(stream, "mention_message"):
content = _(
"{mention}, {mention_message}").format(
mention=stream.who_to_mention,
mention_message=stream.mention_message,
)
content = _("{mention}, {mention_message}").format(
mention=stream.who_to_mention,
mention_message=stream.mention_message,
)
elif alert_msg:
content = alert_msg # Stop bad things from happening here...
content = content.replace(
Expand Down

0 comments on commit df4d7ec

Please sign in to comment.