&tokyo
&tokyo
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
oh okk thank you for your responses!
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
or others new things in modals that aren't documented yet
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
And I just would like to know if its possible to put components like select menu in modals with the api?
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
thank you!! it works
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
cause with it i get:
Erreur lors de l'envoi du message : DiscordAPIError[50035]: Invalid Form Body
components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
Erreur lors de l'envoi du message : DiscordAPIError[50035]: Invalid Form Body
components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
is it: flags: 1 << 7 ?
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
But actually, I know how to do it, but I still get the error: DiscordAPIError[50035]: Invalid Form Body components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,). with:
[
{
type: 17,
accent_color: 16711680,
spoiler: true,
components: [
{
type: 10,
content:
"Behind every alien, there's a confused emotional potato.",
},
{
type: 1,
components: [
{
type: 2,
style: 5,
label: 'Slow Goshawk',
emoji: null,
disabled: false,
url: 'https://google.com',
},
],
},
{
type: 14,
divider: true,
spacing: 1,
},
{
type: 10,
content:
'True wisdom comes from hugging a stranger during jealous times.',
},
{
type: 1,
components: [
{
type: 2,
style: 5,
label: 'Playful Starling',
emoji: null,
disabled: false,
url: 'https://google.com',
},
],
},
],
},
];
[
{
type: 17,
accent_color: 16711680,
spoiler: true,
components: [
{
type: 10,
content:
"Behind every alien, there's a confused emotional potato.",
},
{
type: 1,
components: [
{
type: 2,
style: 5,
label: 'Slow Goshawk',
emoji: null,
disabled: false,
url: 'https://google.com',
},
],
},
{
type: 14,
divider: true,
spacing: 1,
},
{
type: 10,
content:
'True wisdom comes from hugging a stranger during jealous times.',
},
{
type: 1,
components: [
{
type: 2,
style: 5,
label: 'Playful Starling',
emoji: null,
disabled: false,
url: 'https://google.com',
},
],
},
],
},
];
and:
import { REST, Routes } from 'discord.js';
import config from '../config';

const rest = new REST({ version: '10' }).setToken(config.clientToken);

export const sendJSONEmbed = async (
channelId: string,
components: Object,
content?: string,
) => {
try {
await rest.post(Routes.channelMessages(channelId), {
body: {
content: content ?? '',
components: components,
},
});
console.log('Message envoyé avec succès !');
} catch (error) {
console.error('Erreur lors de l\'envoi du message :', error);
}
};
import { REST, Routes } from 'discord.js';
import config from '../config';

const rest = new REST({ version: '10' }).setToken(config.clientToken);

export const sendJSONEmbed = async (
channelId: string,
components: Object,
content?: string,
) => {
try {
await rest.post(Routes.channelMessages(channelId), {
body: {
content: content ?? '',
components: components,
},
});
console.log('Message envoyé avec succès !');
} catch (error) {
console.error('Erreur lors de l\'envoi du message :', error);
}
};
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
ah okk
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
But how? Is there unofficial documentation or something else, because I tried copying from https://discord.builders/ and I wasn't able to do it
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 4/21/2025 in #djs-questions
Discord v2 components
ohh ok thank you for your response
15 replies
DIAdiscord.js - Imagine an app
Created by &tokyo on 9/27/2023 in #djs-voice
Find music but don't play
AH okk sry i didn't know
4 replies