从通道读取消息时出现TLSharp错误

时间:2017-07-24 08:51:48

标签: c# android telegram

这是我从频道或聊天中阅读邮件的功能的一部分:

    public async Task GatherChatHistory(string channelName, string ch_id, string mid, int offset = 0, int minId = 0, int maxId = -1, int limit = 1)
    {
        Log.Info(Tag, "In GatherChatHistory Start ch_id = " + ch_id);

        int maximal = Convert.ToInt32(mid);

        try
        {
            var dialogs = (TLDialogs)await MainActivity.client.GetUserDialogsAsync();
            var chat = dialogs.chats.lists
                .OfType<TLChat>()
                .FirstOrDefault(c => c.title == channelName);

            Log.Info(Tag, "In GatherChatHistory After GetUserDialogAsync " + (chat != null));

            if (chat != null)
            {
                Log.Info(Tag, "ChТестat != null, " + channelName);
                try
                {
                    var tlAbsMessages =
                        await MainActivity.client.GetHistoryAsync(
                            new TLInputPeerChat { chat_id = chat.id }, offset,
                            minId, maxId, limit);
                    Log.Info(Tag, "After GetHistoryAsync");

                    var tlChannelMessages = (TLMessages)tlAbsMessages;

直到上周五,一切正常。在星期五,我开始在上面的代码的最后一串上获得异常:“无法将”TeleSharp.TL.Messages.TLMessagesSlice“转换为”TeleSharp.TL.Messages.TLMessages“。有人知道它的原因吗?也许Telegram改变了协议?

0 个答案:

没有答案