Example #1
0
        public static string VkCheckVoiceMessage(this JsonCore.VK.MessageNew.Object item)
        {
            try
            {
                var attachmentsFwd = item?.Fwd_Messages?.FindAll(i => i != null && i.Attachments.Any()).SelectMany(i => i.Attachments).ToList();
                var findResultFwd  =
                    attachmentsFwd?.Find(l => !string.IsNullOrWhiteSpace(l.Doc?.Preview?.Audio_Msg.Link_Mp3));
                if (findResultFwd != null)
                {
                    return(findResultFwd.Doc.Preview.Audio_Msg.Link_Mp3);
                }
                var attachments = item?.Attachments;
                var findResult  =
                    attachments?.Find(l => !string.IsNullOrWhiteSpace(l.Doc?.Preview?.Audio_Msg.Link_Mp3));
                if (findResult != null)
                {
                    return(findResult.Doc.Preview.Audio_Msg.Link_Mp3);
                }

                return(string.Empty);
            }
            catch (Exception ex)
            {
                ex.Error();
                return(string.Empty);
            }
        }
Example #2
0
 public RCommandsItem(DateTime dateTime, string message, string strCommand, List <JsonCore.VK.MessageNew.Attachment> attachments, int fromId, int peerId, int id, EnumData.MessageCommand mCommand, JsonCore.VK.MessageNew.Object itemConversations)
 {
     DateTime          = dateTime;
     Message           = message;
     STRCommand        = strCommand;
     Attachments       = attachments;
     FromId            = fromId;
     PeerId            = peerId;
     Id                = id;
     MCommand          = mCommand;
     ItemConversations = itemConversations;
 }