diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eee11dc31..1574e384d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,8 +33,8 @@ build: script: - "dotnet publish -c Release -r linux-x64 --self-contained -o $LINUX_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r linux-arm64 --self-contained -o $LINUX_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - - "dotnet publish -c Release -r win7-x64 --self-contained -o $WIN_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - - "dotnet publish -c Release -r win7-arm64 --self-contained -o $WIN_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" + - "dotnet publish -c Release -r win-x64 --self-contained -o $WIN_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" + - "dotnet publish -c Release -r win-arm64 --self-contained -o $WIN_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r osx-x64 --self-contained -o $MACOS_X64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" - "dotnet publish -c Release -r osx-arm64 --self-contained -o $MACOS_ARM64_OUTPUT_DIR src/NadekoBot/NadekoBot.csproj" artifacts: diff --git a/Dockerfile b/Dockerfile index 4615d8622..d2dc34150 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY src/Nadeko.Common/*.csproj src/Nadeko.Common/ COPY src/NadekoBot/*.csproj src/NadekoBot/ COPY src/NadekoBot.Coordinator/*.csproj src/NadekoBot.Coordinator/ COPY src/NadekoBot.Generators/*.csproj src/NadekoBot.Generators/ -COPY src/ayu/Ayu.Discord.Voice/*.csproj src/ayu/Ayu.Discord.Voice/ +COPY src/ayu/NadekoBot.Voice/*.csproj src/ayu/NadekoBot.Voice/ COPY NuGet.Config ./ RUN dotnet restore src/NadekoBot/ diff --git a/src/NadekoBot/Modules/Help/Help.cs b/src/NadekoBot/Modules/Help/Help.cs index 8f7e346ba..66d873d65 100644 --- a/src/NadekoBot/Modules/Help/Help.cs +++ b/src/NadekoBot/Modules/Help/Help.cs @@ -436,7 +436,7 @@ public sealed class Help : NadekoModule ContentType = "application/json", ContentBody = uploadData, // either use a path provided in the argument or the default one for public nadeko, other/cmds.json - Key = $"cmds/{StatsService.BOT_VERSION}.json", + Key = $"cmds/{StatsService.BotVersion}.json", CannedACL = S3CannedACL.PublicRead }); } @@ -461,11 +461,11 @@ public sealed class Help : NadekoModule } var versionList = JsonSerializer.Deserialize>(versionListString); - if (versionList is not null && !versionList.Contains(StatsService.BOT_VERSION)) + if (versionList is not null && !versionList.Contains(StatsService.BotVersion)) { // save the file with new version added // versionList.Add(StatsService.BotVersion); - versionListString = JsonSerializer.Serialize(versionList.Prepend(StatsService.BOT_VERSION), + versionListString = JsonSerializer.Serialize(versionList.Prepend(StatsService.BotVersion), new JsonSerializerOptions { WriteIndented = true @@ -487,7 +487,7 @@ public sealed class Help : NadekoModule { Log.Warning( "Version {Version} already exists in the version file. " + "Did you forget to increment it?", - StatsService.BOT_VERSION); + StatsService.BotVersion); } } diff --git a/src/NadekoBot/Modules/Music/Services/AyuVoiceStateService.cs b/src/NadekoBot/Modules/Music/Services/AyuVoiceStateService.cs index 7f70bc715..a33925a8d 100644 --- a/src/NadekoBot/Modules/Music/Services/AyuVoiceStateService.cs +++ b/src/NadekoBot/Modules/Music/Services/AyuVoiceStateService.cs @@ -1,5 +1,5 @@ #nullable disable -using Ayu.Discord.Voice; +using NadekoBot.Voice; using System.Reflection; namespace NadekoBot.Modules.Music.Services; diff --git a/src/NadekoBot/Modules/Music/_common/IVoiceProxy.cs b/src/NadekoBot/Modules/Music/_common/IVoiceProxy.cs index d178bc3c9..6403311d9 100644 --- a/src/NadekoBot/Modules/Music/_common/IVoiceProxy.cs +++ b/src/NadekoBot/Modules/Music/_common/IVoiceProxy.cs @@ -1,5 +1,5 @@ #nullable disable -using Ayu.Discord.Voice; +using NadekoBot.Voice; namespace NadekoBot.Modules.Music; diff --git a/src/NadekoBot/Modules/Music/_common/Impl/MusicPlayer.cs b/src/NadekoBot/Modules/Music/_common/Impl/MusicPlayer.cs index 76a2bb9e8..4b1cdf730 100644 --- a/src/NadekoBot/Modules/Music/_common/Impl/MusicPlayer.cs +++ b/src/NadekoBot/Modules/Music/_common/Impl/MusicPlayer.cs @@ -1,4 +1,4 @@ -using Ayu.Discord.Voice; +using NadekoBot.Voice; using NadekoBot.Db.Models; using System.ComponentModel; using System.Diagnostics; diff --git a/src/NadekoBot/Modules/Music/_common/Impl/VoiceProxy.cs b/src/NadekoBot/Modules/Music/_common/Impl/VoiceProxy.cs index 2d4a0e545..2b95475db 100644 --- a/src/NadekoBot/Modules/Music/_common/Impl/VoiceProxy.cs +++ b/src/NadekoBot/Modules/Music/_common/Impl/VoiceProxy.cs @@ -1,6 +1,6 @@ #nullable disable -using Ayu.Discord.Voice; -using Ayu.Discord.Voice.Models; +using NadekoBot.Voice; +using NadekoBot.Voice.Models; namespace NadekoBot.Modules.Music; diff --git a/src/NadekoBot/Modules/Searches/Search/DuckDuckGoScrape/DuckDuckGoSeachService.cs b/src/NadekoBot/Modules/Searches/Search/DuckDuckGoScrape/DuckDuckGoSeachService.cs deleted file mode 100644 index 7aacde717..000000000 --- a/src/NadekoBot/Modules/Searches/Search/DuckDuckGoScrape/DuckDuckGoSeachService.cs +++ /dev/null @@ -1,65 +0,0 @@ -// using AngleSharp.Html.Dom; -// using MorseCode.ITask; -// using NadekoBot.Modules.Searches.Common; -// using System.Net; -// -// namespace NadekoBot.Modules.Searches.DuckDuckGo; -// -// public sealed class DuckDuckGoSeachService : SearchServiceBase -// { -// private static readonly HtmlParser _googleParser = new(new() -// { -// IsScripting = false, -// IsEmbedded = false, -// IsSupportingProcessingInstructions = false, -// IsKeepingSourceReferences = false, -// IsNotSupportingFrames = true -// }); -// -// public override async ITask SearchAsync(string query) -// { -// query = WebUtility.UrlEncode(query)?.Replace(' ', '+'); -// -// var fullQueryLink = "https://html.duckduckgo.com/html"; -// -// using var http = _httpFactory.CreateClient(); -// http.DefaultRequestHeaders.Clear(); -// http.DefaultRequestHeaders.Add("User-Agent", -// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36"); -// -// using var formData = new MultipartFormDataContent(); -// formData.Add(new StringContent(query), "q"); -// using var response = await http.PostAsync(fullQueryLink, formData); -// var content = await response.Content.ReadAsStringAsync(); -// -// using var document = await _googleParser.ParseDocumentAsync(content); -// var searchResults = document.QuerySelector(".results"); -// var elems = searchResults.QuerySelectorAll(".result"); -// -// if (!elems.Any()) -// return default; -// -// var results = elems.Select(elem => -// { -// if (elem.QuerySelector(".result__a") is not IHtmlAnchorElement anchor) -// return null; -// -// var href = anchor.Href; -// var name = anchor.TextContent; -// -// if (string.IsNullOrWhiteSpace(href) || string.IsNullOrWhiteSpace(name)) -// return null; -// -// var txt = elem.QuerySelector(".result__snippet")?.TextContent; -// -// if (string.IsNullOrWhiteSpace(txt)) -// return null; -// -// return new GoogleSearchResult(name, href, txt); -// }) -// .Where(x => x is not null) -// .ToList(); -// -// return new(results.AsReadOnly(), fullQueryLink, "0"); -// } -// } \ No newline at end of file diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 70a9b0e22..6768a5416 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -293,7 +293,7 @@ public partial class Utility : NadekoModule await EmbedAsync(_eb.Create() .WithOkColor() - .WithAuthor($"NadekoBot v{StatsService.BOT_VERSION}", + .WithAuthor($"NadekoBot v{StatsService.BotVersion}", "https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/avatar.png", "https://nadekobot.readthedocs.io/en/latest/") .AddField(GetText(strs.author), _stats.Author, true) diff --git a/src/NadekoBot/NadekoBot.csproj b/src/NadekoBot/NadekoBot.csproj index 5b995e6b9..8f018c86e 100644 --- a/src/NadekoBot/NadekoBot.csproj +++ b/src/NadekoBot/NadekoBot.csproj @@ -4,7 +4,8 @@ net8.0 enable true - 5.0.0-beta1 + 5.0.0 + beta1 $(MSBuildProjectDirectory) diff --git a/src/NadekoBot/_common/Services/Impl/StatsService.cs b/src/NadekoBot/_common/Services/Impl/StatsService.cs index fee826aa9..aaeefee05 100644 --- a/src/NadekoBot/_common/Services/Impl/StatsService.cs +++ b/src/NadekoBot/_common/Services/Impl/StatsService.cs @@ -7,7 +7,8 @@ namespace NadekoBot.Services; public sealed class StatsService : IStatsService, IReadyExecutor, INService { - public const string BOT_VERSION = "5.0.0-beta1"; + public static string BotVersion + => typeof(Bot).Assembly.GetName().Version?.ToString(3) ?? "Custom"; public string Author => "Kwoth#2452"; diff --git a/src/ayu/NadekoBot.Voice/LibOpus.cs b/src/ayu/NadekoBot.Voice/LibOpus.cs index f9bd10f83..a97a1ab0a 100644 --- a/src/ayu/NadekoBot.Voice/LibOpus.cs +++ b/src/ayu/NadekoBot.Voice/LibOpus.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace Ayu.Discord.Voice +namespace NadekoBot.Voice { internal static unsafe class LibOpus { diff --git a/src/ayu/NadekoBot.Voice/LibSodium.cs b/src/ayu/NadekoBot.Voice/LibSodium.cs index 5bf43c095..d40017627 100644 --- a/src/ayu/NadekoBot.Voice/LibSodium.cs +++ b/src/ayu/NadekoBot.Voice/LibSodium.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace Ayu.Discord.Voice +namespace NadekoBot.Voice { internal static unsafe class Sodium { diff --git a/src/ayu/NadekoBot.Voice/Models/SelectProtocol.cs b/src/ayu/NadekoBot.Voice/Models/SelectProtocol.cs index d3ffd2524..273fb51a5 100644 --- a/src/ayu/NadekoBot.Voice/Models/SelectProtocol.cs +++ b/src/ayu/NadekoBot.Voice/Models/SelectProtocol.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class SelectProtocol { diff --git a/src/ayu/NadekoBot.Voice/Models/VoiceHello.cs b/src/ayu/NadekoBot.Voice/Models/VoiceHello.cs index 64e815474..4336b767f 100644 --- a/src/ayu/NadekoBot.Voice/Models/VoiceHello.cs +++ b/src/ayu/NadekoBot.Voice/Models/VoiceHello.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class VoiceHello { diff --git a/src/ayu/NadekoBot.Voice/Models/VoiceIdentify.cs b/src/ayu/NadekoBot.Voice/Models/VoiceIdentify.cs index be72f4820..637899804 100644 --- a/src/ayu/NadekoBot.Voice/Models/VoiceIdentify.cs +++ b/src/ayu/NadekoBot.Voice/Models/VoiceIdentify.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class VoiceIdentify { diff --git a/src/ayu/NadekoBot.Voice/Models/VoiceReady.cs b/src/ayu/NadekoBot.Voice/Models/VoiceReady.cs index 8cae4bbe9..3d8d7b047 100644 --- a/src/ayu/NadekoBot.Voice/Models/VoiceReady.cs +++ b/src/ayu/NadekoBot.Voice/Models/VoiceReady.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class VoiceReady { diff --git a/src/ayu/NadekoBot.Voice/Models/VoiceResume.cs b/src/ayu/NadekoBot.Voice/Models/VoiceResume.cs index b5875b888..38f741550 100644 --- a/src/ayu/NadekoBot.Voice/Models/VoiceResume.cs +++ b/src/ayu/NadekoBot.Voice/Models/VoiceResume.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class VoiceResume { diff --git a/src/ayu/NadekoBot.Voice/Models/VoiceSessionDescription.cs b/src/ayu/NadekoBot.Voice/Models/VoiceSessionDescription.cs index ca020291a..1d2bfacd1 100644 --- a/src/ayu/NadekoBot.Voice/Models/VoiceSessionDescription.cs +++ b/src/ayu/NadekoBot.Voice/Models/VoiceSessionDescription.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class VoiceSessionDescription { diff --git a/src/ayu/NadekoBot.Voice/Models/VoiceSpeaking.cs b/src/ayu/NadekoBot.Voice/Models/VoiceSpeaking.cs index 909c10dba..84243f232 100644 --- a/src/ayu/NadekoBot.Voice/Models/VoiceSpeaking.cs +++ b/src/ayu/NadekoBot.Voice/Models/VoiceSpeaking.cs @@ -1,7 +1,7 @@ using Newtonsoft.Json; using System; -namespace Ayu.Discord.Voice.Models +namespace NadekoBot.Voice.Models { public sealed class VoiceSpeaking { diff --git a/src/ayu/NadekoBot.Voice/NadekoBot.Voice.csproj b/src/ayu/NadekoBot.Voice/NadekoBot.Voice.csproj index fabee0835..8344b79d2 100644 --- a/src/ayu/NadekoBot.Voice/NadekoBot.Voice.csproj +++ b/src/ayu/NadekoBot.Voice/NadekoBot.Voice.csproj @@ -5,7 +5,7 @@ true CS8632 1.0.2 - Ayu.Discord.Voice + NadekoBot.Voice diff --git a/src/ayu/NadekoBot.Voice/PoopyBufferImmortalized.cs b/src/ayu/NadekoBot.Voice/PoopyBufferImmortalized.cs index 39bbb2dff..f0c7613ab 100644 --- a/src/ayu/NadekoBot.Voice/PoopyBufferImmortalized.cs +++ b/src/ayu/NadekoBot.Voice/PoopyBufferImmortalized.cs @@ -4,7 +4,7 @@ using System.Buffers; using System.Threading; using System.Threading.Tasks; -namespace Ayu.Discord.Voice +namespace NadekoBot.Voice { public sealed class PoopyBufferImmortalized : ISongBuffer { diff --git a/src/ayu/NadekoBot.Voice/SongBuffer.cs b/src/ayu/NadekoBot.Voice/SongBuffer.cs index b5f09efd4..c981bcf0d 100644 --- a/src/ayu/NadekoBot.Voice/SongBuffer.cs +++ b/src/ayu/NadekoBot.Voice/SongBuffer.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -namespace Ayu.Discord.Voice +namespace NadekoBot.Voice { public interface ISongBuffer : IDisposable { diff --git a/src/ayu/NadekoBot.Voice/VoiceClient.cs b/src/ayu/NadekoBot.Voice/VoiceClient.cs index 31cfd5f97..f85236baa 100644 --- a/src/ayu/NadekoBot.Voice/VoiceClient.cs +++ b/src/ayu/NadekoBot.Voice/VoiceClient.cs @@ -1,7 +1,7 @@ using System; using System.Buffers; -namespace Ayu.Discord.Voice +namespace NadekoBot.Voice { public sealed class VoiceClient : IDisposable { diff --git a/src/ayu/NadekoBot.Voice/VoiceGateway.cs b/src/ayu/NadekoBot.Voice/VoiceGateway.cs index 0b73793d5..8fe5cebed 100644 --- a/src/ayu/NadekoBot.Voice/VoiceGateway.cs +++ b/src/ayu/NadekoBot.Voice/VoiceGateway.cs @@ -1,4 +1,4 @@ -using Ayu.Discord.Voice.Models; +using NadekoBot.Voice.Models; using Discord.Models.Gateway; using Newtonsoft.Json.Linq; using Serilog; @@ -12,7 +12,7 @@ using System.Threading.Tasks; using Ayu.Discord.Gateway; using Newtonsoft.Json; -namespace Ayu.Discord.Voice +namespace NadekoBot.Voice { public class VoiceGateway {