Skip to content
Advertisement

Tag: discord.js

How to create a JS file with a command DISCORD.JS

I’m making a discord bot and I was wondering if you can create a .js file with it. I haven’t found a way to do it. My command reacts to &createfile {name} and it will always create a .js file. My code so far: Answer Simply use the built-in fs module. It is built into node, so it doesn’t need

TypeError: Cannot read properties of undefined (reading ‘set’) discord.js v13 slash commands handler

I am creating a Slash commands handler when i run the bot i get this error : Mainguild.SlashCommands.set(SlashComanndsArray).then(async (SlashCommand) => { TypeError: Cannot read properties of undefined (reading ‘set’) this is the code : also SlashComanndsArray , SlashCommand are defined and for the SlashCommands is a collection that i created id index.js with client.SlashCommands = new Collection(); the full code

How do I fetch Weather’s API ‘forecastday’ using axios?

I use WeatherAPI’s service, which returns the weather forecast given the city name The URL looks like this https://api.weatherapi.com/v1/forecast.json?key=[API_KEY]&q=tokyo&aqi=no After trying to paste that URL into my browser and pasting the result into a JSON beautifier, here’s the result Here’s the weird part. I tried using axios to fetch the information from my app and printing it out, this is

sending info from api to discord in a message (discord.js)

Hey i have a question about how to send data over to a message in discord.js. The code that im using now is kinda working. Its just giving me the response [Object Object] Answer the respone.data is not a object. That’s why i’m getting [object, object] So the solution is let datachuck = response.data.value

Trying to setup a new welcome.js

Whenever a user joins, it failes. It worked on the last server but not now? Any help or indication that something is wrong would be much appreciated. I am new to this so sorry if bad Answer So there are a couple things wrong here. First you have 2 “clients” defined Then your code reads as follow Try this and

Advertisement