kill
kill
DIAdiscord.js - Imagine an app
Created by kill on 4/19/2024 in #djs-questions
Turn bot into an executable file
Basically the title, im not super knowledgable on this stuff and i want to make my bot an exe file so i dont have to run webstorm all the time i want to use it. I tried nexe but it gave me a weird error and I dont think pkg would work for this. I know its not exactly a discord.js question but I couldnt find any good answers online.
4 replies
DIAdiscord.js - Imagine an app
Created by kill on 4/13/2024 in #djs-questions
Just updated, confused about prefix commands
I just updated discord.js, and I don't know how it works now but I skimmed through the guide and only found information on how to make slash commands as far as I can tell. I tried using my old code and it didnt work. Do prefix commands not work anymore?
const Discord = require('discord.js');
const { Client, Events, GatewayIntentBits } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const prefix = "!"

client.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
})

client.on('message', async message => {

if (message.author.bot) return
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase();

if (command === 'test') {
await message.channel.send("test")
}
})

client.login([redacted]);
const Discord = require('discord.js');
const { Client, Events, GatewayIntentBits } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const prefix = "!"

client.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
})

client.on('message', async message => {

if (message.author.bot) return
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase();

if (command === 'test') {
await message.channel.send("test")
}
})

client.login([redacted]);
10 replies