예제 #1
0
        private EloSeason CreateNewEloSeason()
        {
            EloSeason currentSeason = new EloSeason
            {
                GuildId    = _guildId,
                SeasonName = "Season Zero"
            };

            _db.EloSeasons.Add(currentSeason);
            _db.SaveChanges();
            return(currentSeason);
        }
예제 #2
0
        public async Task NewSeason(params string[] seasonNameParam)
        {
            var seasonName = string.Join(" ", seasonNameParam);

            var discordPlayer = _db.DiscordPlayers
                                .Include(x => x.Player)
                                .SingleOrDefault(x => x.UserId == Context.User.Id);

            if (!discordPlayer.IsAdministrator)
            {
                return;
            }

            var newSeason = new EloSeason
            {
                GuildId    = Context.Guild.Id,
                SeasonName = seasonName
            };

            _db.EloSeasons.Add(newSeason);
            _db.SaveChanges();

            await SendMessageAsync($"A new ELO season, `{seasonName}`, has begun!");
        }