Example #1
0
        public override Task FillParametersAsync(string[] selectOptions, object[] idOptions)
        {
            if (selectOptions != null && selectOptions.Any())
            {
                SelectedDungeonName = selectOptions.FirstOrDefault();
            }

            _battleService = ServiceProvider.GetRequiredService <ColossoBattleService>();
            return(Task.CompletedTask);
        }
Example #2
0
        public override Task FillParametersAsync(string[] selectOptions, object[] idOptions)
        {
            if (idOptions != null && idOptions.Any())
            {
                FastTrack = bool.Parse((string)idOptions.First());
            }

            _battleService = ServiceProvider.GetRequiredService <ColossoBattleService>();
            return(Task.CompletedTask);
        }
Example #3
0
        protected override Task <(bool Success, string Message)> CheckCustomPreconditionsAsync()
        {
            var guildResult = IsGameCommandAllowedInGuild();

            if (!guildResult.Success)
            {
                return(Task.FromResult(guildResult));
            }

            Scope         = ServiceProvider.CreateScope();
            BattleService = Scope.ServiceProvider.GetRequiredService <ColossoBattleService>();

            Battle = BattleService.GetBattleEnvironment(Context.Channel);
            if (Battle == null)
            {
                return(Task.FromResult((false, "Battle not found")));
            }

            return(Task.FromResult(guildResult));
        }