From d275dc36b233a4a62ecf27219c84b7be66d144ac Mon Sep 17 00:00:00 2001 From: Alan Beatty Date: Sat, 18 Dec 2021 11:13:02 +0000 Subject: [PATCH 1/8] Update xpex channel to use the right string --- src/NadekoBot/Modules/Xp/Xp.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Xp/Xp.cs b/src/NadekoBot/Modules/Xp/Xp.cs index dcf851b3f..646a2c286 100644 --- a/src/NadekoBot/Modules/Xp/Xp.cs +++ b/src/NadekoBot/Modules/Xp/Xp.cs @@ -1,4 +1,4 @@ -using Discord; +using Discord; using Discord.Commands; using Discord.WebSocket; using NadekoBot.Common.Attributes; @@ -274,7 +274,7 @@ namespace NadekoBot.Modules.Xp } else { - await ReplyConfirmLocalizedAsync(strs.excluded(Format.Bold(channel.ToString()))); + await ReplyConfirmLocalizedAsync(strs.not_excluded(Format.Bold(channel.ToString()))); } } From 8c66bcb1e1be2b9df1a464f524335a0d52a8c2a2 Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Sat, 18 Dec 2021 21:09:16 +0000 Subject: [PATCH 2/8] separated "cd output && cp creds_example.yml creds.yml" --- docs/guides/windows-guide.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/guides/windows-guide.md b/docs/guides/windows-guide.md index 2b5198323..9d95dba54 100644 --- a/docs/guides/windows-guide.md +++ b/docs/guides/windows-guide.md @@ -83,11 +83,12 @@ Open PowerShell (press windows button on your keyboard and type powershell, it s 1. `git clone https://gitlab.com/kwoth/nadekobot -b v3 --depth 1` 2. `cd nadekobot` 3. `dotnet publish -c Release -o output/ src/NadekoBot/` -4. `cd output && cp creds_example.yml creds.yml` -5. Open `creds.yml` with your favorite text editor (Please don't use Notepad or WordPad. You can use Notepad++, VSCode, Atom, Sublime, or something similar) -6. [Enter your bot's token](#creds-guide) -7. Run the bot `dotnet NadekoBot.dll` -8. 🎉 +4. `cd output' +5. 'cp creds_example.yml creds.yml` +6. Open `creds.yml` with your favorite text editor (Please don't use Notepad or WordPad. You can use Notepad++, VSCode, Atom, Sublime, or something similar) +7. [Enter your bot's token](#creds-guide) +8. Run the bot `dotnet NadekoBot.dll` +9. 🎉 ##### Update Instructions From 8e8e349e65b70a8262599a0010936822ae0e07d2 Mon Sep 17 00:00:00 2001 From: Alan Beatty Date: Sat, 18 Dec 2021 21:10:06 +0000 Subject: [PATCH 3/8] Small `.trans` fixes --- src/NadekoBot/Modules/Searches/TranslatorCommands.cs | 2 +- src/NadekoBot/data/strings/commands/commands.en-US.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/TranslatorCommands.cs b/src/NadekoBot/Modules/Searches/TranslatorCommands.cs index f8957891d..737a674fe 100644 --- a/src/NadekoBot/Modules/Searches/TranslatorCommands.cs +++ b/src/NadekoBot/Modules/Searches/TranslatorCommands.cs @@ -12,7 +12,7 @@ namespace NadekoBot.Modules.Searches public class TranslateCommands : NadekoSubmodule { [NadekoCommand, Aliases] - public async Task Translate(string from, string to, [Leftover] string text = null) + public async Task Translate(string from, string to, [Leftover] string text) { try { diff --git a/src/NadekoBot/data/strings/commands/commands.en-US.yml b/src/NadekoBot/data/strings/commands/commands.en-US.yml index fbc6b7c1f..ab27fcafb 100644 --- a/src/NadekoBot/data/strings/commands/commands.en-US.yml +++ b/src/NadekoBot/data/strings/commands/commands.en-US.yml @@ -1143,9 +1143,9 @@ butts: args: - "" translate: - desc: "Translates from>to text. From the given language to the destination language." + desc: "Translates text from the given language to the destination language." args: - - "en>fr Hello" + - "en fr Hello" translangs: desc: "Lists the valid languages for translation." args: From 14016a761d977f1c86c84f1552bb26005c530430 Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Sun, 19 Dec 2021 00:24:55 +0000 Subject: [PATCH 4/8] fixed broken "Enter your bot's token" link in "linux release" portion --- docs/guides/linux-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/linux-guide.md b/docs/guides/linux-guide.md index 8a0a94738..af5c7e3f0 100644 --- a/docs/guides/linux-guide.md +++ b/docs/guides/linux-guide.md @@ -49,7 +49,7 @@ Open Terminal (if you're on an installation with a window manager) and navigate - `cp creds_example.yml creds.yml` 6. Open `creds.yml` with your favorite text editor. We will use nano here - `nano nadekobot/output/creds.yml` -8. [Enter your bot's token](#creds-guide) +8. [Enter your bot's token](../../creds-guide) - After you're done, you can close nano (and save the file) by inputting, in order - `CTRL` + `X` - `Y` From d1be56fbc1fc1bdff798e9fbcc13fa1c792f5f92 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 19 Dec 2021 01:56:30 +0100 Subject: [PATCH 5/8] Another attempt at fixing a weird coordinator bug --- .../Services/CoordinatorRunner.cs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/NadekoBot.Coordinator/Services/CoordinatorRunner.cs b/src/NadekoBot.Coordinator/Services/CoordinatorRunner.cs index 346a1f55c..6246b6760 100644 --- a/src/NadekoBot.Coordinator/Services/CoordinatorRunner.cs +++ b/src/NadekoBot.Coordinator/Services/CoordinatorRunner.cs @@ -160,18 +160,24 @@ namespace NadekoBot.Coordinator private void StartShard(int shardId) { var status = _shardStatuses[shardId]; - if (status.Process is {HasExited: false} p) + try { - try + if (status.Process is { HasExited: false } p) { - p.Kill(true); + try + { + p.Kill(true); + } + catch + { + } } - catch - { - } - } - try { status.Process?.Dispose(); } catch { } + status.Process?.Dispose(); + } + catch + { + } var proc = StartShardProcess(shardId); _shardStatuses[shardId] = status with From cbea5077be5392612287c7351e68e5bf595a9796 Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Mon, 20 Dec 2021 04:40:53 +0000 Subject: [PATCH 6/8] updated "GoogleAPIKey" section --- docs/jsons-explained.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/jsons-explained.md b/docs/jsons-explained.md index f2ce3c422..c4a341769 100644 --- a/docs/jsons-explained.md +++ b/docs/jsons-explained.md @@ -8,8 +8,11 @@ This part is completely optional, **however it's necessary for music and a few o - Go to [Google Console][Google Console] and log in. - Create a new project (name does not matter). - Once the project is created, go into `Library` - - Under the `YouTube APIs` section, enable `YouTube Data API` - - On the left tab, access `Credentials`, + - Under the `YouTube APIs` section + - Select `YouTube Data API v3`, + - Click enable. + - Open up the `Navigation menu` on the top right with the three lines. + - select `APIs & Services`, then select `Credentials`, - Click `Create Credentials` button, - Click on `API Key` - A new window will appear with your `Google API key` From c42d5290160badd32b2af2e33531819c3cda85f8 Mon Sep 17 00:00:00 2001 From: Alan Beatty Date: Tue, 21 Dec 2021 00:00:45 +0000 Subject: [PATCH 7/8] Fix color for ban DMs with plain text ban message. --- .../Modules/Administration/Services/UserPunishService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs b/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs index be357e140..8f1f9ebbb 100644 --- a/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs +++ b/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs @@ -499,7 +499,9 @@ WHERE GuildId={guildId} { template = JsonConvert.SerializeObject(new { - color = _bcs.Data.Color.Error, + //To get the decimal version of the color that's expected, take the packed value of the Rgba32 + //and bitshift it to the right by 8 bits, thereby dropping the "a" and getting a reprensentation of the RGB value + color = _bcs.Data.Color.Error.PackedValue >> 8, description = defaultMessage }); } @@ -514,7 +516,9 @@ WHERE GuildId={guildId} { template = JsonConvert.SerializeObject(new { - color = _bcs.Data.Color.Error, + //To get the decimal version of the color that's expected, take the packed value of the Rgba32 + //and bitshift it to the right by 8 bits, thereby dropping the "a" and getting a reprensentation of the RGB value + color = _bcs.Data.Color.Error.PackedValue >> 8, description = template }); } From 9a4bb7bff94c6eeae48245a7201eccb8287eaae4 Mon Sep 17 00:00:00 2001 From: Alan Beatty Date: Tue, 21 Dec 2021 01:20:52 +0000 Subject: [PATCH 8/8] ToLower for `.trans` language parameters --- src/NadekoBot/Modules/Searches/TranslatorCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Searches/TranslatorCommands.cs b/src/NadekoBot/Modules/Searches/TranslatorCommands.cs index 737a674fe..d184dac0e 100644 --- a/src/NadekoBot/Modules/Searches/TranslatorCommands.cs +++ b/src/NadekoBot/Modules/Searches/TranslatorCommands.cs @@ -17,7 +17,7 @@ namespace NadekoBot.Modules.Searches try { await ctx.Channel.TriggerTypingAsync().ConfigureAwait(false); - var translation = await _service.Translate(from, to, text).ConfigureAwait(false); + var translation = await _service.Translate(from.ToLower(), to.ToLower(), text).ConfigureAwait(false); var embed = _eb.Create(ctx) .WithOkColor()