fix attachment looking in fs instead of sending buffer
This commit is contained in:
parent
cbfed03f66
commit
d0aa721b81
1 changed files with 4 additions and 1 deletions
|
@ -19,6 +19,7 @@ import {
|
|||
import { RuleSet } from "./rules.ts";
|
||||
import { channel, log_from, SimpleResult, split_promise, try_ } from "./utils.ts";
|
||||
import { StoredUser } from "./state.ts";
|
||||
import { Buffer } from "node:buffer";
|
||||
const log = log_from(import.meta.url);
|
||||
|
||||
/**
|
||||
|
@ -376,7 +377,9 @@ function message_command_response_export_success(count: number, csv: string) {
|
|||
const embed = new EmbedBuilder()
|
||||
.setTitle("`✅`| Export")
|
||||
.setDescription(`\`${count}\` associations exportées.`);
|
||||
const attachment = new AttachmentBuilder(csv).setName(`export-${Date.now()}.csv`);
|
||||
const buffer = Buffer.from(csv);
|
||||
const attachment = new AttachmentBuilder(buffer)
|
||||
.setName(`export-${Date.now()}.csv`);
|
||||
return { embeds: [embed], files: [attachment] };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue