|
|
|
@ -51,7 +51,7 @@ namespace Ombi.Controllers.External
|
|
|
|
|
public TesterController(INotificationService service, IDiscordNotification notification, IEmailNotification emailN,
|
|
|
|
|
IPushbulletNotification pushbullet, ISlackNotification slack, IPushoverNotification po, IMattermostNotification mm,
|
|
|
|
|
IPlexApi plex, IEmbyApi emby, IRadarrApi radarr, ISonarrApi sonarr, ILogger<TesterController> log, IEmailProvider provider,
|
|
|
|
|
ICouchPotatoApi cpApi)
|
|
|
|
|
ICouchPotatoApi cpApi, ITelegramNotification telegram)
|
|
|
|
|
{
|
|
|
|
|
Service = service;
|
|
|
|
|
DiscordNotification = notification;
|
|
|
|
@ -67,6 +67,7 @@ namespace Ombi.Controllers.External
|
|
|
|
|
Log = log;
|
|
|
|
|
EmailProvider = provider;
|
|
|
|
|
CouchPotatoApi = cpApi;
|
|
|
|
|
TelegramNotification = telegram;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private INotificationService Service { get; }
|
|
|
|
@ -83,6 +84,7 @@ namespace Ombi.Controllers.External
|
|
|
|
|
private ICouchPotatoApi CouchPotatoApi { get; }
|
|
|
|
|
private ILogger<TesterController> Log { get; }
|
|
|
|
|
private IEmailProvider EmailProvider { get; }
|
|
|
|
|
private ITelegramNotification TelegramNotification { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -299,14 +301,14 @@ namespace Ombi.Controllers.External
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="settings">The settings.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
//[HttpPost("telegram")]
|
|
|
|
|
//public async Task<bool> Telegram([FromBody] TelegramSettings settings)
|
|
|
|
|
//{
|
|
|
|
|
// settings.Enabled = true;
|
|
|
|
|
// await TelegramApi.Send("This is a test ")
|
|
|
|
|
[HttpPost("telegram")]
|
|
|
|
|
public async Task<bool> Telegram([FromBody] TelegramSettings settings)
|
|
|
|
|
{
|
|
|
|
|
settings.Enabled = true;
|
|
|
|
|
await TelegramNotification.NotifyAsync(new NotificationOptions { NotificationType = NotificationType.Test, RequestId = -1 }, settings);
|
|
|
|
|
|
|
|
|
|
// return true;
|
|
|
|
|
//}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|