Ejemplo n.º 1
0
        void btnChatTriggerAdd_Click(object sender, MVControlEventArgs e)
        {
            try
            {
                if (edtChatTriggerPattern.Text.Length <= 0)
                {
                    throw new Exception("You have to enter a Pattern for your ChatTrigger.");
                }

                ChatTrigger trigger = new ChatTrigger(
                    edtChatTriggerPattern.Text,
                    (Webhook)chcChatTriggerWebhook.Data[chcChatTriggerWebhook.Selected],
                    edtChatTriggerMessage.Text,
                    true);

                ChatTriggers.Add(trigger);

                RefreshChatTriggerList();
                SaveSettings();
            }
            catch (Exception ex)
            {
                Util.WriteToChat("Error adding new ChatTrigger: " + ex.Message);
                Util.LogError(ex);
            }
        }
Ejemplo n.º 2
0
 void PrintChatTrigger(ChatTrigger trigger)
 {
     try
     {
         Util.WriteToChat(trigger.ToString());
     }
     catch (Exception ex)
     {
         Util.LogError(ex);
     }
 }
Ejemplo n.º 3
0
 private void TriggerWebhooksForChatTrigger(ChatTrigger trigger, string eventMessage)
 {
     try
     {
         trigger.Webhook.Send(new WebhookMessage(trigger.MessageFormat, eventMessage));
     }
     catch (Exception ex)
     {
         Util.LogError(ex);
     }
 }