Список параметров для метода Message.GetHistory http://vk.com/dev/messages.getHistory
예제 #1
0
 /// <summary>
 /// Привести к типу VkParameters.
 /// </summary>
 /// <param name="p">Параметры.</param>
 /// <returns></returns>
 public static VkParameters ToVkParameters(MessagesGetHistoryParams p)
 {
     return(new VkParameters
     {
         { "offset", p.Offset },
         { "count", p.Count },
         { "user_id", p.UserId },
         { "peer_id", p.PeerId },
         { "start_message_id", p.StartMessageId },
         { "rev", p.Reversed }
     });
 }
예제 #2
0
 /// <summary>
 /// Привести к типу VkParameters.
 /// </summary>
 /// <param name="p">Параметры.</param>
 /// <returns></returns>
 internal static VkParameters ToVkParameters(MessagesGetHistoryParams p)
 {
     return new VkParameters
     {
         { "offset", p.Offset },
         { "count", p.Count },
         { "user_id", p.UserId },
         { "peer_id", p.PeerId },
         { "start_message_id", p.StartMessageId },
         { "rev", p.Reversed }
     };
 }
예제 #3
0
        public ReadOnlyCollection<Message> GetHistory(out int totalCount, bool isChat, long id, int? offset = null, uint? count = 20,
            long? startMessageId = null, bool inReverse = false)
        {
            var parameters = new MessagesGetHistoryParams
            {
                Offset = offset,
                StartMessageId = startMessageId,
                Reversed = inReverse,
                PeerId = isChat ? id : (long?)null,
                UserId = isChat ? (long?)null : id,
                Count = count.Value
            };

            var response = _vk.Call("messages.getHistory", parameters);

            totalCount = response["count"];

            return GetHistory(parameters).Messages;
        }