Пример #1
0
        public async Task EmojiDialogue(CommandContext ctx)
        {
            await ctx.Message.DeleteAsync().ConfigureAwait(false);

            var yesStep = new TextStep("You chose yes", null);
            var noStep  = new IntStep("You chose no", null);

            var emojiStep = new ReactionStep("Yes Or No?", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":thumbsup:"), new ReactionStepData {
                      Content = "Yes", NextStep = yesStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":thumbsdown:"), new ReactionStepData {
                      Content = "No", NextStep = noStep
                  } },
            });

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, emojiStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }
        }
Пример #2
0
        public async Task EmojiDialogue(CommandContext ctx)
        {
            TextStep yesStep = new TextStep("You chose yes", null);
            TextStep noStep  = new TextStep("You chose no", null);

            ReactionStep emojiStep = new ReactionStep("Yes or No?", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":+1:"), new ReactionStepData {
                      Content = "This means yes", NextStep = yesStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":-1:"), new ReactionStepData {
                      Content = "This means no", NextStep = noStep
                  } }
            });

            DiscordDmChannel userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            DialogueHandler inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, emojiStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }
        }
Пример #3
0
        public async Task Ticket(CommandContext ctx)
        {
            var CorrectStep1 = new TextStep("Please type the command 'TDiscord' in the discord server so that we you can make a support ticket.", nextStep: null, 1);
            var CorrectStep2 = new TextStep("Please type the command 'TUser' in the discord server so that we you can make a support ticket.", nextStep: null, 1);
            var CorrectStep3 = new TextStep("Please type the command 'TGame' in the discord server so that we you can make a support ticket.", nextStep: null, 1);
            var CorrectStep4 = new TextStep("Please type the command 'TSuggestion' in the discord server so that we you can make a support ticket.", nextStep: null, 1);
            var CorrectStep5 = new TextStep("Please type the command 'TOther' in the discord server so that we you can make a support ticket.", nextStep: null, 1);
            var CancelStep   = new TextStep("The dialogue has been canceled.", null);

            var DiscordStep = new ReactionStep("You chose support with Discord.", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":white_check_mark:"), new ReactionStepData {
                      Content = "Correct?", NextStep = CorrectStep1
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":x:"), new ReactionStepData {
                      Content = "Cancel?", NextStep = CancelStep
                  } }
            });
            var UserStep = new ReactionStep("You chose support with another User.", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":white_check_mark:"), new ReactionStepData {
                      Content = "Correct?", NextStep = CorrectStep2
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":x:"), new ReactionStepData {
                      Content = "Cancel?", NextStep = CancelStep
                  } }
            });
            var GameStep = new ReactionStep("You chose support in/with ARK:Survival Evolved or the server.", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":white_check_mark:"), new ReactionStepData {
                      Content = "Correct?", NextStep = CorrectStep3
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":x:"), new ReactionStepData {
                      Content = "Cancel?", NextStep = CancelStep
                  } }
            });
            var SuggestionStep = new ReactionStep("You chose Suggestions.", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":white_check_mark:"), new ReactionStepData {
                      Content = "Correct?", NextStep = CorrectStep4
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":x:"), new ReactionStepData {
                      Content = "Cancel?", NextStep = CancelStep
                  } }
            });
            var OtherStep = new ReactionStep("You chose support with something not currently listed.", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":white_check_mark:"), new ReactionStepData {
                      Content = "Correct?", NextStep = CorrectStep5
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":x:"), new ReactionStepData {
                      Content = "Cancel?", NextStep = CancelStep
                  } }
            });

            var emojiStep = new ReactionStep("What do you need support with? :one: - Discord? :two: - Another User? :three: - In/with our server on ARK: Survival Evolved? :four: - Have a suggestion? :five: Something currently not listed?", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":one:"), new ReactionStepData {
                      Content = "Discord?", NextStep = DiscordStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":two:"), new ReactionStepData {
                      Content = "Another User?", NextStep = UserStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":three:"), new ReactionStepData {
                      Content = "In/with our server on ARK: Survival Evolved?", NextStep = GameStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":four:"), new ReactionStepData {
                      Content = "Have a suggestion?", NextStep = SuggestionStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":five:"), new ReactionStepData {
                      Content = "With something not currently listed?", NextStep = OtherStep
                  } }
            });

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(
                ctx.Client,
                userChannel,
                ctx.User,
                emojiStep
                );

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }
        }