Epsilon
Epsilon
DIAdiscord.js - Imagine an app
Created by Epsilon on 10/1/2023 in #djs-questions
Buttons!
Having an error with some buttons. Developing in replit, Invalid form body error.
const { Client, GatewayIntentBits, EmbedBuilder, ActivityType, ActionRowBuilder, ButtonBuilder, ButtonStyle, Events, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

const TOKEN = process.env['TOKEN']

client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);

client.user.setPresence({ activities: [{ name: 'over a ton of cheeseburgers.', type: ActivityType.Watching }], status: 'online' })

});
const chzburgButton = new ButtonBuilder()
.setLabel("Assemble cheeseburger!")
.setStyle(ButtonStyle.Primary)

const chzburgEmbed = new EmbedBuilder()
.setTitle("Heres your cheeseburger!")
.setDescription("🍞\n 🥬\n 🧀\n 🥓\n 🥩\n 🍞")
.setColor(0x01611F)


client.on('interactionCreate', async interaction => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'cheeseburger') {
await interaction.reply ({embeds: [chzburgEmbed], components:[chzburgButton]})

}
});

client.login(TOKEN);
const { Client, GatewayIntentBits, EmbedBuilder, ActivityType, ActionRowBuilder, ButtonBuilder, ButtonStyle, Events, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

const TOKEN = process.env['TOKEN']

client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);

client.user.setPresence({ activities: [{ name: 'over a ton of cheeseburgers.', type: ActivityType.Watching }], status: 'online' })

});
const chzburgButton = new ButtonBuilder()
.setLabel("Assemble cheeseburger!")
.setStyle(ButtonStyle.Primary)

const chzburgEmbed = new EmbedBuilder()
.setTitle("Heres your cheeseburger!")
.setDescription("🍞\n 🥬\n 🧀\n 🥓\n 🥩\n 🍞")
.setColor(0x01611F)


client.on('interactionCreate', async interaction => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'cheeseburger') {
await interaction.reply ({embeds: [chzburgEmbed], components:[chzburgButton]})

}
});

client.login(TOKEN);
24 replies
DIAdiscord.js - Imagine an app
Created by Epsilon on 10/1/2023 in #djs-questions
How to end this argument string? (and how to make the code.. work?)
No description
12 replies