Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Streams] Allow for consume all on messages #4183

Merged
merged 3 commits into from Aug 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next
Added consume all to streams.
  • Loading branch information
Kowlin committed Aug 11, 2020
commit e269ea0d3bc88417163c18431b1df38a9be92bfc
22 changes: 13 additions & 9 deletions redbot/cogs/streams/streams.py
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,10 @@ 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 +735,9 @@ 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