private static bool Prefix([CanBeNull] CommandDriver __instance, ITwitchMessage twitchMessage) { if (__instance == null) { return(true); } if (!TkSettings.StoreState) { return(false); } Viewer viewer = Viewers.GetViewer(twitchMessage.Username); ITwitchMessage message = twitchMessage; if (!__instance.command.defName.Equals("Buy")) { message = twitchMessage.WithMessage($"!{CommandDefOf.Buy.command} {twitchMessage.Message.Substring(1)}"); } if (message !.Message.Split(' ').Length < 2) { return(false); } Purchase_Handler.ResolvePurchase(viewer, message); return(false); }
public CommandSteps(TypeContext typeContext, CommandDriver commandDriver) : base(typeContext) { _typeContext = typeContext; _commandDriver = commandDriver; }
public static void Init() { _commandProcessor = new CommandDriver(); }