Skip to content

Commit

Permalink
Adds support for the /me message event.
Browse files Browse the repository at this point in the history
  • Loading branch information
Overv committed Jan 27, 2012
1 parent 9115a7f commit fcc9df3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -74,6 +74,7 @@ public enum UpdateType
{ {
UserUpdate, UserUpdate,
Message, Message,
Emote,
TypingNotification TypingNotification
} }
``` ```
Expand Down
13 changes: 10 additions & 3 deletions SteamAPISession.cs
Expand Up @@ -69,6 +69,7 @@ public enum UpdateType
{ {
UserUpdate, UserUpdate,
Message, Message,
Emote,
TypingNotification TypingNotification
} }


Expand Down Expand Up @@ -536,6 +537,13 @@ public bool SendMessage( User user, String message )
return false; return false;
} }
} }

public bool SendMessage( String steamid, String message )
{
User user = new User();
user.steamid = steamid;
return SendMessage( user, message );
}


/// <summary> /// <summary>
/// Check for updates and new messages. /// Check for updates and new messages.
Expand Down Expand Up @@ -565,9 +573,9 @@ public List<Update> Poll()
update.origin = (String)info["steamid_from"]; update.origin = (String)info["steamid_from"];


String type = (String)info["type"]; String type = (String)info["type"];
if ( type.Equals( "saytext" ) || type.Equals( "my_saytext" ) ) if ( type.Equals( "saytext" ) || type.Equals( "my_saytext" ) || type.Equals( "emote" ) )
{ {
update.type = UpdateType.Message; update.type = type.Equals( "emote" ) ? UpdateType.Emote : UpdateType.Message;
update.message = (String)info["text"]; update.message = (String)info["text"];
update.localMessage = type.Equals( "my_saytext" ); update.localMessage = type.Equals( "my_saytext" );
} }
Expand All @@ -584,7 +592,6 @@ public List<Update> Poll()
} }
else else
{ {
Console.WriteLine( "Unknown type: " + type );
continue; continue;
} }


Expand Down

0 comments on commit fcc9df3

Please sign in to comment.