Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions redbot/cogs/streams/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,13 @@ async def message(self, ctx: commands.Context):

@message.command(name="mention")
@commands.guild_only()
async def with_mention(self, ctx: commands.Context, message: str = None):
async def with_mention(self, ctx: commands.Context, *, message: str = None):
"""Set stream alert message when mentions are enabled.
Use `{mention}` in the message to insert the selected mentions.
Use `{stream}` in the message to insert the channel or user name.
Use `{stream.name}` in the message to insert the channel or user name.
For example: `[p]streamset message mention "{mention}, {stream.name} is live!"`
For example: `[p]streamset message mention {mention}, {stream} is live!`
"""
if message is not None:
guild = ctx.guild
Expand All @@ -515,12 +514,12 @@ async def with_mention(self, ctx: commands.Context, message: str = None):

@message.command(name="nomention")
@commands.guild_only()
async def without_mention(self, ctx: commands.Context, message: str = None):
async def without_mention(self, ctx: commands.Context, *, message: str = None):
"""Set stream alert message when mentions are disabled.
Use `{stream.name}` in the message to insert the channel or user name.
Use `{stream}` in the message to insert the channel or user name.
For example: `[p]streamset message nomention "{stream.name} is live!"`
For example: `[p]streamset message nomention {stream} is live!`
"""
if message is not None:
guild = ctx.guild
Expand Down Expand Up @@ -720,7 +719,12 @@ async def check_streams(self):
channel.guild
).live_message_mention()
if alert_msg:
content = alert_msg.format(mention=mention_str, stream=stream)
content = alert_msg # Stop bad things from happening here...
content = content.replace(
"{stream.name}", str(stream.name)
) # Backwards compatability
content = content.replace("{stream}", str(stream.name))
content = content.replace("{mention}", mention_str)
else:
content = _("{mention}, {stream} is live!").format(
mention=mention_str,
Expand All @@ -733,7 +737,11 @@ async def check_streams(self):
channel.guild
).live_message_nomention()
if alert_msg:
content = alert_msg.format(stream=stream)
content = alert_msg # Stop bad things from happening here...
content = content.replace(
"{stream.name}", str(stream.name)
) # Backwards compatability
content = content.replace("{stream}", str(stream.name))
else:
content = _("{stream} is live!").format(
stream=escape(
Expand Down