mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
requested changes
This commit is contained in:
@@ -30,10 +30,11 @@ export async function editMessage(channelId: bigint, messageId: bigint, content:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: v12 remove
|
// TODO: v12 remove
|
||||||
if (content.embed) content.embeds = [content.embed, ...(content.embeds || [])];
|
if (content.embed) {
|
||||||
if (content.embeds && content.embeds.length > 10) {
|
content.embeds = [content.embed, ...(content.embeds || [])];
|
||||||
content.embeds.splice(10);
|
content.embed = undefined;
|
||||||
}
|
}
|
||||||
|
content.embeds?.splice(10);
|
||||||
|
|
||||||
if (content.content && content.content.length > 2000) {
|
if (content.content && content.content.length > 2000) {
|
||||||
throw new Error(Errors.MESSAGE_MAX_LENGTH);
|
throw new Error(Errors.MESSAGE_MAX_LENGTH);
|
||||||
|
|||||||
@@ -35,10 +35,13 @@ export async function sendMessage(channelId: bigint, content: string | CreateMes
|
|||||||
|
|
||||||
if (content.tts) requiredPerms.add("SEND_TTS_MESSAGES");
|
if (content.tts) requiredPerms.add("SEND_TTS_MESSAGES");
|
||||||
// TODO: v12 remove
|
// TODO: v12 remove
|
||||||
if (content.embed) content.embeds = [content.embed, ...(content.embeds || [])];
|
if (content.embed) {
|
||||||
if (content.embeds?.length) requiredPerms.add("EMBED_LINKS");
|
content.embeds = [content.embed, ...(content.embeds || [])];
|
||||||
if (content.embeds && content.embeds.length > 10) {
|
content.embed = undefined;
|
||||||
content.embeds.splice(10);
|
}
|
||||||
|
if (content.embeds?.length) {
|
||||||
|
requiredPerms.add("EMBED_LINKS");
|
||||||
|
content.embeds?.splice(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (content.messageReference?.messageId || content.allowedMentions?.repliedUser) {
|
if (content.messageReference?.messageId || content.allowedMentions?.repliedUser) {
|
||||||
|
|||||||
@@ -17,9 +17,7 @@ export async function sendWebhook(webhookId: bigint, webhookToken: string, optio
|
|||||||
throw Error(Errors.MESSAGE_MAX_LENGTH);
|
throw Error(Errors.MESSAGE_MAX_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.embeds && options.embeds.length > 10) {
|
options.embeds?.splice(10);
|
||||||
options.embeds.splice(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.allowedMentions) {
|
if (options.allowedMentions) {
|
||||||
if (options.allowedMentions.users?.length) {
|
if (options.allowedMentions.users?.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user