ci: Possible CI fix. Breaking RID change. Windows 7 no longer supported :\

refactor: Ayu.Discord.Voice renamed to NadekoBot.Voice to avoid confusion
This commit is contained in:
Kwoth
2024-04-27 19:08:17 +00:00
parent 4a378b9663
commit ddeded9a70
25 changed files with 32 additions and 95 deletions

View File

@@ -436,7 +436,7 @@ public sealed class Help : NadekoModule<HelpService>
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<HelpService>
}
var versionList = JsonSerializer.Deserialize<List<string>>(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<HelpService>
{
Log.Warning(
"Version {Version} already exists in the version file. " + "Did you forget to increment it?",
StatsService.BOT_VERSION);
StatsService.BotVersion);
}
}

View File

@@ -1,5 +1,5 @@
#nullable disable
using Ayu.Discord.Voice;
using NadekoBot.Voice;
using System.Reflection;
namespace NadekoBot.Modules.Music.Services;

View File

@@ -1,5 +1,5 @@
#nullable disable
using Ayu.Discord.Voice;
using NadekoBot.Voice;
namespace NadekoBot.Modules.Music;

View File

@@ -1,4 +1,4 @@
using Ayu.Discord.Voice;
using NadekoBot.Voice;
using NadekoBot.Db.Models;
using System.ComponentModel;
using System.Diagnostics;

View File

@@ -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;

View File

@@ -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<SearchResultData> 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");
// }
// }

View File

@@ -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)

View File

@@ -4,7 +4,8 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<Version>5.0.0-beta1</Version>
<Version>5.0.0</Version>
<VersionSuffix>beta1</VersionSuffix>
<!-- Output/build -->
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>

View File

@@ -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";