diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-08-27 11:32:44 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-08-27 11:32:44 +0100 |
| commit | f8f3bd0b1eb57c5a289513200b192e1d54d58292 (patch) | |
| tree | c9b79515fb81d90320ef386a522a5830875f6d49 /TimeHACK.Engine/MessageParser.cs | |
| parent | bffcb720f811623015ed4795032e5c57d1064c8a (diff) | |
| parent | cd6273d7c95098e0e0dd9948c6b5cec1c5f9cd3f (diff) | |
| download | histacom2-f8f3bd0b1eb57c5a289513200b192e1d54d58292.tar.gz histacom2-f8f3bd0b1eb57c5a289513200b192e1d54d58292.tar.bz2 histacom2-f8f3bd0b1eb57c5a289513200b192e1d54d58292.zip | |
Updated my fork!
Diffstat (limited to 'TimeHACK.Engine/MessageParser.cs')
| -rw-r--r-- | TimeHACK.Engine/MessageParser.cs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/TimeHACK.Engine/MessageParser.cs b/TimeHACK.Engine/MessageParser.cs deleted file mode 100644 index 6a13ae6..0000000 --- a/TimeHACK.Engine/MessageParser.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TimeHACK.Engine -{ - public class MessageParser - { - public string ParseMessage(string json, int index, string user) - { - JObject message = JObject.Parse(JObject.Parse(json)["messages"][index].ToString()); - string newmsg = message["message"].ToString().Replace("@user", user); - if (!message["special"].ToString().StartsWith(".")) newmsg += Environment.NewLine; - if (message["userchat"].ToObject<bool>()) return message["user"].ToString() + ": " + newmsg; - else return newmsg; - } - public int GetMessageDelay(string json, int index) - { - JObject message = JObject.Parse(JObject.Parse(json)["messages"][index].ToString()); - return message["delay"].ToObject<int>(); - } - public string GetSpecial(string json, int index) - { - JObject message = JObject.Parse(JObject.Parse(json)["messages"][index].ToString()); - return message["special"].ToString(); - } - } -} |
