Merge remote-tracking branch 'Kwoth/1.9' into 1.9
This commit is contained in:
commit
901e354735
@ -12,7 +12,7 @@ namespace NadekoBot.Common
|
|||||||
public string PlainText { get; set; }
|
public string PlainText { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string TitleURL { get; set; }
|
public string Url { get; set; }
|
||||||
public CREmbedFooter Footer { get; set; }
|
public CREmbedFooter Footer { get; set; }
|
||||||
public string Thumbnail { get; set; }
|
public string Thumbnail { get; set; }
|
||||||
public string Image { get; set; }
|
public string Image { get; set; }
|
||||||
@ -27,7 +27,7 @@ namespace NadekoBot.Common
|
|||||||
public bool IsValid =>
|
public bool IsValid =>
|
||||||
!string.IsNullOrWhiteSpace(Title) ||
|
!string.IsNullOrWhiteSpace(Title) ||
|
||||||
!string.IsNullOrWhiteSpace(Description) ||
|
!string.IsNullOrWhiteSpace(Description) ||
|
||||||
!string.IsNullOrWhiteSpace(TitleURL) ||
|
!string.IsNullOrWhiteSpace(Url) ||
|
||||||
!string.IsNullOrWhiteSpace(Thumbnail) ||
|
!string.IsNullOrWhiteSpace(Thumbnail) ||
|
||||||
!string.IsNullOrWhiteSpace(Image) ||
|
!string.IsNullOrWhiteSpace(Image) ||
|
||||||
(Footer != null && (!string.IsNullOrWhiteSpace(Footer.Text) || !string.IsNullOrWhiteSpace(Footer.IconUrl))) ||
|
(Footer != null && (!string.IsNullOrWhiteSpace(Footer.Text) || !string.IsNullOrWhiteSpace(Footer.IconUrl))) ||
|
||||||
@ -41,8 +41,8 @@ namespace NadekoBot.Common
|
|||||||
embed.WithTitle(Title);
|
embed.WithTitle(Title);
|
||||||
if (!string.IsNullOrWhiteSpace(Description))
|
if (!string.IsNullOrWhiteSpace(Description))
|
||||||
embed.WithDescription(Description);
|
embed.WithDescription(Description);
|
||||||
if (!string.IsNullOrWhiteSpace(TitleURL))
|
if (Url != null && Uri.IsWellFormedUriString(Url, UriKind.Absolute))
|
||||||
embed.WithUrl(TitleURL);
|
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(efb =>
|
||||||
|
@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[OwnerOnly]
|
[OwnerOnly]
|
||||||
public async Task DefPrefix([Remainder]string prefix)
|
public async Task DefPrefix([Remainder]string prefix = null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(prefix))
|
if (string.IsNullOrWhiteSpace(prefix))
|
||||||
{
|
{
|
||||||
|
@ -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()
|
await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
|
||||||
.WithTitle("⛔️ " + GetText("banned_user"))
|
.WithTitle("⛔️ " + GetText("banned_user"))
|
||||||
.AddField(efb => efb.WithName(GetText("username")).WithValue(user.ToString()).WithIsInline(true))
|
.AddField(efb => efb.WithName(GetText("username")).WithValue(user.ToString()).WithIsInline(true))
|
||||||
@ -395,7 +395,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
await user.KickAsync().ConfigureAwait(false);
|
await user.KickAsync(msg).ConfigureAwait(false);
|
||||||
await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
|
await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
|
||||||
.WithTitle(GetText("kicked_user"))
|
.WithTitle(GetText("kicked_user"))
|
||||||
.AddField(efb => efb.WithName(GetText("username")).WithValue(user.ToString()).WithIsInline(true))
|
.AddField(efb => efb.WithName(GetText("username")).WithValue(user.ToString()).WithIsInline(true))
|
||||||
|
@ -93,15 +93,17 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
var rng = new NadekoRandom();
|
var rng = new NadekoRandom();
|
||||||
var usrs = (await Context.Guild.GetUsersAsync()).ToArray();
|
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();
|
.ToArray();
|
||||||
var inroleusers = string.Join(", ", roleUsers
|
|
||||||
.OrderBy(x => rng.Next())
|
await Context.Channel.SendPaginatedConfirmAsync(_client, 0, (cur) =>
|
||||||
.Take(50));
|
{
|
||||||
var embed = new EmbedBuilder().WithOkColor()
|
return new EmbedBuilder().WithOkColor()
|
||||||
.WithTitle("ℹ️ " + Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}")
|
.WithTitle(Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}")
|
||||||
.WithDescription($"```css\n[{role.Name}]\n{inroleusers}```");
|
.WithDescription(string.Join("\n", roleUsers.Skip(cur * 20).Take(20)));
|
||||||
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
}, roleUsers.Length, 20).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
|
@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl
|
|||||||
private readonly IBotCredentials _creds;
|
private readonly IBotCredentials _creds;
|
||||||
private readonly DateTime _started;
|
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 Author => "Kwoth#2560";
|
||||||
public string Library => "Discord.Net";
|
public string Library => "Discord.Net";
|
||||||
|
Loading…
Reference in New Issue
Block a user