Merge remote-tracking branch 'remotes/NadekoBot/1.9' into 1.9

This commit is contained in:
xsftk
2017-11-15 13:31:33 +07:00
10 changed files with 48 additions and 46 deletions

View File

@ -47,6 +47,7 @@ namespace NadekoBot.Modules.Administration
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[Priority(0)]
public async Task LanguageSet()
{
var cul = _localization.GetCultureInfo(Context.Guild);
@ -57,6 +58,7 @@ namespace NadekoBot.Modules.Administration
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
[RequireUserPermission(GuildPermission.Administrator)]
[Priority(1)]
public async Task LanguageSet(string name)
{
try

View File

@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Searches
.WithTitle(novelData.Title)
.WithUrl(novelData.Link)
.WithImageUrl(novelData.ImageUrl)
.AddField(efb => efb.WithName(GetText("authors")).WithValue(String.Join("\n", novelData.Authors)).WithIsInline(true))
.AddField(efb => efb.WithName(GetText("authors")).WithValue(string.Join("\n", novelData.Authors)).WithIsInline(true))
.AddField(efb => efb.WithName(GetText("status")).WithValue(novelData.Status).WithIsInline(true))
.AddField(efb => efb.WithName(GetText("genres")).WithValue(string.Join(" ", novelData.Genres.Any() ? novelData.Genres : new[] { "none" })).WithIsInline(true))
.WithFooter(efb => efb.WithText(GetText("score") + " " + novelData.Score));

View File

@ -67,6 +67,8 @@ namespace NadekoBot.Modules.Searches.Services
var document = await BrowsingContext.New(config).OpenAsync(link);
var imageElem = document.QuerySelector("div.seriesimg > img");
if (imageElem == null)
return null;
var imageUrl = ((IHtmlImageElement)imageElem).Source;
var descElem = document.QuerySelector("div#editdescription > p");

View File

@ -51,7 +51,6 @@ namespace NadekoBot.Modules.Searches.Services
public ConcurrentDictionary<ulong, Timer> AutoButtTimers { get; } = new ConcurrentDictionary<ulong, Timer>();
private readonly ConcurrentDictionary<ulong, HashSet<string>> _blacklistedTags = new ConcurrentDictionary<ulong, HashSet<string>>();
private readonly Timer _t;
private readonly SemaphoreSlim _cryptoLock = new SemaphoreSlim(1, 1);
public async Task<CryptoData[]> CryptoData()
@ -132,22 +131,6 @@ namespace NadekoBot.Modules.Searches.Services
return Task.CompletedTask;
};
if (client.ShardId == 0)
{
_t = new Timer(async _ =>
{
var r = _cache.Redis.GetDatabase();
try
{
}
catch (Exception ex)
{
_log.Warn(ex);
}
}, null, TimeSpan.Zero, TimeSpan.FromHours(1));
}
//joke commands
if (File.Exists("data/wowjokes.json"))
{

View File

@ -7,7 +7,7 @@
public object declined_since { get; set; }
public bool is_twitch_pledge { get; set; }
public bool patron_pays_fees { get; set; }
public int pledge_cap_cents { get; set; }
public int? pledge_cap_cents { get; set; }
}
public class Address

View File

@ -118,7 +118,7 @@ namespace NadekoBot.Modules.Utility
[OwnerOnly]
public async Task Activity(int page = 1)
{
const int activityPerPage = 15;
const int activityPerPage = 10;
page -= 1;
if (page < 0)