fix(core.gbapp): #372 fix.
This commit is contained in:
parent
dfd6981907
commit
05fd0ea54e
1 changed files with 4 additions and 4 deletions
|
@ -1246,12 +1246,12 @@ export class DialogKeywords {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!url) {
|
if (!url) {
|
||||||
const imageData = await (await fetch(url)).arrayBuffer();
|
|
||||||
const ext = mime.extension(Path.extname(filename.localName));
|
const ext = mime.extension(Path.extname(filename.localName));
|
||||||
|
|
||||||
// Prepare a cache to be referenced by Bot Framework.
|
// Prepare a cache to be referenced by Bot Framework.
|
||||||
|
|
||||||
let buf: any = Buffer.from(imageData);
|
const buf = Fs.readFileSync(filename);
|
||||||
const gbaiName = DialogKeywords.getGBAIPath(min.botId);
|
const gbaiName = DialogKeywords.getGBAIPath(min.botId);
|
||||||
const localName = Path.join('work', gbaiName, 'cache', `tmp${GBAdminService.getRndReadableIdentifier()}.${ext}`);
|
const localName = Path.join('work', gbaiName, 'cache', `tmp${GBAdminService.getRndReadableIdentifier()}.${ext}`);
|
||||||
Fs.writeFileSync(localName, buf, { encoding: null });
|
Fs.writeFileSync(localName, buf, { encoding: null });
|
||||||
|
|
Loading…
Add table
Reference in a new issue