Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using DSharpPlus.CommandsNext;
- using DSharpPlus.CommandsNext.Attributes;
- using DSharpPlus.Entities;
- using DSharpPlus.Interactivity;
- using StudyBot.Discord.Module.Attributes;
- using StudyBot.Utilities;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace StudyBot.Discord.Module.Model.Internal
- {
- [HandleCommand]
- sealed class CreateQuizModule : IModule
- {
- private object context;
- [Command("makequiz")]
- [Description("Makes a Quiz")]
- [Aliases("Makequiz", "MakeQuiz", "makeQuiz")]
- public async Task OnCommand(CommandContext context, string name)
- {
- //var name = name
- //FileUtil.WriteLine($"{name}.txt", "test");
- FileUtil.MakeFile($"{name}.txt");
- var emoji = DiscordEmoji.FromName(context.Client, ":white_check_mark:");
- await context.RespondAsync($"Quiz {name} created! {emoji} Please type your questions and answers!");
- var intr = context.Client.GetInteractivityModule();
- var reminderContent = await intr.WaitForMessageAsync(
- c => c.Author.Id == context.Message.Author.Id, // Make sure the response is from the same person who sent the command
- TimeSpan.FromSeconds(60)); // Wait 60 seconds for a response instead of the default 30 we set earlier!
- if (reminderContent == null)
- {
- await context.RespondAsync("Sorry, I didn't get a response!");
- return;
- }
- await context.RespondAsync("Got That!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement