Example #1
0
        public async Task AddingDrops(ulong id, ulong idItem)
        {
            if (!IsHavingThisRole((SocketGuildUser)Context.User, "Developer") &&
                !IsHavingThisRole((SocketGuildUser)Context.User, "Quiz Manager"))
            {
                return;
            }
            Quiz selected = Quizzes.GetQuiz(id);

            if (selected == null)
            {
                await Context.Channel.SendMessageAsync("`NO QUIZ FOUND WITH THAT ID`");

                return;
            }
            if (selected.Drop.Count >= 3)
            {
                await Context.Channel.SendMessageAsync("`CAN'T ADD MORE DROPS`");

                return;
            }
            Item drop = Drops.GetSpecificItem(idItem);

            if (drop == null)
            {
                await Context.Channel.SendMessageAsync("`NO ITEM FOUND WITH THAT ID`");

                return;
            }
            Quizzes.AddingDrops(selected, drop);
            await Context.Channel.SendMessageAsync("`DROP HAS BEEN ADDED`");
        }
Example #2
0
        public async Task AddingHints(ulong id, [Remainder] string url1)
        {
            if (!IsHavingThisRole((SocketGuildUser)Context.User, "Developer") &&
                !IsHavingThisRole((SocketGuildUser)Context.User, "Quiz Manager"))
            {
                return;
            }
            Quiz selected = Quizzes.GetQuiz(id);

            if (selected == null)
            {
                await Context.Channel.SendMessageAsync("`NO QUIZ FOUND WITH THAT ID`");

                return;
            }
            if (selected.Hints.Count >= 3)
            {
                await Context.Channel.SendMessageAsync("`CAN'T ADD MORE HINT`");

                return;
            }

            Quizzes.AddingHints(selected, url1);
            await Context.Channel.SendMessageAsync("`HINT HAS BEEN ADDED`");
        }
Example #3
0
        public async Task StartQuiz(ulong id, ulong time = 60)
        {
            if (GlobalVar.QuizHasBeenStarted)
            {
                return;
            }
            if (!IsHavingThisRole((SocketGuildUser)Context.User, "Developer") &&
                !IsHavingThisRole((SocketGuildUser)Context.User, "Quiz Manager"))
            {
                return;
            }
            Quiz now = Quizzes.GetQuiz(id);

            if (now == null)
            {
                await Context.Channel.SendMessageAsync("`No Quiz Found`");

                return;
            }
            string formattedText = $"Quiz No-{now.ID} : \nDifficulty : {now.Difficulty}\n";

            formattedText += $"Time : {time} second(s)\n";
            switch (now.Type)
            {
            case "image":
                formattedText += $"Type : Image\n";
                break;

            case "sv":
                formattedText += $"Type : Shadowverse Pic\n";
                break;

            case "ost":
                formattedText += $"Type : OST(OP/ED)\n";
                break;

            case "bonus":
                formattedText += $"Type : Bonus\n";
                break;

            case "voice-sv":
                formattedText += $"Type : Shadowverse Voice\n";
                break;
            }
            int lenght = now.Drop.Count;
            int temp   = 0;

            for (int i = 0; i < lenght; i++)
            {
                formattedText += $"Drop-{i + 1} : {now.Drop[i].Name}\n";
                temp++;
            }
            for (int i = temp; i < 3; i++)
            {
                formattedText += $"Drop-{i + 1} : --- \n";
            }

            GlobalVar.Selected = now;
            Quizzes.ResetQuiz();
            GlobalVar.GuildSelect   = Context.Guild;
            GlobalVar.ChannelSelect = (SocketTextChannel)Context.Channel;
            await Context.Channel.SendMessageAsync($"{formattedText}");

            await ReapetedTimer.StartQuiz(time, Context.Guild, (SocketTextChannel)Context.Channel);
        }