示例#1
0
        public async Task SetBrlBanDuration(int amount, [Remainder] string str = "")
        {
            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }
            if (banroyale.Running == true)
            {
                await Context.Channel.SendMessageAsync(":x: Cannot change settings after the ban royale has started.");

                return;
            }
            if (amount < 0)
            {
                await Context.Channel.SendMessageAsync(":x: Ban duration can't be less than 0, baaaaka.");

                return;
            }

            banroyale.BanLengthHours = amount;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            await Context.Channel.SendMessageAsync($"Set the ban duration to **{amount} hours**!");
        }
示例#2
0
        public async Task SetBrlMaxFrequency(int amount, [Remainder] string str = "")
        {
            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }
            if (banroyale.Running == true)
            {
                await Context.Channel.SendMessageAsync(":x: Cannot change settings after the ban royale has started.");

                return;
            }
            if (banroyale.MinFrequency > amount)
            {
                await Context.Channel.SendMessageAsync($":x: Minimum frequency can't be higher than the maximum, baaaaka. Current min frequency: **{banroyale.MinFrequency}**.");

                return;
            }
            if (amount < 20 || amount > 21600)
            {
                await Context.Channel.SendMessageAsync($":x: Maximum frequency must be in the range of **20** (2m) to **21600** (6h) seconds.");

                return;
            }

            banroyale.MaxFrequency = amount;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            await Context.Channel.SendMessageAsync($"Set the maximum message frequency to **{amount} seconds**!");
        }
示例#3
0
        public async Task SetBrlMaxParticipants(int amount, [Remainder] string str = "")
        {
            if (amount > 80)
            {
                await Context.Channel.SendMessageAsync(":x: There is an upper limit of 80 players.");

                return;
            }

            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }
            if (banroyale.Running == true)
            {
                await Context.Channel.SendMessageAsync(":x: Cannot change settings after the ban royale has started.");

                return;
            }

            banroyale.MaxParticipants = amount;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            await Context.Channel.SendMessageAsync($"Set the maximum participants to **{amount}**!");
        }
示例#4
0
        public async Task SetBrlRewardPool(int amount, [Remainder] string str = "")
        {
            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }

            banroyale.RewardPool = amount;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            await Context.Channel.SendMessageAsync($"Set the reward pool to **{amount}**!");
        }
示例#5
0
        public async Task SetBrlKick([Remainder] string str = "")
        {
            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }
            if (banroyale.Running == true)
            {
                await Context.Channel.SendMessageAsync(":x: Cannot change settings after the ban royale has started.");

                return;
            }

            banroyale.Kick = banroyale.Kick ? false : true;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            await Context.Channel.SendMessageAsync(banroyale.Kick? "Losers will be kicked from the server!" : "Losers will not be kicked...");
        }
示例#6
0
        public async Task SetBrlWinners(int amount, [Remainder] string str = "")
        {
            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }
            if (banroyale.Running == true)
            {
                await Context.Channel.SendMessageAsync(":x: Cannot change settings after the ban royale has started.");

                return;
            }

            banroyale.WinnerAmount = amount;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            await Context.Channel.SendMessageAsync($"Set the amount of winners to **{amount}**!");
        }
示例#7
0
        public async Task StartBanroyale([Remainder] string str = "")
        {
            var banroyale = await BanroyaleDb.GetBanroyale(Context.Channel.Id);

            if (banroyale == null)
            {
                await Context.Channel.SendMessageAsync(":x: There is no running Ban Royale in this channel.");

                return;
            }
            if (banroyale.Running == true)
            {
                await Context.Channel.SendMessageAsync(":x: The Ban Royale has already started.");

                return;
            }

            banroyale.Running = true;
            await BanroyaleDb.UpdateBanroyale(banroyale);

            var br = new BanroyaleGame(banroyale, Context.Channel, Context.Guild.GetRole(banroyale.ParticipantRoleId));

            await ReplyAsync($"Starting Ban Royale! I will send a new message every **{banroyale.MinFrequency}-{banroyale.MaxFrequency}s** and leave a reaction on them. The last users to click these reactions will lose!");
        }