|
|
@ -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);
|
|
|
|