diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b31251ac..58820d7d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o +## [5.1.11] - 03.10.2024 + +### Added + +- Added `%user.displayname%` placeholder. It will show users nickname, if there is one, otherwise it will show the username. + - Nickname won't be shown in bye messages. +- Added initial version of grpc api. Beta + +### Fixed + +- Fixed a bug which caused `.bye` and `.greet` messages to be randomly disabled +- Fixed `.lb -c` breaking sometimes, and fixed pagination + +### Changed + +- Youtube now always uses `yt-dlp`. Dropped support for `youtube-dl` + - If you've previously renamed your yt-dlp file to youtube-dl, please rename it back. +- ytProvider in data/searches.yml now also controls where you're getting your song streams from. + - (Invidious support added for .q) + ## [5.1.10] - 24.09.2024 ### Fixed diff --git a/src/NadekoBot/Modules/Gambling/Gambling.cs b/src/NadekoBot/Modules/Gambling/Gambling.cs index 4fa88438d..de24fdfc6 100644 --- a/src/NadekoBot/Modules/Gambling/Gambling.cs +++ b/src/NadekoBot/Modules/Gambling/Gambling.cs @@ -646,12 +646,11 @@ public partial class Gambling : GamblingModule var cleanRichest = await uow.GetTable() .Where(x => x.UserId.In(users)) .OrderByDescending(x => x.CurrencyAmount) - .Skip(page * perPage) + .Skip(curPage * perPage) .Take(perPage) .ToListAsync(); - var sg = (SocketGuild)ctx.Guild!; - return cleanRichest.Where(x => sg.GetUser(x.UserId) is not null).ToList(); + return cleanRichest; } else { @@ -660,9 +659,6 @@ public partial class Gambling : GamblingModule } } - var res = Response() - .Paginated(); - await Response() .Paginated() .PageItems(GetTopRichest) diff --git a/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfig.cs b/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfig.cs index 32b618187..eeeac6a7d 100644 --- a/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfig.cs +++ b/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfig.cs @@ -28,11 +28,9 @@ public partial class SearchesConfig : ICloneable [Comment(""" Which search provider will be used for the `.youtube` and `.q` commands. - - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console + - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console. `.q` is not supported for this setting. It will fallback to yt-dlp. - - `ytdl` - default, uses youtube-dl. Requires `youtube-dl` to be installed and it's path added to env variables. Slow. - - - `ytdlp` - recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables + - `ytdlp` - default, recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables - `invidious` - recommended advanced, uses invidious api. Requires at least one invidious instance specified in the `invidiousInstances` property """)] diff --git a/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfigService.cs b/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfigService.cs index 361454667..914539867 100644 --- a/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfigService.cs +++ b/src/NadekoBot/Modules/Searches/_common/Config/SearchesConfigService.cs @@ -47,19 +47,11 @@ public class SearchesConfigService : ConfigServiceBase }); } - if (data.Version < 2) + if (data.Version < 4) { ModifyConfig(c => { - c.Version = 2; - }); - } - - if (data.Version < 3) - { - ModifyConfig(c => - { - c.Version = 3; + c.Version = 4; }); } } diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index 25fe4de81..466544eb7 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -4,7 +4,7 @@ enable true en - 5.1.10 + 5.1.11 $(MSBuildProjectDirectory) diff --git a/src/NadekoBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs b/src/NadekoBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs index 0eb91c19c..dee5d6998 100644 --- a/src/NadekoBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs +++ b/src/NadekoBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs @@ -65,6 +65,7 @@ public sealed partial class ReplacementPatternStore Register("%user.mention%", static (IUser user) => user.Mention); Register("%user.fullname%", static (IUser user) => user.ToString()!); Register("%user.name%", static (IUser user) => user.Username); + Register("%user.displayname%", static (IUser user) => user is IGuildUser gu ? gu.DisplayName : user.Username); Register("%user.discrim%", static (IUser user) => user.Discriminator); Register("%user.avatar%", static (IUser user) => user.RealAvatarUrl().ToString()); Register("%user.id%", static (IUser user) => user.Id.ToString()); diff --git a/src/NadekoBot/data/searches.yml b/src/NadekoBot/data/searches.yml index 18e3c4e97..99b85a922 100644 --- a/src/NadekoBot/data/searches.yml +++ b/src/NadekoBot/data/searches.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 3 +version: 4 # Which engine should .search command # 'google_scrape' - default. Scrapes the webpage for results. May break. Requires no api keys. # 'google' - official google api. Requires googleApiKey and google.searchId set in creds.yml @@ -11,14 +11,12 @@ webSearchEngine: Google_Scrape imgSearchEngine: Google # Which search provider will be used for the `.youtube` and `.q` commands. # -# - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console +# - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console. `.q` is not supported for this setting. It will fallback to yt-dlp. # -# - `ytdl` - default, uses youtube-dl. Requires `youtube-dl` to be installed and it's path added to env variables. Slow. -# -# - `ytdlp` - recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables +# - `ytdlp` - default, recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables # # - `invidious` - recommended advanced, uses invidious api. Requires at least one invidious instance specified in the `invidiousInstances` property -ytProvider: Ytdlp +ytProvider: Ytdl # Set the searx instance urls in case you want to use 'searx' for either img or web search. # Nadeko will use a random one for each request. # Use a fully qualified url. Example: `https://my-searx-instance.mydomain.com`