mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
all calls to .WithAuthor and .WithFooter no longer use their respective builders
This commit is contained in:
@@ -41,12 +41,10 @@ namespace NadekoBot.Common
|
|||||||
embed.WithUrl(Url);
|
embed.WithUrl(Url);
|
||||||
embed.WithColor(new Discord.Color(Color));
|
embed.WithColor(new Discord.Color(Color));
|
||||||
if (Footer != null)
|
if (Footer != null)
|
||||||
embed.WithFooter(efb =>
|
embed.WithFooter(Footer.Text,
|
||||||
{
|
Uri.IsWellFormedUriString(Footer.IconUrl, UriKind.Absolute)
|
||||||
efb.WithText(Footer.Text);
|
? Footer.IconUrl
|
||||||
if (Uri.IsWellFormedUriString(Footer.IconUrl, UriKind.Absolute))
|
: null);
|
||||||
efb.WithIconUrl(Footer.IconUrl);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (Thumbnail != null && Uri.IsWellFormedUriString(Thumbnail, UriKind.Absolute))
|
if (Thumbnail != null && Uri.IsWellFormedUriString(Thumbnail, UriKind.Absolute))
|
||||||
embed.WithThumbnailUrl(Thumbnail);
|
embed.WithThumbnailUrl(Thumbnail);
|
||||||
|
@@ -441,7 +441,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder().WithAuthor(eab => eab.WithName(mutes))
|
var embed = new EmbedBuilder().WithAuthor(mutes)
|
||||||
.WithTitle($"{usr.Username}#{usr.Discriminator} | {usr.Id}")
|
.WithTitle($"{usr.Username}#{usr.Discriminator} | {usr.Id}")
|
||||||
.WithFooter(CurrentTime(usr.Guild))
|
.WithFooter(CurrentTime(usr.Guild))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
@@ -486,7 +486,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder().WithAuthor(eab => eab.WithName(mutes))
|
var embed = new EmbedBuilder().WithAuthor(mutes)
|
||||||
.WithTitle($"{usr.Username}#{usr.Discriminator} | {usr.Id}")
|
.WithTitle($"{usr.Username}#{usr.Discriminator} | {usr.Id}")
|
||||||
.WithFooter($"{CurrentTime(usr.Guild)}")
|
.WithFooter($"{CurrentTime(usr.Guild)}")
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
@@ -541,7 +541,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder().WithAuthor(eab => eab.WithName($"🛡 Anti-{protection}"))
|
var embed = new EmbedBuilder().WithAuthor($"🛡 Anti-{protection}")
|
||||||
.WithTitle(GetText(logChannel.Guild, "users") + " " + punishment)
|
.WithTitle(GetText(logChannel.Guild, "users") + " " + punishment)
|
||||||
.WithDescription(string.Join("\n", users.Select(u => u.ToString())))
|
.WithDescription(string.Join("\n", users.Select(u => u.ToString())))
|
||||||
.WithFooter(CurrentTime(logChannel.Guild))
|
.WithFooter(CurrentTime(logChannel.Guild))
|
||||||
@@ -594,7 +594,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
.WithTitle($"{before.Username}#{before.Discriminator} | {before.Id}");
|
.WithTitle($"{before.Username}#{before.Discriminator} | {before.Id}");
|
||||||
if (before.Nickname != after.Nickname)
|
if (before.Nickname != after.Nickname)
|
||||||
{
|
{
|
||||||
embed.WithAuthor(eab => eab.WithName("👥 " + GetText(logChannel.Guild, "nick_change")))
|
embed.WithAuthor("👥 " + GetText(logChannel.Guild, "nick_change"))
|
||||||
.AddField(efb =>
|
.AddField(efb =>
|
||||||
efb.WithName(GetText(logChannel.Guild, "old_nick"))
|
efb.WithName(GetText(logChannel.Guild, "old_nick"))
|
||||||
.WithValue($"{before.Nickname}#{before.Discriminator}"))
|
.WithValue($"{before.Nickname}#{before.Discriminator}"))
|
||||||
@@ -609,7 +609,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
if (before.Roles.Count < after.Roles.Count)
|
if (before.Roles.Count < after.Roles.Count)
|
||||||
{
|
{
|
||||||
var diffRoles = after.Roles.Where(r => !before.Roles.Contains(r)).Select(r => r.Name);
|
var diffRoles = after.Roles.Where(r => !before.Roles.Contains(r)).Select(r => r.Name);
|
||||||
embed.WithAuthor(eab => eab.WithName("⚔ " + GetText(logChannel.Guild, "user_role_add")))
|
embed.WithAuthor("⚔ " + GetText(logChannel.Guild, "user_role_add"))
|
||||||
.WithDescription(string.Join(", ", diffRoles).SanitizeMentions());
|
.WithDescription(string.Join(", ", diffRoles).SanitizeMentions());
|
||||||
|
|
||||||
await logChannel.EmbedAsync(embed).ConfigureAwait(false);
|
await logChannel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
@@ -624,8 +624,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
|
|
||||||
if (diffRoles.Any())
|
if (diffRoles.Any())
|
||||||
{
|
{
|
||||||
embed.WithAuthor(eab =>
|
embed.WithAuthor("⚔ " + GetText(logChannel.Guild, "user_role_rem"))
|
||||||
eab.WithName("⚔ " + GetText(logChannel.Guild, "user_role_rem")))
|
|
||||||
.WithDescription(string.Join(", ", diffRoles).SanitizeMentions());
|
.WithDescription(string.Join(", ", diffRoles).SanitizeMentions());
|
||||||
|
|
||||||
await logChannel.EmbedAsync(embed).ConfigureAwait(false);
|
await logChannel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
|
@@ -96,7 +96,7 @@ namespace NadekoBot.Modules.Games.Common
|
|||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithDescription(Environment.NewLine + GetState())
|
.WithDescription(Environment.NewLine + GetState())
|
||||||
.WithAuthor(eab => eab.WithName(GetText("vs", _users[0], _users[1])));
|
.WithAuthor(GetText("vs", _users[0], _users[1]));
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(title))
|
if (!string.IsNullOrWhiteSpace(title))
|
||||||
embed.WithTitle(title);
|
embed.WithTitle(title);
|
||||||
|
@@ -174,7 +174,7 @@ namespace NadekoBot.Modules.Games.Common.Trivia
|
|||||||
ShouldStopGame = true;
|
ShouldStopGame = true;
|
||||||
|
|
||||||
await Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
|
await Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName("Trivia Game Ended"))
|
.WithAuthor("Trivia Game Ended")
|
||||||
.WithTitle("Final Results")
|
.WithTitle("Final Results")
|
||||||
.WithDescription(GetLeaderboard())).ConfigureAwait(false);
|
.WithDescription(GetLeaderboard())).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,6 @@ using NadekoBot.Common;
|
|||||||
using NadekoBot.Common.Attributes;
|
using NadekoBot.Common.Attributes;
|
||||||
using NadekoBot.Services.Database.Models;
|
using NadekoBot.Services.Database.Models;
|
||||||
using NadekoBot.Extensions;
|
using NadekoBot.Extensions;
|
||||||
using NadekoBot.Modules;
|
|
||||||
using NadekoBot.Modules.Administration.Services;
|
using NadekoBot.Modules.Administration.Services;
|
||||||
using NadekoBot.Modules.Music.Services;
|
using NadekoBot.Modules.Music.Services;
|
||||||
|
|
||||||
@@ -18,6 +17,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
[NoPublicBot]
|
[NoPublicBot]
|
||||||
public sealed partial class Music : NadekoModule<IMusicService>
|
public sealed partial class Music : NadekoModule<IMusicService>
|
||||||
{
|
{
|
||||||
|
public const string MusicIconUrl = "http://i.imgur.com/nhKS3PT.png";
|
||||||
private readonly ILogCommandService _logService;
|
private readonly ILogCommandService _logService;
|
||||||
|
|
||||||
public Music(ILogCommandService _logService)
|
public Music(ILogCommandService _logService)
|
||||||
@@ -114,9 +114,9 @@ namespace NadekoBot.Modules.Music
|
|||||||
{
|
{
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("queued_song") + " #" + (index + 1)).WithMusicIcon())
|
.WithAuthor(GetText("queued_song") + " #" + (index + 1), MusicIconUrl)
|
||||||
.WithDescription($"{trackInfo.PrettyName()}\n{GetText("queue")} ")
|
.WithDescription($"{trackInfo.PrettyName()}\n{GetText("queue")} ")
|
||||||
.WithFooter(ef => ef.WithText(trackInfo.Platform.ToString()));
|
.WithFooter(trackInfo.Platform.ToString());
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(trackInfo.Thumbnail))
|
if (!string.IsNullOrWhiteSpace(trackInfo.Thumbnail))
|
||||||
embed.WithThumbnailUrl(trackInfo.Thumbnail);
|
embed.WithThumbnailUrl(trackInfo.Thumbnail);
|
||||||
@@ -329,9 +329,8 @@ namespace NadekoBot.Modules.Music
|
|||||||
desc = add + "\n" + desc;
|
desc = add + "\n" + desc;
|
||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eab => eab
|
.WithAuthor(GetText("player_queue", curPage + 1, (tracks.Count / LQ_ITEMS_PER_PAGE) + 1),
|
||||||
.WithName(GetText("player_queue", curPage + 1, (tracks.Count / LQ_ITEMS_PER_PAGE) + 1))
|
MusicIconUrl)
|
||||||
.WithMusicIcon())
|
|
||||||
.WithDescription(desc)
|
.WithDescription(desc)
|
||||||
.WithFooter($" {mp.PrettyVolume()} | 🎶 {tracks.Count} | ⌛ {mp.PrettyTotalTime()} ")
|
.WithFooter($" {mp.PrettyVolume()} | 🎶 {tracks.Count} | ⌛ {mp.PrettyTotalTime()} ")
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
@@ -432,9 +431,9 @@ namespace NadekoBot.Modules.Music
|
|||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("removed_song") + " #" + (index)).WithMusicIcon())
|
.WithAuthor(GetText("removed_song") + " #" + (index), MusicIconUrl)
|
||||||
.WithDescription(song.PrettyName())
|
.WithDescription(song.PrettyName())
|
||||||
.WithFooter(ef => ef.WithText(song.PrettyInfo()))
|
.WithFooter(song.PrettyInfo())
|
||||||
.WithErrorColor();
|
.WithErrorColor();
|
||||||
|
|
||||||
await _service.SendToOutputAsync(Context.Guild.Id, embed);
|
await _service.SendToOutputAsync(Context.Guild.Id, embed);
|
||||||
@@ -616,7 +615,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithTitle(track.Title.TrimTo(65))
|
.WithTitle(track.Title.TrimTo(65))
|
||||||
.WithAuthor(eab => eab.WithName(GetText("song_moved")).WithIconUrl("https://cdn.discordapp.com/attachments/155726317222887425/258605269972549642/music1.png"))
|
.WithAuthor(GetText("song_moved"), MusicIconUrl)
|
||||||
.AddField(GetText("from_position"), $"#{from + 1}", true)
|
.AddField(GetText("from_position"), $"#{from + 1}", true)
|
||||||
.AddField(GetText("to_position"), $"#{to + 1}", true)
|
.AddField(GetText("to_position"), $"#{to + 1}", true)
|
||||||
.WithColor(Bot.OkColor);
|
.WithColor(Bot.OkColor);
|
||||||
@@ -703,7 +702,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var embed = new EmbedBuilder().WithOkColor()
|
var embed = new EmbedBuilder().WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("now_playing")).WithMusicIcon())
|
.WithAuthor(GetText("now_playing"), MusicIconUrl)
|
||||||
.WithDescription(currentTrack.PrettyName())
|
.WithDescription(currentTrack.PrettyName())
|
||||||
.WithThumbnailUrl(currentTrack.Thumbnail)
|
.WithThumbnailUrl(currentTrack.Thumbnail)
|
||||||
.WithFooter($"{mp.PrettyVolume()} | {mp.PrettyTotalTime()} | {currentTrack.Platform} | {currentTrack.Queuer}");
|
.WithFooter($"{mp.PrettyVolume()} | {mp.PrettyTotalTime()} | {currentTrack.Platform} | {currentTrack.Queuer}");
|
||||||
|
@@ -62,7 +62,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("playlists_page", num)).WithMusicIcon())
|
.WithAuthor(GetText("playlists_page", num), MusicIconUrl)
|
||||||
.WithDescription(string.Join("\n", playlists.Select(r =>
|
.WithDescription(string.Join("\n", playlists.Select(r =>
|
||||||
GetText("playlists", r.Id, r.Name, r.Author, r.Songs.Count))))
|
GetText("playlists", r.Id, r.Name, r.Author, r.Songs.Count))))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
@@ -205,7 +205,7 @@ namespace NadekoBot.Modules.Music.Services
|
|||||||
_ = lastFinishedMessage?.DeleteAsync();
|
_ = lastFinishedMessage?.DeleteAsync();
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName(GetText(guildId, "finished_song")).WithMusicIcon())
|
.WithAuthor(GetText(guildId, "finished_song"), Music.MusicIconUrl)
|
||||||
.WithDescription(trackInfo.PrettyName())
|
.WithDescription(trackInfo.PrettyName())
|
||||||
.WithFooter(trackInfo.PrettyTotalTime());
|
.WithFooter(trackInfo.PrettyTotalTime());
|
||||||
|
|
||||||
@@ -220,9 +220,9 @@ namespace NadekoBot.Modules.Music.Services
|
|||||||
{
|
{
|
||||||
_ = lastPlayingMessage?.DeleteAsync();
|
_ = lastPlayingMessage?.DeleteAsync();
|
||||||
var embed = new EmbedBuilder().WithOkColor()
|
var embed = new EmbedBuilder().WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName(GetText(guildId, "playing_song", index + 1)).WithMusicIcon())
|
.WithAuthor(GetText(guildId, "playing_song", index + 1), Music.MusicIconUrl)
|
||||||
.WithDescription(trackInfo.PrettyName())
|
.WithDescription(trackInfo.PrettyName())
|
||||||
.WithFooter(ef => ef.WithText($"{mp.PrettyVolume()} | {trackInfo.PrettyInfo()}"));
|
.WithFooter($"{mp.PrettyVolume()} | {trackInfo.PrettyInfo()}");
|
||||||
|
|
||||||
lastPlayingMessage = await SendToOutputAsync(guildId, embed);
|
lastPlayingMessage = await SendToOutputAsync(guildId, embed);
|
||||||
};
|
};
|
||||||
|
@@ -28,12 +28,10 @@ namespace NadekoBot.Modules.Searches
|
|||||||
private const string _pogiURL = "https://pathofexile.gamepedia.com/api.php?action=query&prop=imageinfo&iiprop=url&format=json&titles=File:";
|
private const string _pogiURL = "https://pathofexile.gamepedia.com/api.php?action=query&prop=imageinfo&iiprop=url&format=json&titles=File:";
|
||||||
private const string _profileURL = "https://www.pathofexile.com/account/view-profile/";
|
private const string _profileURL = "https://www.pathofexile.com/account/view-profile/";
|
||||||
|
|
||||||
private readonly DiscordSocketClient _client;
|
|
||||||
private readonly IHttpClientFactory _httpFactory;
|
private readonly IHttpClientFactory _httpFactory;
|
||||||
|
|
||||||
public PathOfExileCommands(DiscordSocketClient client, IHttpClientFactory httpFactory)
|
public PathOfExileCommands(IHttpClientFactory httpFactory)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_httpFactory = httpFactory;
|
_httpFactory = httpFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,10 +75,10 @@ namespace NadekoBot.Modules.Searches
|
|||||||
await ctx.SendPaginatedConfirmAsync(page, (curPage) =>
|
await ctx.SendPaginatedConfirmAsync(page, (curPage) =>
|
||||||
{
|
{
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eau => eau.WithName($"Characters on {usr}'s account")
|
.WithAuthor($"Characters on {usr}'s account",
|
||||||
.WithUrl($"{_profileURL}{usr}")
|
"https://web.poecdn.com/image/favicon/ogimage.png",
|
||||||
.WithIconUrl("https://web.poecdn.com/image/favicon/ogimage.png"))
|
$"{_profileURL}{usr}")
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
var tempList = characters.Skip(curPage * 9).Take(9).ToList();
|
var tempList = characters.Skip(curPage * 9).Take(9).ToList();
|
||||||
|
|
||||||
@@ -131,9 +129,9 @@ namespace NadekoBot.Modules.Searches
|
|||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eau => eau.WithName($"Path of Exile Leagues")
|
.WithAuthor($"Path of Exile Leagues",
|
||||||
.WithUrl("https://www.pathofexile.com")
|
"https://web.poecdn.com/image/favicon/ogimage.png",
|
||||||
.WithIconUrl("https://web.poecdn.com/image/favicon/ogimage.png"))
|
"https://www.pathofexile.com")
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
var sb = new System.Text.StringBuilder();
|
var sb = new System.Text.StringBuilder();
|
||||||
@@ -203,9 +201,10 @@ namespace NadekoBot.Modules.Searches
|
|||||||
conversionEquivalent = float.Parse(currencyOutput["chaosEquivalent"].ToString(), System.Globalization.CultureInfo.InvariantCulture);
|
conversionEquivalent = float.Parse(currencyOutput["chaosEquivalent"].ToString(), System.Globalization.CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
var embed = new EmbedBuilder().WithAuthor(eau => eau.WithName($"{leagueName} Currency Exchange")
|
var embed = new EmbedBuilder()
|
||||||
.WithUrl("http://poe.ninja")
|
.WithAuthor($"{leagueName} Currency Exchange",
|
||||||
.WithIconUrl("https://web.poecdn.com/image/favicon/ogimage.png"))
|
"https://web.poecdn.com/image/favicon/ogimage.png",
|
||||||
|
"http://poe.ninja")
|
||||||
.AddField("Currency Type", cleanCurrency, true)
|
.AddField("Currency Type", cleanCurrency, true)
|
||||||
.AddField($"{cleanConvert} Equivalent", chaosEquivalent / conversionEquivalent, true)
|
.AddField($"{cleanConvert} Equivalent", chaosEquivalent / conversionEquivalent, true)
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
@@ -33,7 +33,6 @@ namespace NadekoBot.Modules.Searches
|
|||||||
private readonly IGoogleApiService _google;
|
private readonly IGoogleApiService _google;
|
||||||
private readonly IHttpClientFactory _httpFactory;
|
private readonly IHttpClientFactory _httpFactory;
|
||||||
private readonly IMemoryCache _cache;
|
private readonly IMemoryCache _cache;
|
||||||
private static readonly NadekoRandom _rng = new NadekoRandom();
|
|
||||||
private readonly GuildTimezoneService _tzSvc;
|
private readonly GuildTimezoneService _tzSvc;
|
||||||
|
|
||||||
public Searches(IBotCredentials creds, IGoogleApiService google, IHttpClientFactory factory, IMemoryCache cache,
|
public Searches(IBotCredentials creds, IGoogleApiService google, IHttpClientFactory factory, IMemoryCache cache,
|
||||||
@@ -46,7 +45,6 @@ namespace NadekoBot.Modules.Searches
|
|||||||
_tzSvc = tzSvc;
|
_tzSvc = tzSvc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//for anonymasen :^)
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
public async Task Rip([Leftover] IGuildUser usr)
|
public async Task Rip([Leftover] IGuildUser usr)
|
||||||
{
|
{
|
||||||
@@ -224,9 +222,9 @@ namespace NadekoBot.Modules.Searches
|
|||||||
var res = await _google.GetImageAsync(oterms).ConfigureAwait(false);
|
var res = await _google.GetImageAsync(oterms).ConfigureAwait(false);
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("image_search_for") + " " + oterms.TrimTo(50))
|
.WithAuthor(GetText("image_search_for") + " " + oterms.TrimTo(50),
|
||||||
.WithUrl("https://www.google.rs/search?q=" + query + "&source=lnms&tbm=isch")
|
"http://i.imgur.com/G46fm8J.png",
|
||||||
.WithIconUrl("http://i.imgur.com/G46fm8J.png"))
|
$"https://www.google.rs/search?q={query}&source=lnms&tbm=isch")
|
||||||
.WithDescription(res.Link)
|
.WithDescription(res.Link)
|
||||||
.WithImageUrl(res.Link)
|
.WithImageUrl(res.Link)
|
||||||
.WithTitle(ctx.User.ToString());
|
.WithTitle(ctx.User.ToString());
|
||||||
@@ -254,9 +252,9 @@ namespace NadekoBot.Modules.Searches
|
|||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("image_search_for") + " " + oterms.TrimTo(50))
|
.WithAuthor(GetText("image_search_for") + " " + oterms.TrimTo(50),
|
||||||
.WithUrl(fullQueryLink)
|
"http://s.imgur.com/images/logo-1200-630.jpg?",
|
||||||
.WithIconUrl("http://s.imgur.com/images/logo-1200-630.jpg?"))
|
fullQueryLink)
|
||||||
.WithDescription(source)
|
.WithDescription(source)
|
||||||
.WithImageUrl(source)
|
.WithImageUrl(source)
|
||||||
.WithTitle(ctx.User.ToString());
|
.WithTitle(ctx.User.ToString());
|
||||||
@@ -474,7 +472,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
var item = items[p];
|
var item = items[p];
|
||||||
return new EmbedBuilder().WithOkColor()
|
return new EmbedBuilder().WithOkColor()
|
||||||
.WithUrl(item.Permalink)
|
.WithUrl(item.Permalink)
|
||||||
.WithAuthor(eab => eab.WithIconUrl("http://i.imgur.com/nwERwQE.jpg").WithName(item.Word))
|
.WithAuthor(item.Word)
|
||||||
.WithDescription(item.Definition);
|
.WithDescription(item.Definition);
|
||||||
}, items.Length, 1).ConfigureAwait(false);
|
}, items.Length, 1).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
|
@@ -36,7 +36,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
var comic = JsonConvert.DeserializeObject<XkcdComic>(res);
|
var comic = JsonConvert.DeserializeObject<XkcdComic>(res);
|
||||||
var embed = new EmbedBuilder().WithColor(Bot.OkColor)
|
var embed = new EmbedBuilder().WithColor(Bot.OkColor)
|
||||||
.WithImageUrl(comic.ImageLink)
|
.WithImageUrl(comic.ImageLink)
|
||||||
.WithAuthor(eab => eab.WithName(comic.Title).WithUrl($"{_xkcdUrl}/{comic.Num}").WithIconUrl("https://xkcd.com/s/919f27.ico"))
|
.WithAuthor(comic.Title,"https://xkcd.com/s/919f27.ico", $"{_xkcdUrl}/{comic.Num}")
|
||||||
.AddField(GetText("comic_number"), comic.Num.ToString(), true)
|
.AddField(GetText("comic_number"), comic.Num.ToString(), true)
|
||||||
.AddField(GetText("date"), $"{comic.Month}/{comic.Year}", true);
|
.AddField(GetText("date"), $"{comic.Month}/{comic.Year}", true);
|
||||||
var sent = await ctx.Channel.EmbedAsync(embed)
|
var sent = await ctx.Channel.EmbedAsync(embed)
|
||||||
@@ -69,11 +69,13 @@ namespace NadekoBot.Modules.Searches
|
|||||||
var res = await http.GetStringAsync($"{_xkcdUrl}/{num}/info.0.json").ConfigureAwait(false);
|
var res = await http.GetStringAsync($"{_xkcdUrl}/{num}/info.0.json").ConfigureAwait(false);
|
||||||
|
|
||||||
var comic = JsonConvert.DeserializeObject<XkcdComic>(res);
|
var comic = JsonConvert.DeserializeObject<XkcdComic>(res);
|
||||||
var embed = new EmbedBuilder().WithColor(Bot.OkColor)
|
var embed = new EmbedBuilder()
|
||||||
.WithImageUrl(comic.ImageLink)
|
.WithColor(Bot.OkColor)
|
||||||
.WithAuthor(eab => eab.WithName(comic.Title).WithUrl($"{_xkcdUrl}/{num}").WithIconUrl("https://xkcd.com/s/919f27.ico"))
|
.WithImageUrl(comic.ImageLink)
|
||||||
.AddField(GetText("comic_number"), comic.Num.ToString(), true)
|
.WithAuthor(comic.Title, "https://xkcd.com/s/919f27.ico", $"{_xkcdUrl}/{num}")
|
||||||
.AddField(GetText("date"), $"{comic.Month}/{comic.Year}", true);
|
.AddField(GetText("comic_number"), comic.Num.ToString(), true)
|
||||||
|
.AddField(GetText("date"), $"{comic.Month}/{comic.Year}", true);
|
||||||
|
|
||||||
var sent = await ctx.Channel.EmbedAsync(embed)
|
var sent = await ctx.Channel.EmbedAsync(embed)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
if (string.IsNullOrWhiteSpace(features))
|
if (string.IsNullOrWhiteSpace(features))
|
||||||
features = "-";
|
features = "-";
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eab => eab.WithName(GetText("server_info")))
|
.WithAuthor(GetText("server_info"))
|
||||||
.WithTitle(guild.Name)
|
.WithTitle(guild.Name)
|
||||||
.AddField(GetText("id"), guild.Id.ToString(), true)
|
.AddField(GetText("id"), guild.Id.ToString(), true)
|
||||||
.AddField(GetText("owner"), ownername.ToString(), true)
|
.AddField(GetText("owner"), ownername.ToString(), true)
|
||||||
@@ -145,8 +145,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
await ctx.Channel.EmbedAsync(new EmbedBuilder()
|
await ctx.Channel.EmbedAsync(new EmbedBuilder()
|
||||||
.WithTitle(GetText("activity_page", page + 1))
|
.WithTitle(GetText("activity_page", page + 1))
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithFooter(efb => efb.WithText(GetText("activity_users_total",
|
.WithFooter(GetText("activity_users_total", CmdHandler.UserMessagesSent.Count))
|
||||||
CmdHandler.UserMessagesSent.Count)))
|
|
||||||
.WithDescription(str.ToString())).ConfigureAwait(false);
|
.WithDescription(str.ToString())).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -260,21 +260,23 @@ namespace NadekoBot.Modules.Utility
|
|||||||
ownerIds = "-";
|
ownerIds = "-";
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(
|
await ctx.Channel.EmbedAsync(
|
||||||
new EmbedBuilder().WithOkColor()
|
new EmbedBuilder().WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName($"NadekoBot v{StatsService.BotVersion}")
|
.WithAuthor($"NadekoBot v{StatsService.BotVersion}",
|
||||||
.WithUrl("http://nadekobot.readthedocs.io/en/latest/")
|
"https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/avatar.png",
|
||||||
.WithIconUrl("https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/avatar.png"))
|
"https://nadekobot.readthedocs.io/en/latest/")
|
||||||
.AddField(GetText("author"), _stats.Author, true)
|
.AddField(GetText("author"), _stats.Author, true)
|
||||||
.AddField(GetText("botid"), _client.CurrentUser.Id.ToString(), true)
|
.AddField(GetText("botid"), _client.CurrentUser.Id.ToString(), true)
|
||||||
.AddField(GetText("shard"), $"#{_client.ShardId} / {_creds.TotalShards}", true)
|
.AddField(GetText("shard"), $"#{_client.ShardId} / {_creds.TotalShards}", true)
|
||||||
.AddField(GetText("commands_ran"), _stats.CommandsRan.ToString(), true)
|
.AddField(GetText("commands_ran"), _stats.CommandsRan.ToString(), true)
|
||||||
.AddField(GetText("messages"), $"{_stats.MessageCounter} ({_stats.MessagesPerSecond:F2}/sec)", true)
|
.AddField(GetText("messages"), $"{_stats.MessageCounter} ({_stats.MessagesPerSecond:F2}/sec)",
|
||||||
.AddField(GetText("memory"), $"{_stats.Heap} MB", true)
|
true)
|
||||||
.AddField(GetText("owner_ids"), ownerIds, true)
|
.AddField(GetText("memory"), $"{_stats.Heap} MB", true)
|
||||||
.AddField(GetText("uptime"), _stats.GetUptimeString("\n"), true)
|
.AddField(GetText("owner_ids"), ownerIds, true)
|
||||||
.AddField(efb => efb.WithName(GetText("presence")).WithValue(
|
.AddField(GetText("uptime"), _stats.GetUptimeString("\n"), true)
|
||||||
GetText("presence_txt",
|
.AddField(efb => efb.WithName(GetText("presence")).WithValue(
|
||||||
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels)).WithIsInline(true))).ConfigureAwait(false);
|
GetText("presence_txt",
|
||||||
|
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels)).WithIsInline(true)))
|
||||||
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
|
Reference in New Issue
Block a user