From 5d9320941aaf425e490d7ab80c1df80d952c6260 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 14 Jul 2021 23:58:34 +0200 Subject: [PATCH] Added fixes from 1.9 branch: - Custom reaction permission error fix - Local tracks .lq fix after they're loaded from playlist - Fixed some response strings --- .../Modules/CustomReactions/Services/CustomReactionsService.cs | 3 ++- src/NadekoBot/Modules/Games/Services/ChatterbotService.cs | 3 +-- src/NadekoBot/Modules/Music/Common/Impl/MusicExtensions.cs | 2 +- src/NadekoBot/Modules/Music/PlaylistCommands.cs | 2 +- src/NadekoBot/Modules/Utility/Services/RepeaterService.cs | 2 +- src/NadekoBot/data/strings/commands/commands.en-US.yml | 2 +- src/NadekoBot/data/strings/responses/responses.en-US.json | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/NadekoBot/Modules/CustomReactions/Services/CustomReactionsService.cs b/src/NadekoBot/Modules/CustomReactions/Services/CustomReactionsService.cs index ad6a629b7..ec7f19ceb 100644 --- a/src/NadekoBot/Modules/CustomReactions/Services/CustomReactionsService.cs +++ b/src/NadekoBot/Modules/CustomReactions/Services/CustomReactionsService.cs @@ -411,9 +411,10 @@ namespace NadekoBot.Modules.CustomReactions.Services { if (pc.Verbose) { - var returnMsg = _strings.GetText("trigger", sg.Id, + var returnMsg = _strings.GetText("perm_prevent", sg.Id, index + 1, Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), sg))); + try { await msg.Channel.SendErrorAsync(_eb, returnMsg).ConfigureAwait(false); diff --git a/src/NadekoBot/Modules/Games/Services/ChatterbotService.cs b/src/NadekoBot/Modules/Games/Services/ChatterbotService.cs index 2dd9d4339..855387310 100644 --- a/src/NadekoBot/Modules/Games/Services/ChatterbotService.cs +++ b/src/NadekoBot/Modules/Games/Services/ChatterbotService.cs @@ -122,8 +122,7 @@ namespace NadekoBot.Modules.Games.Services { if (pc.Verbose) { - var returnMsg = _strings.GetText("trigger", guild.Id, index + 1, Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild)guild))); - try { await usrMsg.Channel.SendErrorAsync(_eb, returnMsg).ConfigureAwait(false); } catch { } + var returnMsg = _strings.GetText("perm_prevent", guild.Id, index + 1, Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild)guild))); try { await usrMsg.Channel.SendErrorAsync(_eb, returnMsg).ConfigureAwait(false); } catch { } Log.Information(returnMsg); } return true; diff --git a/src/NadekoBot/Modules/Music/Common/Impl/MusicExtensions.cs b/src/NadekoBot/Modules/Music/Common/Impl/MusicExtensions.cs index c35e0ab2f..de9480a6e 100644 --- a/src/NadekoBot/Modules/Music/Common/Impl/MusicExtensions.cs +++ b/src/NadekoBot/Modules/Music/Common/Impl/MusicExtensions.cs @@ -26,7 +26,7 @@ namespace NadekoBot.Modules.Music => $"🔉 {(int) (mp.Volume * 100)}%"; public static string PrettyName(this ITrackInfo trackInfo) - => $"**[{trackInfo.Title.TrimTo(60).Replace("[", "\\[").Replace("]", "\\]")}]({trackInfo.Url})**"; + => $"**[{trackInfo.Title.TrimTo(60).Replace("[", "\\[").Replace("]", "\\]")}]({trackInfo.Url.TrimTo(50, true)})**"; public static string PrettyInfo(this IQueuedTrackInfo trackInfo) => $"{trackInfo.PrettyTotalTime()} | {trackInfo.Platform} | {trackInfo.Queuer}"; diff --git a/src/NadekoBot/Modules/Music/PlaylistCommands.cs b/src/NadekoBot/Modules/Music/PlaylistCommands.cs index 34bef8ee7..cf7353915 100644 --- a/src/NadekoBot/Modules/Music/PlaylistCommands.cs +++ b/src/NadekoBot/Modules/Music/PlaylistCommands.cs @@ -147,7 +147,7 @@ namespace NadekoBot.Modules.Music Provider = s.Platform.ToString(), ProviderType = (MusicType)s.Platform, Title = s.Title, - Query = s.Url, + Query = s.Platform == MusicPlatform.Local ? s.GetStreamUrl().Result!.Trim('"') : s.Url, }).ToList(); MusicPlaylist playlist; diff --git a/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs b/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs index c53edf6ea..fed88fd70 100644 --- a/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs +++ b/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs @@ -339,7 +339,7 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};") using var uow = _db.GetDbContext(); - if (await uow.Repeaters.AsNoTracking().CountAsyncEF(x => x.GuildId == guildId) < MAX_REPEATERS) + if (await uow.Repeaters.CountAsyncEF(x => x.GuildId == guildId) < MAX_REPEATERS) uow.Repeaters.Add(rep); else return null; diff --git a/src/NadekoBot/data/strings/commands/commands.en-US.yml b/src/NadekoBot/data/strings/commands/commands.en-US.yml index 088d908b1..f18276fc8 100644 --- a/src/NadekoBot/data/strings/commands/commands.en-US.yml +++ b/src/NadekoBot/data/strings/commands/commands.en-US.yml @@ -1401,7 +1401,7 @@ waifutransfer: args: - "@ExWaifu @NewOwner" waifugift: - desc: "Gift an item to someone. This will increase their waifu value by 50% of the gifted item's value if you are not their waifu, or 95% if you are. Provide no parameters to see a list of items that you can gift." + desc: "Gift an item to someone. This will increase their waifu value by 50% of the gifted item's value if they are not your waifu, or 95% if they are. Provide no parameters to see a list of items that you can gift." args: - "" - "Rose @Himesama" diff --git a/src/NadekoBot/data/strings/responses/responses.en-US.json b/src/NadekoBot/data/strings/responses/responses.en-US.json index 4b26621d3..10903879a 100644 --- a/src/NadekoBot/data/strings/responses/responses.en-US.json +++ b/src/NadekoBot/data/strings/responses/responses.en-US.json @@ -923,7 +923,7 @@ "global_leaderboard": "Global XP Leaderboard", "modified": "Modified server XP of the user {0} by {1}", "club_create_error": "Failed creating the club. Make sure you're above level 5 and not a member of a club already.", - "club_create_too_long": "Club name is too long.", + "club_name_too_long": "Club name is too long.", "club_created": "Club {0} successfully created!", "club_not_exists": "That club doesn't exist.", "club_applied": "You've applied for membership in {0} club.",