diff --git a/NadekoBot.Core/Common/CREmbed.cs b/NadekoBot.Core/Common/CREmbed.cs index 1dd31996..b790a12a 100644 --- a/NadekoBot.Core/Common/CREmbed.cs +++ b/NadekoBot.Core/Common/CREmbed.cs @@ -12,7 +12,7 @@ namespace NadekoBot.Common public string PlainText { get; set; } public string Title { get; set; } public string Description { get; set; } - public string TitleURL { get; set; } + public string Url { get; set; } public CREmbedFooter Footer { get; set; } public string Thumbnail { get; set; } public string Image { get; set; } @@ -27,7 +27,7 @@ namespace NadekoBot.Common public bool IsValid => !string.IsNullOrWhiteSpace(Title) || !string.IsNullOrWhiteSpace(Description) || - !string.IsNullOrWhiteSpace(TitleURL) || + !string.IsNullOrWhiteSpace(Url) || !string.IsNullOrWhiteSpace(Thumbnail) || !string.IsNullOrWhiteSpace(Image) || (Footer != null && (!string.IsNullOrWhiteSpace(Footer.Text) || !string.IsNullOrWhiteSpace(Footer.IconUrl))) || @@ -41,8 +41,8 @@ namespace NadekoBot.Common embed.WithTitle(Title); if (!string.IsNullOrWhiteSpace(Description)) embed.WithDescription(Description); - if (!string.IsNullOrWhiteSpace(TitleURL)) - embed.WithUrl(TitleURL); + if (Url != null && Uri.IsWellFormedUriString(Url, UriKind.Absolute)) + embed.WithUrl(Url); embed.WithColor(new Discord.Color(Color)); if (Footer != null) embed.WithFooter(efb => diff --git a/NadekoBot.Core/Modules/Administration/PrefixCommands.cs b/NadekoBot.Core/Modules/Administration/PrefixCommands.cs index 617ebc30..c8a981b2 100644 --- a/NadekoBot.Core/Modules/Administration/PrefixCommands.cs +++ b/NadekoBot.Core/Modules/Administration/PrefixCommands.cs @@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Administration [NadekoCommand, Usage, Description, Aliases] [OwnerOnly] - public async Task DefPrefix([Remainder]string prefix) + public async Task DefPrefix([Remainder]string prefix = null) { if (string.IsNullOrWhiteSpace(prefix)) { diff --git a/NadekoBot.Core/Modules/Administration/UserPunishCommands.cs b/NadekoBot.Core/Modules/Administration/UserPunishCommands.cs index 35f5629f..6f2de5a7 100644 --- a/NadekoBot.Core/Modules/Administration/UserPunishCommands.cs +++ b/NadekoBot.Core/Modules/Administration/UserPunishCommands.cs @@ -286,7 +286,7 @@ namespace NadekoBot.Modules.Administration } } - await Context.Guild.AddBanAsync(user, 7).ConfigureAwait(false); + await Context.Guild.AddBanAsync(user, 7, msg).ConfigureAwait(false); await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor() .WithTitle("⛔️ " + GetText("banned_user")) .AddField(efb => efb.WithName(GetText("username")).WithValue(user.ToString()).WithIsInline(true)) @@ -395,7 +395,7 @@ namespace NadekoBot.Modules.Administration catch { } } - await user.KickAsync().ConfigureAwait(false); + await user.KickAsync(msg).ConfigureAwait(false); await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor() .WithTitle(GetText("kicked_user")) .AddField(efb => efb.WithName(GetText("username")).WithValue(user.ToString()).WithIsInline(true)) diff --git a/NadekoBot.Core/Modules/Utility/Utility.cs b/NadekoBot.Core/Modules/Utility/Utility.cs index c5cdcc0f..6e7899f3 100644 --- a/NadekoBot.Core/Modules/Utility/Utility.cs +++ b/NadekoBot.Core/Modules/Utility/Utility.cs @@ -93,15 +93,17 @@ namespace NadekoBot.Modules.Utility { var rng = new NadekoRandom(); var usrs = (await Context.Guild.GetUsersAsync()).ToArray(); - var roleUsers = usrs.Where(u => u.RoleIds.Contains(role.Id)).Select(u => u.ToString()) + var roleUsers = usrs + .Where(u => u.RoleIds.Contains(role.Id)) + .Select(u => u.ToString()) .ToArray(); - var inroleusers = string.Join(", ", roleUsers - .OrderBy(x => rng.Next()) - .Take(50)); - var embed = new EmbedBuilder().WithOkColor() - .WithTitle("ℹ️ " + Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}") - .WithDescription($"```css\n[{role.Name}]\n{inroleusers}```"); - await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); + + await Context.Channel.SendPaginatedConfirmAsync(_client, 0, (cur) => + { + return new EmbedBuilder().WithOkColor() + .WithTitle(Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}") + .WithDescription(string.Join("\n", roleUsers.Skip(cur * 20).Take(20))); + }, roleUsers.Length, 20).ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] diff --git a/NadekoBot.Core/Services/Impl/StatsService.cs b/NadekoBot.Core/Services/Impl/StatsService.cs index ad5d5af9..4ca20e95 100644 --- a/NadekoBot.Core/Services/Impl/StatsService.cs +++ b/NadekoBot.Core/Services/Impl/StatsService.cs @@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl private readonly IBotCredentials _creds; private readonly DateTime _started; - public const string BotVersion = "2.5.1"; + public const string BotVersion = "2.5.3"; public string Author => "Kwoth#2560"; public string Library => "Discord.Net";