コード例 #1
0
        /// <summary>
        /// Appends the play store link as a field into <paramref name="embed"/>.
        /// </summary>
        /// <param name="embed">The embed to be modified.</param>
        /// <param name="configuration">An <see cref="IConfiguration"/> instance.</param>
        /// <param name="inline">Indicates wether the field is inline or not.</param>
        /// <returns>The modified <see cref="EmbedBuilder"/>.</returns>
        public static EmbedBuilder AddPlayStoreLink(this EmbedBuilder embed, IConfiguration configuration, bool inline = false)
        {
            var    emojis         = configuration.GetSection("customEmojis");
            Emoji  playStoreEmoji = new(emojis["playStore"]);
            string playStoreUrl   = configuration["playStoreLink"];

            if (!string.IsNullOrWhiteSpace(playStoreUrl))
            {
                return(embed.AddFieldLink(playStoreEmoji, "¡Descargá la app para Android!", "Google Play Store", playStoreUrl, inline));
            }
            else
            {
                return(embed);
            }
        }