오류

2016-05-31 1 views
2
var connector = new ConnectorClient(); 
List<ChannelAccount> participants = new List<ChannelAccount>(); 
var tBot = new ChannelAccount 
{ 
    ChannelId = "telegram", Address = "9digit", IsBot = true, Id = "salodkid_bot", Name = "salodkid_bot" 
}; 
participants.Add(tBot); 
var tUser = new ChannelAccount 
{ 
    ChannelId = "telegram", Address = "9digit", IsBot = false, Id = "dsalodki", Name = "dsalodki" 
}; 
participants.Add(tUser); 
Message message = new Message 
{ 
    From = tBot, 
    To = tUser, 
    Participants = participants.ToArray(), 
    Text = "Hey, what's up everyone?", 
    Language = "en" 
}; 
var obj = connector.Messages.SendMessage(message); 

처리되지 않은 예외 : Microsoft.Rest.HttpOperationException : ...에 : 봇은 ...에서 일치하지 않는 ...오류

무엇이 잘못 되었나요?

답변

1

Message.From.Address 필드는 다음과 같이 봇 ID를 포함해야합니다 :

var tBot = new ChannelAccount 
{ 
    ChannelId = "telegram", Address = "salodkid_bot", IsBot = true, Id = "salodkid_bot", Name = "salodkid_bot" 
};