Exemplo n.º 1
0
        private async Task Push(PushoverNotificationSettings settings, string message)
        {
            try
            {
                var result = await PushoverApi.PushAsync(settings.AccessToken, message, settings.UserToken);

                if (result?.status != 1)
                {
                    Log.Error("Pushover api returned a status that was not 1, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Exemplo n.º 2
0
        private async Task PushIssueAsync(NotificationModel model, PushoverNotificationSettings settings)
        {
            var message = $"Plex Requests: A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";

            try
            {
                var result = await PushoverApi.PushAsync(settings.AccessToken, message, settings.UserToken);

                if (result?.status != 1)
                {
                    Log.Error("Pushover api returned a status that was not 1, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Exemplo n.º 3
0
        private async Task PushTestAsync(NotificationModel model, PushoverNotificationSettings settings)
        {
            var message = $"Plex Requests: Test Message!";

            try
            {
                var result = await PushoverApi.PushAsync(settings.AccessToken, message, settings.UserToken);

                if (result?.status != 1)
                {
                    Log.Error("Pushover api returned a status that was not 1, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            PushoverApi api = new PushoverApi("token");

            PushoverMessage message = new PushoverMessage()
            {
                Title    = "title",
                Message  = "message",
                Priority = Priority.High,
                Sound    = "magic",
                Url      = "https://www.github.com",
                UrlTitle = "Github",
            };

            bool result = api.Send("token", message);

            Console.Read();
        }