コード例 #1
0
        public async Task <RuntimeResult> ListAvailableBodypartsAsync()
        {
            var parts = Enum.GetValues(typeof(Bodypart))
                        .Cast <Bodypart>()
                        .OrderBy(b => b);

            var options = new PaginatedAppearanceOptions
            {
                Color = Color.DarkPurple
            };

            var paginatedMessage = PaginatedEmbedFactory.SimpleFieldsFromCollection
                                   (
                _feedback,
                _interactivity,
                this.Context.User,
                parts,
                b => b.Humanize(),
                b =>
            {
                if (b.IsChiral())
                {
                    return("This part is available in both left and right versions.");
                }

                if (!b.IsGenderNeutral())
                {
                    return("This part is considered NSFW.");
                }

                if (b.IsComposite())
                {
                    return("This part is composed of smaller parts.");
                }

                return("This is a normal bodypart.");
            },
                appearance: options
                                   );

            await _interactivity.SendInteractiveMessageAsync(this.Context.Channel, paginatedMessage);

            return(RuntimeCommandResult.FromSuccess());
        }