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
|
||||
if (content.embed) content.embeds = [content.embed, ...(content.embeds || [])];
|
||||
if (content.embeds && content.embeds.length > 10) {
|
||||
content.embeds.splice(10);
|
||||
if (content.embed) {
|
||||
content.embeds = [content.embed, ...(content.embeds || [])];
|
||||
content.embed = undefined;
|
||||
}
|
||||
content.embeds?.splice(10);
|
||||
|
||||
if (content.content && content.content.length > 2000) {
|
||||
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");
|
||||
// TODO: v12 remove
|
||||
if (content.embed) content.embeds = [content.embed, ...(content.embeds || [])];
|
||||
if (content.embeds?.length) requiredPerms.add("EMBED_LINKS");
|
||||
if (content.embeds && content.embeds.length > 10) {
|
||||
content.embeds.splice(10);
|
||||
if (content.embed) {
|
||||
content.embeds = [content.embed, ...(content.embeds || [])];
|
||||
content.embed = undefined;
|
||||
}
|
||||
if (content.embeds?.length) {
|
||||
requiredPerms.add("EMBED_LINKS");
|
||||
content.embeds?.splice(10);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (options.embeds && options.embeds.length > 10) {
|
||||
options.embeds.splice(10);
|
||||
}
|
||||
options.embeds?.splice(10);
|
||||
|
||||
if (options.allowedMentions) {
|
||||
if (options.allowedMentions.users?.length) {
|
||||
|
||||
Reference in New Issue
Block a user