Update index.ts

This commit is contained in:
Erkin Alp Güney 2022-05-15 17:43:30 +03:00 committed by GitHub
parent 36ebef6eaf
commit 1653f2c505

View File

@ -71,7 +71,11 @@ export interface MessageCreateSchema {
}; };
payload_json?: string; payload_json?: string;
file?: any; file?: any;
attachments?: any[]; //TODO we should create an interface for attachments /**
TODO: we should create an interface for attachments
TODO: OpenWAAO<-->attachment-style metadata conversion
**/
attachments?: any[];
sticker_ids?: string[]; sticker_ids?: string[];
} }
@ -137,8 +141,11 @@ router.get("/", async (req: Request, res: Response) => {
y.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`; y.proxy_url = `${endpoint == null ? "" : endpoint}${new URL(uri).pathname}`;
}); });
//Some clients ( discord.js ) only check if a property exists within the response, /**
//which causes erorrs when, say, the `application` property is `null`. Some clients ( discord.js ) only check if a property exists within the response,
which causes erorrs when, say, the `application` property is `null`.
**/
for (var curr in x) { for (var curr in x) {
if (x[curr] === null) if (x[curr] === null)
delete x[curr]; delete x[curr];
@ -158,15 +165,14 @@ const messageUpload = multer({
}, },
storage: multer.memoryStorage() storage: multer.memoryStorage()
}); // max upload 50 mb }); // max upload 50 mb
/**
TODO: dynamically change limit of MessageCreateSchema with config
// TODO: dynamically change limit of MessageCreateSchema with config https://discord.com/developers/docs/resources/channel#create-message
// TODO: check: sum of all characters in an embed structure must not exceed instance limits TODO: text channel slowdown (per-user and across-users)
Q: trim and replace message content and every embed field A: NO, given this cannot be implemented in E2EE channels
// https://discord.com/developers/docs/resources/channel#create-message TODO: only dispatch notifications for mentions denoted in allowed_mentions
// TODO: text channel slowdown **/
// TODO: trim and replace message content and every embed field
// TODO: only dispatch mentions denoted in allowed_mentions
// Send message // Send message
router.post( router.post(
"/", "/",
@ -234,8 +240,6 @@ router.post(
); );
} }
//Fix for the client bug //Fix for the client bug
delete message.member delete message.member