Merge branch 'wip' into 1.9

This commit is contained in:
Master Kwoth 2017-11-14 06:19:18 +01:00
commit 8e10cc6684
8 changed files with 13 additions and 24 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

@ -26,7 +26,7 @@ namespace NadekoBot.Modules.Searches
if (novelData == null)
{
await ReplyErrorLocalized("error_finding_novel").ConfigureAwait(false);
await ReplyErrorLocalized("failed_finding_novel").ConfigureAwait(false);
return;
}
@ -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)

View File

@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl
private readonly IBotCredentials _creds;
private readonly DateTime _started;
public const string BotVersion = "2.4.3";
public const string BotVersion = "2.4.4";
public string Author => "Kwoth#2560";
public string Library => "Discord.Net";

View File

@ -841,8 +841,10 @@
"xp_level_up_channel": "Congratulations {0}, You've reached level {1}!",
"xp_level_up_dm": "Congratulations {0}, You've reached level {1} on {2} server!",
"xp_level_up_global": "Congratulations {0}, You've reached global level {1}!",
"xp_role_reward_cleared": "Level {0} will no longer reward a role.",
"xp_role_reward_cleared": "Reaching level {0} will no longer reward a role.",
"xp_role_reward_added": "Users who reach level {0} will receive {1} role.",
"xp_cur_reward_cleared": "Reaching level {0} will no longer reward any {1}.",
"xp_cur_reward_added": "Users who reach level {0} will receive {1}.",
"xp_role_rewards": "Role Rewards",
"xp_level_x": "Level {0}",
"xp_no_role_rewards": "No role reward on this page.",
@ -923,5 +925,5 @@
"administration_invalid": "Invalid / Can't be found ({0})",
"administration_mass_kill_in_progress": "Mass Banning and Blacklisting of {0} users is in progress...",
"administration_mass_kill_completed": "Mass Banning and Blacklisting of {0} users is complete.",
"searches_error_finding_novel": "Can't find that novel. Make sure you've typed the exact full name, and that it exists on novelupdates.com"
"searches_failed_finding_novel": "Can't find that novel. Make sure you've typed the exact full name, and that it exists on novelupdates.com"
}