Пример #1
0
        private void Notify(IPlayer player, string message)
        {
            if (player == null && GetConfig(false, "Settings", "Use PushAPI"))
            {
                PushAPI?.Call("PushMessage", "Plugin Update Notification", message);
            }

            if (player == null && GetConfig(false, "Settings", "Use EmailAPI"))
            {
                EmailAPI?.Call("EmailMessage", "Plugin Update Notification", message);
            }

            SendMessage(player, message);
        }
Пример #2
0
        private void Notify(MessageWrapper messageWrapper)
        {
            if (GetConfig(false, "Settings", "Use PushAPI"))
            {
                PushAPI?.Call("PushMessage", "Plugin Update Notification", messageWrapper.GetNoFormatting());
            }

            if (GetConfig(false, "Settings", "Use EmailAPI"))
            {
                EmailAPI?.Call("EmailMessage", "Plugin Update Notification", messageWrapper.GetNoFormatting());
            }

            if (GetConfig(false, "Settings", "Use DiscordMessages") && !string.IsNullOrEmpty(GetConfig("", "Settings", "Discord Webhook")))
            {
                DiscordMessages?.Call("API_SendFancyMessage", GetConfig("", "Settings", "Discord Webhook"), messageWrapper.GetDiscordTitle(), messageWrapper.GetDiscordMessages(), null, messageWrapper.GetColourEmbed());
            }
        }