Ejemplo n.º 1
0
 public override void OnTwitchExtension(string name, int amount, string action, JToken settings)
 {
     if (_actionHandler.GetAction(action, settings, out var baseAction))
     {
         baseAction.Execute(new Data.Data {
             Type = EventType.TwitchExtension, Amount = amount
         });
         if (baseAction.Message != null && baseAction.Message.Trim().Length > 0)
         {
             var messageEvent = Configuration.Plugin.Get(c => c.Events.TwitchExtension);
             SendMessage(string.Format(messageEvent.WithMessage, name, amount), true, new List <BaseAction> {
                 baseAction
             });
         }
         else
         {
             var messageEvent = Configuration.Plugin.Get(c => c.Events.TwitchExtension);
             SendMessage(string.Format(messageEvent.WithoutMessage, name, amount), true, new List <BaseAction> {
                 baseAction
             });
         }
     }
 }
Ejemplo n.º 2
0
 public void Execute(string type, JToken token, Data.Data data)
 {
     _actionHandler.GetAction(type, token, out var action);
     action.Execute(data, GetParams(data));
 }