예제 #1
0
        public async Task GetInviteLink()
        {
            try
            {
                string infoImageUrl  = Configuration.GetSection("images")?.GetSection("info")?["64"];
                string inviteLink    = Configuration["inviteLink"];
                var    emojis        = Configuration.GetSection("customEmojis");
                Emoji  dolarbotEmoji = new(emojis["dolarbot"]);

                if (string.IsNullOrWhiteSpace(inviteLink))
                {
                    inviteLink = Environment.GetEnvironmentVariable(GlobalConfiguration.GetInviteLinkEnvVarName());
                }

                EmbedBuilder embed = new EmbedBuilder()
                                     .WithTitle($"{dolarbotEmoji} DolarBot")
                                     .WithColor(GlobalConfiguration.Colors.Info)
                                     .WithThumbnailUrl(infoImageUrl)
                                     .WithDescription($"Invita al bot haciendo {Format.Url("click aquí", inviteLink)}");

                embed.AddCommandDeprecationNotice(Configuration);
                await ReplyAsync(embed : embed.Build());
            }
            catch (Exception ex)
            {
                await SendErrorReply(ex);
            }
        }
예제 #2
0
        public async Task GetInviteLink()
        {
            string infoImageUrl = Configuration.GetSection("images")?.GetSection("info")?["64"];
            string inviteLink   = Configuration["inviteLink"];

            if (string.IsNullOrWhiteSpace(inviteLink))
            {
                inviteLink = Environment.GetEnvironmentVariable(GlobalConfiguration.GetInviteLinkEnvVarName());
            }

            EmbedBuilder embed = new EmbedBuilder()
                                 .WithTitle("DolarBot")
                                 .WithColor(infoEmbedColor)
                                 .WithThumbnailUrl(infoImageUrl)
                                 .WithDescription($"Invita al bot haciendo {Format.Url("click acá", inviteLink)}");

            await ReplyAsync(embed : embed.Build()).ConfigureAwait(false);
        }