Hi my friends!
I have this strange behavior sending text messages using the method SendTextMessageAsync:
When sending the message to the user, I first send a ChatAction (SendChatActionAsync (ID, ChatAction.Typing)). Sending this or not, the message takes more than 30 seconds to send. But if I receive another message while the one I am sending has not yet arrived, the process "unlocks" and the message arrives.
I'm forcing the message to not be sent asynchronously, using .GetAwaiter(). GetResult()
Are there any settings I should make or something am I doing wrong to make this happen?
Detail: Using GetAwaiter or not the message gets stuck.
Hi my friends! I have this strange behavior sending text messages using the method SendTextMessageAsync: When sending the message to the user, I first send a ChatAction (SendChatActionAsync (ID, ChatAction.Typing)). Sending this or not, the message takes more than 30 seconds to send. But if I receive another message while the one I am sending has not yet arrived, the process "unlocks" and the message arrives. I'm forcing the message to not be sent asynchronously, using .GetAwaiter(). GetResult() Are there any settings I should make or something am I doing wrong to make this happen?
Detail: Using GetAwaiter or not the message gets stuck.
Client Instance:
this.Client = new TelegramBotClient(this.BotKey);
this.Client.OnMessage += Client_OnMessage;
this.Client.OnMessageEdited += Client_OnMessage;
this.Client.OnReceiveError += Client_OnReceiveError;
this.Client.OnReceiveGeneralError += Client_OnReceiveGeneralError;
this.Client.StartReceiving();
Sending the Message:
Client.SendTextMessageAsync(message.UserInfo.ID, message.TextMessage, ParseMode.Markdown, true, true).GetAwaiter().GetResult();
Thanks in advance.