简体   繁体   English

Telegram.Bot错误

[英]Telegram.Bot error

I'm using Telegram.Bot package found here . 我正在使用在这里找到的 Telegram.Bot包。

This error is occurring, and fails my robot: 发生此错误,使我的机器人失败:

Error converting value "supergroup" to type 'Telegram.Bot.Types.ChatType'. 将值“ supergroup”转换为“ Telegram.Bot.Types.ChatType”类型时出错。
Path 'result[37].message.chat.type', line 39, position 316. 路径“ result [37] .message.chat.type”,第39行,位置316。

How do I diagnose and fix this problem? 如何诊断和解决此问题?

This library doesn't support supergroup chat type right now. 该库目前不支持supergroup聊天类型。
You should go to github and create issue, or find another library. 您应该转到github并创建问题,或找到另一个库。

This is a bug in calling APIs, Update DLLs and VS to Vs 2015 这是调用API,将DLL和VS更新到Vs 2015的错误

or use this code in C# 或在C#中使用此代码

  int offset = 0;
            while (true)
            {
            TryAgain:
                  try{
                Telegram.Bot.Types.Update[] updates = bot.GetUpdates(offset).Result;
                foreach (var update in updates)
                {
.. . . .. 
}
}

     catch (Exception ef)
            {
                Debug.WriteLine(ef.Message);
                if (ef.Message.Contains("Telegram.Bot.Types"))
                {
                    goto TryAgain; 
                }
            }  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM