Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
no longer trigger callbacks for command messages starting with /
Browse files Browse the repository at this point in the history
  • Loading branch information
brian91292 committed Apr 6, 2019
1 parent d01c45f commit f9cb19f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Chat/Twitch/TwitchWebSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ private static void OnMessageReceived(string rawMessage, string assemblyHash = "
if (messageType.Groups["ChannelName"].Success)
twitchMsg.channelName = messageType.Groups["ChannelName"].Value;

// Skip any command messages, as if we're encountering one it came from the StreamCore client and would never be received by other clients (since it's a command)
if (twitchMsg.message.StartsWith("/"))
return;

// If this is a callback from the send function, populate it with our twitch users info/the current room info
if (assemblyHash != string.Empty)
{
Expand Down Expand Up @@ -513,7 +517,7 @@ private static void Ws_OnMessage(object sender, MessageEventArgs ev)
{
if (!ev.IsText) return;

//Plugin.Log($"RawMsg: {ev.Data}");
Plugin.Log($"RawMsg: {ev.Data}");
string rawMessage = ev.Data.TrimEnd();
if (rawMessage.StartsWith("PING"))
{
Expand Down
2 changes: 1 addition & 1 deletion StreamCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Changelog.md" />
<None Include="CHANGELOG.md" />
<Compile Include="Chat\ChatMessageBase.cs" />
<Compile Include="Chat\ChatUserBase.cs" />
<Compile Include="Chat\Twitch\TwitchRoom.cs" />
Expand Down

0 comments on commit f9cb19f

Please sign in to comment.