Пример #1
0
        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);
        }
Пример #2
0
 public CommandSteps(TypeContext typeContext, CommandDriver commandDriver) : base(typeContext)
 {
     _typeContext   = typeContext;
     _commandDriver = commandDriver;
 }
Пример #3
0
 public static void Init()
 {
     _commandProcessor = new CommandDriver();
 }