Redesigned the DiscordBotCore by splitting it into multiple projects. Created a WebUI and preparing to remove the DiscordBot application

This commit is contained in:
2025-04-04 22:07:30 +03:00
parent 62ba5ec63d
commit a4afb28f36
2290 changed files with 76694 additions and 17052 deletions

View File

@@ -0,0 +1,25 @@
using DiscordBotCore.Networking.Helpers;
namespace DiscordBotCore.Networking;
public class FileDownloader
{
private readonly string _DownloadUrl;
private readonly string _DownloadLocation;
private readonly HttpClient _HttpClient;
public FileDownloader(string downloadUrl, string downloadLocation)
{
_DownloadUrl = downloadUrl;
_DownloadLocation = downloadLocation;
_HttpClient = new HttpClient();
}
public async Task DownloadFile(Action<float> progressCallback)
{
await using var fileStream = new FileStream(_DownloadLocation, FileMode.Create, FileAccess.Write, FileShare.None);
await _HttpClient.DownloadFileAsync(_DownloadUrl, fileStream, new Progress<float>(progressCallback));
}
}