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); } }
void PrintChatTrigger(ChatTrigger trigger) { try { Util.WriteToChat(trigger.ToString()); } catch (Exception ex) { Util.LogError(ex); } }
private void TriggerWebhooksForChatTrigger(ChatTrigger trigger, string eventMessage) { try { trigger.Webhook.Send(new WebhookMessage(trigger.MessageFormat, eventMessage)); } catch (Exception ex) { Util.LogError(ex); } }