Send related emoji along with Sticker, fix SendMessage types

This commit is contained in:
Scott Nonnenberg 2021-10-05 15:10:08 -07:00 committed by GitHub
parent 3c91dce993
commit bd380086a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 522 additions and 376 deletions

View file

@ -168,14 +168,16 @@ export const createDoesExist = (
export const copyIntoAttachmentsDirectory = (
root: string
): ((sourcePath: string) => Promise<string>) => {
): ((sourcePath: string) => Promise<{ path: string; size: number }>) => {
if (!isString(root)) {
throw new TypeError("'root' must be a path");
}
const userDataPath = getApp().getPath('userData');
return async (sourcePath: string): Promise<string> => {
return async (
sourcePath: string
): Promise<{ path: string; size: number }> => {
if (!isString(sourcePath)) {
throw new TypeError('sourcePath must be a string');
}
@ -196,7 +198,12 @@ export const copyIntoAttachmentsDirectory = (
await fse.ensureFile(normalized);
await fse.copy(sourcePath, normalized);
return relativePath;
const { size } = await fse.stat(normalized);
return {
path: relativePath,
size,
};
};
};