From 2caf406254e553f9fddf0d6d8c22f0cd1160c182 Mon Sep 17 00:00:00 2001 From: Clithulhu Date: Wed, 16 Aug 2023 07:14:39 +0000 Subject: [PATCH 1/2] Install yt-dlp instead of youtube-dl --- Dockerfile | 7 +++---- docker-compose.yml | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 65cf90f3f..c42d49beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,12 +28,11 @@ WORKDIR /app RUN set -xe; \ useradd -m nadeko; \ apt-get update; \ - apt-get install -y --no-install-recommends libopus0 libsodium23 libsqlite3-0 curl ffmpeg python3 python3-pip sudo; \ + apt-get install -y --no-install-recommends libopus0 libsodium23 libsqlite3-0 curl ffmpeg python3 sudo; \ update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1; \ echo 'Defaults>nadeko env_keep+="ASPNETCORE_* DOTNET_* NadekoBot_* shard_id total_shards TZ"' > /etc/sudoers.d/nadeko; \ - pip3 install --no-cache-dir --upgrade youtube-dl; \ - apt-get purge -y python3-pip; \ - chmod +x /usr/local/bin/youtube-dl; \ + curl -Lo /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp; \ + chmod a+rx /usr/local/bin/yt-dlp; \ apt-get autoremove -y; \ apt-get autoclean -y diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..f8369185b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3.7" + +services: + nadeko: + image: insert-image-name-here:latest + depends_on: + - redis + environment: + TZ: Europe/Paris + NadekoBot_RedisOptions: redis,name=nadeko + #NadekoBot_ShardRunCommand: dotnet + #NadekoBot_ShardRunArguments: /app/NadekoBot.dll {0} {1} + volumes: + - /srv/nadeko/conf:/app/conf:ro + - /srv/nadeko/data:/app/data + + redis: + image: redis:4-alpine + sysctls: + - net.core.somaxconn=511 + command: redis-server --maxmemory 32M --maxmemory-policy volatile-lru + volumes: + - /srv/nadeko/redis-data:/data From 97ae7b5a5b22519929a9b9eda46658bf79cf9103 Mon Sep 17 00:00:00 2001 From: Ene <4186225-Kieteyuku@users.noreply.gitlab.com> Date: Mon, 4 Sep 2023 04:08:07 +0000 Subject: [PATCH 2/2] fix to gift being character limited (!302), and fixes UserUpdated and UserPresence not correctly ignoring users that are logignored. --- .../ServerLog/ServerLogCommandService.cs | 7 ++++--- .../Modules/Gambling/Waifus/WaifuClaimCommands.cs | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs index eb56ce2bb..03e21ccf3 100644 --- a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs +++ b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs @@ -98,7 +98,8 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor if (!GuildLogSettings.TryGetValue(gu.Guild.Id, out var logSetting) || before is null - || after is null) + || after is null + || logSetting.LogIgnores.Any(ilc => ilc.LogItemId == gu.Id && ilc.ItemType == IgnoredItemType.User)) return; ITextChannel? logChannel; @@ -350,7 +351,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor var g = after.Guild; - if (!GuildLogSettings.TryGetValue(g.Id, out var logSetting) || logSetting.UserUpdatedId is null) + if (!GuildLogSettings.TryGetValue(g.Id, out var logSetting) || logSetting.UserUpdatedId is null || logSetting.LogIgnores.Any(ilc => ilc.LogItemId == after.Id && ilc.ItemType == IgnoredItemType.User)) return; ITextChannel? logChannel; @@ -1356,4 +1357,4 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor GuildLogSettings.AddOrUpdate(guildId, newLogSetting, (_, _) => newLogSetting); uow.SaveChanges(); } -} \ No newline at end of file +} diff --git a/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs b/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs index 84d8499e9..d3115eef6 100644 --- a/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs +++ b/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs @@ -250,8 +250,9 @@ public partial class Gambling ? "-" : string.Join("\n", itemList.Where(x => waifuItems.TryGetValue(x.ItemEmoji, out _)) - .OrderBy(x => waifuItems[x.ItemEmoji].Price) + .OrderByDescending(x => waifuItems[x.ItemEmoji].Price) .GroupBy(x => x.ItemEmoji) + .Take(60) .Select(x => $"{x.Key} x{x.Count(),-3}") .Chunk(2) .Select(x => string.Join(" ", x))); @@ -264,7 +265,10 @@ public partial class Gambling var fansList = await _service.GetFansNames(wi.WaifuId); var fansStr = fansList - .Select((x) => claimsNames.Contains(x) ? $"{x} 💞" : x).Join('\n'); + .Shuffle() + .Take(30) + .Select((x) => claimsNames.Contains(x) ? $"{x} 💞" : x) + .Join('\n'); if (string.IsNullOrWhiteSpace(fansStr)) @@ -350,4 +354,4 @@ public partial class Gambling await ReplyErrorLocalizedAsync(strs.not_enough(CurrencySign)); } } -} \ No newline at end of file +}