remove rest of the parsing in csharp bot

This commit is contained in:
dusk 2025-10-08 03:26:40 +00:00
parent 15ffd16c01
commit 479e0a59b5
No known key found for this signature in database
35 changed files with 242 additions and 409 deletions

View file

@ -31,7 +31,7 @@ public class ImportExport
_dmCache = dmCache;
}
public async Task Import(Context ctx, string? inputUrl)
public async Task Import(Context ctx, string? inputUrl, bool confirmYes)
{
inputUrl = inputUrl ?? ctx.Message.Attachments.FirstOrDefault()?.Url;
if (inputUrl == null) throw Errors.NoImportFilePassed;
@ -77,7 +77,7 @@ public class ImportExport
async Task ConfirmImport(string message)
{
var msg = $"{message}\n\nDo you want to proceed with the import?";
if (!await ctx.PromptYesNo(msg, "Proceed"))
if (!await ctx.PromptYesNo(msg, "Proceed", flagValue: confirmYes))
throw Errors.ImportCancelled;
}
@ -86,7 +86,7 @@ public class ImportExport
&& data.Value<JArray>("accounts").Contains(ctx.Author.Id.ToString()))
{
var msg = $"{Emojis.Warn} You seem to importing a system profile belonging to another account. Are you sure you want to proceed?";
if (!await ctx.PromptYesNo(msg, "Import")) throw Errors.ImportCancelled;
if (!await ctx.PromptYesNo(msg, "Import", flagValue: confirmYes)) throw Errors.ImportCancelled;
}
var result = await _dataFiles.ImportSystem(ctx.Author.Id, ctx.System, data, ConfirmImport);