Fixed telegram #1667

This commit is contained in:
tidusjar 2017-11-03 21:22:53 +00:00
parent 55550f1b30
commit dd306aae5a

View file

@ -12,18 +12,18 @@ namespace Ombi.Api.Telegram
} }
private readonly IApi _api; private readonly IApi _api;
private const string BaseUrl = "https://api.telegram.org/bot"; private const string BaseUrl = "https://api.telegram.org/";
public async Task Send(string message, string botApi, string chatId, string parseMode) public async Task Send(string message, string botApi, string chatId, string parseMode)
{ {
var request = new Request($"{botApi}/sendMessage", BaseUrl, HttpMethod.Post); var request = new Request($"bot{botApi}/sendMessage", BaseUrl, HttpMethod.Post);
request.AddQueryString("chat_id", chatId);
var body = new var body = new
{ {
text = message, text = message,
parse_mode = parseMode parse_mode = parseMode,
chat_id= chatId
}; };
request.AddJsonBody(body); request.AddJsonBody(body);