Example #1
0
        internal static PrivateMessage FromJObject(JObject obj, BotUser user)
        {
            PrivateMessage msg = new PrivateMessage(user);

            msg._ID = obj.Value <long?>("Id") ?? 0;

            msg._Sender    = new User(obj["Sender"]["UserId"].Value <int>(), obj["Sender"]["UserName"].Value <string>());
            msg._Recipient = new User(obj["Recipient"]["UserId"].Value <int>(), obj["Recipient"]["UserName"].Value <string>());

            msg._Body    = obj.Value <string>("Body");
            msg._Subject = obj.Value <string>("Subject");

            msg._IsRead = obj.Value <bool?>("IsRead") ?? false;
            msg._IsReportAbuseDisplayed = obj.Value <bool?>("IsReportAbuseDisplayed") ?? false;
            msg._IsSystemMessage        = obj.Value <bool?>("IsSystemMessage") ?? false;

            string createdDT = obj.Value <string>("Created");
            string updatedDT = obj.Value <string>("Updated");

            //Console.WriteLine(info.DateTimeFormat.AbbreviatedMonthNames[0]);
            msg._Created = GetDateTimeFromString(createdDT);
            msg._Updated = GetDateTimeFromString(updatedDT);
            return(msg);
        }
Example #2
0
 internal PrivateMessage(BotUser recip)
 {
     _BotUser = recip;
 }
Example #3
0
 internal SendPrivateMessage(BotUser sender)
 {
     _Sender = sender;
 }