From eed3d47871fea74abd9d5f7afb92f314a69dc9cf Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 05:32:05 +0100 Subject: [PATCH 01/11] .novel error fix --- NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs b/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs index 1b8c89a3..fb1b0bd0 100644 --- a/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs +++ b/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs @@ -26,7 +26,7 @@ namespace NadekoBot.Modules.Searches if (novelData == null) { - await ReplyErrorLocalized("failed_finding_novel").ConfigureAwait(false); + await ReplyErrorLocalized("error_finding_novel").ConfigureAwait(false); return; } From b406ec7eb694c9fe36b5a8d704e33e0f4dd2a0b0 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 06:47:03 +0100 Subject: [PATCH 02/11] strings --- src/NadekoBot/_strings/ResponseStrings.en-US.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/_strings/ResponseStrings.en-US.json b/src/NadekoBot/_strings/ResponseStrings.en-US.json index c92aaf75..12b5ba93 100644 --- a/src/NadekoBot/_strings/ResponseStrings.en-US.json +++ b/src/NadekoBot/_strings/ResponseStrings.en-US.json @@ -922,5 +922,6 @@ "administration_self_assign_not_level": "That self-assignable role requires at least server level {0}.", "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." + "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" } \ No newline at end of file From 497e25b19932b4e2027bb149ec6bad6621021138 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 06:50:12 +0100 Subject: [PATCH 03/11] Removed leftover thing --- .../Modules/Searches/Services/SearchesService.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs b/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs index 2755cfb1..098364d9 100644 --- a/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs +++ b/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs @@ -132,22 +132,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")) { From ee929c6dfc3edacc926c05e2788ab0b6edb2c9ee Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 07:57:01 +0100 Subject: [PATCH 04/11] .novel fixed, close #1819 --- NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs | 4 ++-- .../Modules/Searches/Services/AnimeSearchService.cs | 2 ++ NadekoBot.Core/Modules/Searches/Services/SearchesService.cs | 1 - src/NadekoBot/_strings/ResponseStrings.en-US.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs b/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs index fb1b0bd0..0fe17431 100644 --- a/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs +++ b/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs @@ -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)); diff --git a/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs b/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs index e236fa51..daa5492c 100644 --- a/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs +++ b/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs @@ -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"); diff --git a/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs b/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs index 098364d9..8656a038 100644 --- a/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs +++ b/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs @@ -51,7 +51,6 @@ namespace NadekoBot.Modules.Searches.Services public ConcurrentDictionary AutoButtTimers { get; } = new ConcurrentDictionary(); private readonly ConcurrentDictionary> _blacklistedTags = new ConcurrentDictionary>(); - private readonly Timer _t; private readonly SemaphoreSlim _cryptoLock = new SemaphoreSlim(1, 1); public async Task CryptoData() diff --git a/src/NadekoBot/_strings/ResponseStrings.en-US.json b/src/NadekoBot/_strings/ResponseStrings.en-US.json index 12b5ba93..dfabc637 100644 --- a/src/NadekoBot/_strings/ResponseStrings.en-US.json +++ b/src/NadekoBot/_strings/ResponseStrings.en-US.json @@ -923,5 +923,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" } \ No newline at end of file From 35005b92b36eef6a28077ee148448cbf10528a93 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 08:15:06 +0100 Subject: [PATCH 05/11] Maybe fixes #1811 --- NadekoBot.Core/Modules/Administration/LocalizationCommands.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NadekoBot.Core/Modules/Administration/LocalizationCommands.cs b/NadekoBot.Core/Modules/Administration/LocalizationCommands.cs index d91a50a8..677eff0d 100644 --- a/NadekoBot.Core/Modules/Administration/LocalizationCommands.cs +++ b/NadekoBot.Core/Modules/Administration/LocalizationCommands.cs @@ -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 From 4e371275369d49146d9c19248f12df7304666bf7 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 08:18:40 +0100 Subject: [PATCH 06/11] Possibly fix #1821 --- NadekoBot.Core/Modules/Utility/InfoCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot.Core/Modules/Utility/InfoCommands.cs b/NadekoBot.Core/Modules/Utility/InfoCommands.cs index 96243dcc..26fca5c4 100644 --- a/NadekoBot.Core/Modules/Utility/InfoCommands.cs +++ b/NadekoBot.Core/Modules/Utility/InfoCommands.cs @@ -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) From 95584cba6236d124ef49cd4f237a322ec5b893fe Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 08:43:51 +0100 Subject: [PATCH 07/11] upped version to 2.4.4 --- NadekoBot.Core/Services/Impl/StatsService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot.Core/Services/Impl/StatsService.cs b/NadekoBot.Core/Services/Impl/StatsService.cs index d05ff01f..044cda71 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.4.3"; + public const string BotVersion = "2.4.4"; public string Author => "Kwoth#2560"; public string Library => "Discord.Net"; From 3d8ee6ad324d3952c663682c10199ab318e3bc4d Mon Sep 17 00:00:00 2001 From: MaybeGoogle <30007491+MaybeGoogle@users.noreply.github.com> Date: Sun, 12 Nov 2017 13:42:18 -0600 Subject: [PATCH 08/11] Changes to docker guide - Added copy command - Formatted in a way that is more similar to the other guides. - Better logical flow - Grammar fixes --- docs/guides/Docker Guide.md | 56 ++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/docs/guides/Docker Guide.md b/docs/guides/Docker Guide.md index 5c50e73d..319914a4 100644 --- a/docs/guides/Docker Guide.md +++ b/docs/guides/Docker Guide.md @@ -1,33 +1,43 @@ -# NadekoBot a Discord bot +# Setting up NadekoBot on Docker Nadeko is written in C# and Discord.Net for more information visit -## Install Docker -Follow the respective guide for your operating system found here [Docker Engine Install Guide](https://docs.docker.com/engine/installation/) +#### Prerequisites +- [Docker](https://docs.docker.com/engine/installation/) +- [Create Discord Bot application](http://nadekobot.readthedocs.io/en/latest/JSON%20Explanations/#creating-discord-bot-application) and [Invite the bot to your server](http://nadekobot.readthedocs.io/en/latest/JSON%20Explanations/#inviting-your-bot-to-your-server). -## Nadeko Setup Guide +#### Setting up the container For this guide we will be using the folder /nadeko as our config root folder. - -```bash +``` docker create --name=nadeko -v /nadeko/conf/:/root/nadeko -v /nadeko/data:/opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data uirel/nadeko:1.4 ``` --If you are coming from a previous version of nadeko (the old docker) make sure your credentials.json has been copied into this directory and is the only thing in this folder. --If you are making a fresh install, create your credentials.json from the following guide and place it in the /nadeko folder [Nadeko JSON Guide](http://nadekobot.readthedocs.io/en/latest/JSON%20Explanations/) +#### Moving `credentials.json` into the docker container. -Next start the docker up with `docker start nadeko; docker logs -f nadeko` +- If you are coming from a previous version of nadeko (the old docker) make sure your credentials.json has been copied into this directory and is the only thing in this folder. +- If you are making a fresh install, create your credentials.json from the following guide and place it in the /nadeko folder [Nadeko JSON Guide](http://nadekobot.readthedocs.io/en/latest/JSON%20Explanations/). +- To copy the the file from your computer to a container: +``` +docker cp /Directory/That/Contains/Your/credentials.json nadeko:/credentials.json +``` -The docker will start and the log file will start scrolling past. Depending on hardware the bot start can take up to 5 minutes on a small DigitalOcean droplet. -Once the log ends with "NadekoBot | Starting NadekoBot v1.0-rc2" the bot is ready and can be invited to your server. Ctrl+C at this point to stop viewing the logs. +#### Start up docker +``` +docker start nadeko; docker logs -f nadeko +``` +The docker will start and the log file will start scrolling past. This may take a long time. The bot start can take up to 5 minutes on a small DigitalOcean droplet. +Once the log ends with "NadekoBot | Starting NadekoBot vX.X" the bot is ready and can be invited to your server. Ctrl+C at this point if you would like to stop viewing the logs. -After a few moments you should be able to invite Nadeko to your server. If you cannot, check the log file for errors. +After a few moments, Nadeko should come online on your server. If it doesn't, check the log file for errors. -## Monitoring +#### Monitoring +**To monitor the logs of the container in realtime** +``` +docker logs -f nadeko +``` -* Monitor the logs of the container in realtime `docker logs -f nadeko`. +### Updates -## Updates - -# Manual +#### Manual Updates are handled by pulling the new layer of the Docker Container which contains a pre compiled update to Nadeko. The following commands are required for the default options @@ -42,17 +52,17 @@ docker create --name=nadeko -v /nadeko/conf/:/root/nadeko -v /nadeko/data:/opt/N `docker start nadeko` -# Automatic Updates -Automatic update are now handled by WatchTower [WatchTower GitHub](https://github.com/CenturyLinkLabs/watchtower) -To setup WatchTower to keep Nadeko up-to-date for you with the default settings, use the following command +#### Automatic +Automatic update are handled by [WatchTower](https://github.com/CenturyLinkLabs/watchtower). +To setup WatchTower to keep Nadeko up-to-date for you with the default settings, use the following command: ```bash -docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock centurylink/watchtower --cleanup nadeko +docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock centurylink/watchtower --cleanup nadeko --interval 300 ``` -This will check for updates to the docker every 5 minutes and update immediately. Alternatively using the `--interval X` command to change the interval, where X is the amount of time in seconds to wait. e.g 21600 for 6 hours. - +This will check for updates to the docker every 5 minutes and update immediately. To check in different intervals, change `X`. X is the amount of time, in seconds. (e.g 21600 for 6 hours) +### Additional Info If you have any issues with the docker setup, please ask in #help channel on our [Discord server](https://discordapp.com/invite/nadekobot) but indicate you are using the docker. For information about configuring your bot or its functionality, please check the [documentation](http://nadekobot.readthedocs.io/en/latest). From c8b4dc68a2f6dff7dfd43b971a10b2bfc0e6c71d Mon Sep 17 00:00:00 2001 From: MaybeGoogle <30007491+MaybeGoogle@users.noreply.github.com> Date: Sun, 12 Nov 2017 13:44:58 -0600 Subject: [PATCH 09/11] :'( redis still not there hope this is the right place this time --- docs/guides/OSX Guide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guides/OSX Guide.md b/docs/guides/OSX Guide.md index b16313ba..3ec49175 100644 --- a/docs/guides/OSX Guide.md +++ b/docs/guides/OSX Guide.md @@ -26,6 +26,8 @@ brew install libsodium brew install tmux brew install python brew install youtube-dl +brew install redis +brew services start redis ``` #### Installing .NET Core SDK From c4689f267a8bc51d6cfccea412aee79c645aff53 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 14 Nov 2017 06:17:22 +0100 Subject: [PATCH 10/11] fixed #1826 --- NadekoBot.Core/Modules/Utility/Common/Patreon/PatreonPledge.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot.Core/Modules/Utility/Common/Patreon/PatreonPledge.cs b/NadekoBot.Core/Modules/Utility/Common/Patreon/PatreonPledge.cs index 9960039f..ae46aeaa 100644 --- a/NadekoBot.Core/Modules/Utility/Common/Patreon/PatreonPledge.cs +++ b/NadekoBot.Core/Modules/Utility/Common/Patreon/PatreonPledge.cs @@ -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 From fcc006ccc0d46c388a807b37f084a9c6232cfe54 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 14 Nov 2017 06:18:50 +0100 Subject: [PATCH 11/11] small string update --- src/NadekoBot/_strings/ResponseStrings.en-US.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/_strings/ResponseStrings.en-US.json b/src/NadekoBot/_strings/ResponseStrings.en-US.json index 12b5ba93..b40fb3eb 100644 --- a/src/NadekoBot/_strings/ResponseStrings.en-US.json +++ b/src/NadekoBot/_strings/ResponseStrings.en-US.json @@ -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.",