Skip to content

Commit

Permalink
make usage message logic in sendAnnouncementColor more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
4rneee committed Mar 14, 2024
1 parent 17d770c commit 058560f
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/controllers/commands/builtin/twitch/Announce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,20 @@ QString sendAnnouncementColor(const CommandContext &ctx,

if (ctx.words.size() < 2)
{
ctx.channel->addMessage(makeSystemMessage(
QString("Usage: /announce%1 <message> - Call attention to your "
"message with a %1%2highlight.")
.arg(colorStr)
.arg(color == HelixAnnouncementColor::Primary ? "" : " ")));
QString usageMsg;
if (color == HelixAnnouncementColor::Primary)
{
usageMsg = "Usage: /announce <message> - Call attention to your "
"message with a highlight.";
}
else
{
usageMsg =
QString("Usage: /announce%1 <message> - Call attention to your "
"message with a %1 highlight.")
.arg(colorStr);
}
ctx.channel->addMessage(makeSystemMessage(usageMsg));
return "";
}

Expand Down Expand Up @@ -92,7 +101,8 @@ QString sendAnnouncementColor(const CommandContext &ctx,
});
return "";
}
} // namespace

} // namespace

namespace chatterino::commands {

Expand Down

0 comments on commit 058560f

Please sign in to comment.