Merge remote-tracking branch 'Kwoth/1.9' into 1.9

This commit is contained in:
Shikhir Arora 2017-11-17 05:46:55 -05:00
commit 901e354735
5 changed files with 18 additions and 16 deletions

View File

@ -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 =>

View File

@ -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))
{

View File

@ -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))

View File

@ -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]

View File

@ -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";