GetUpdateNotes()
+ {
+ HttpClient client = new HttpClient();
+ var response = await client.GetAsync("https://github.com/andreitdr/SethDiscordBot/releases/latest");
+
+ if (!response.IsSuccessStatusCode)
+ {
+ return string.Empty;
+ }
+
+ var content = await response.Content.ReadAsStringAsync();
+ var markdownStart = content.IndexOf("", markdownStart) + 1; // Move past the opening tag
+ var markdownEnd = content.IndexOf("
", markdownStart);
+ var markdown = content.Substring(markdownStart, markdownEnd - markdownStart).Trim();
+ markdown = RemoveHtmlTags(markdown);
+
+ markdown = ApplyMarkdownFormatting(markdown);
+
+ return markdown;
+
+ }
+
+ private string RemoveHtmlTags(string text)
+ {
+ return Regex.Replace(text, "<.*?>", "").Trim();
+ }
+ private string ApplyMarkdownFormatting(string markdown)
+ {
+ // Apply markdown formatting
+ markdown = markdown.Replace("**", "**"); // Bold
+ markdown = markdown.Replace("*", "*"); // Italic
+ markdown = markdown.Replace("`", "`"); // Inline code
+ markdown = markdown.Replace("```", "```"); // Code block
+ markdown = markdown.Replace(">", ">"); // Greater than symbol
+ markdown = markdown.Replace("<", "<"); // Less than symbol
+ markdown = markdown.Replace("&", "&"); // Ampersand
+ markdown = markdown.Replace(""", "\""); // Double quote
+ markdown = markdown.Replace("'", "'"); // Single quote
+ markdown = markdown.Replace(" - ", "\n- "); // Convert bullet points to markdown list items
+
+ return markdown;
+ }
+
+ }
+}
diff --git a/PluginManager/Updater/Application/Update.cs b/PluginManager/Updater/Application/Update.cs
new file mode 100644
index 0000000..a1770f6
--- /dev/null
+++ b/PluginManager/Updater/Application/Update.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Discord.Commands;
+
+using PluginManager.Interfaces.Updater;
+
+namespace PluginManager.Updater.Application
+{
+ public class Update
+ {
+ public readonly static Update None = new Update(AppVersion.CurrentAppVersion, AppVersion.CurrentAppVersion, string.Empty, string.Empty);
+
+ public AppVersion UpdateVersion { get; private set; }
+ public AppVersion CurrentVersion { get; private set; }
+ public string UpdateUrl { get; private set; }
+ public string UpdateNotes { get; private set; }
+
+ public Update(AppVersion currentVersion, AppVersion updateVersion, string updateUrl, string updateNotes)
+ {
+ UpdateVersion = updateVersion;
+ CurrentVersion = currentVersion;
+ UpdateUrl = updateUrl;
+ UpdateNotes = updateNotes;
+ }
+ }
+}