BestSpark687090
BestSpark687090
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 8/18/2024 in #djs-questions
Attempting to react to messages older than bot does not work
Got it, thanks.
5 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 8/18/2024 in #djs-questions
Attempting to react to messages older than bot does not work
[email protected] Node.JS v20.16.0
5 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
How to get most recent messages from channel
7 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
How to get most recent messages from channel
client.once(Events.ClientReady, c => {
channel = client.channels.cache.get('1053340012021821593');
message = channel.messages.fetch({limit: 1})
.then(message)
.catch(console.error);
});
client.once(Events.ClientReady, c => {
channel = client.channels.cache.get('1053340012021821593');
message = channel.messages.fetch({limit: 1})
.then(message)
.catch(console.error);
});
I did that, but when i console.log it, it is undefined.
7 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
How to get most recent messages from channel
npm list discord.js
gamebot@ C:\Users... └── [email protected]
node -v
v16.18.0
7 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
ok its working
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
i put it in the execute, not the data
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
wait hold on i think i put it in the wrong place
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
Nope, still same error
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
ok
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
So just have return option at the end?
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/22/2022 in #djs-questions
ExpectValidationError expected
const { SlashCommandBuilder, EmbedBuilder, channelLink } = require("discord.js")
const stats = require("./stats.json")
module.exports = {
data: new SlashCommandBuilder()
.setName('stats')
.setDescription("Gets you the stats of yourself or another person")
.addStringOption(function(option){
option.setName("person")
.setDescription(`The person to get the stats of.
If this is not provided, this will automatically get your stats.`)
.addChoices(
{name: "removed", value: "removed"},
{name: "removed", value: "removed"}
)
}),
async execute(interaction){
const person = interaction.options.getString('person')
// Get their stats from the JSON file and display them to the user only.
const type = stats[person].Type
const hp = stats[person].HP
const gold = stats[person].Gold
const mp = stats[person].MP
const statsEmbed = new EmbedBuilder()
.setColor(0xff0000)
.setTitle(`${person}'s Stats`)
.addFields(
{name: "Type/Class", value: type},
{name: "HP", value: hp},
{name: "Gold", value: gold},
{name: "MP", value: mp}
)
.setFooter("Made by BestSpark687090")
await interaction.reply({embeds: [statsEmbed], ephemeral: true})
}
}
const { SlashCommandBuilder, EmbedBuilder, channelLink } = require("discord.js")
const stats = require("./stats.json")
module.exports = {
data: new SlashCommandBuilder()
.setName('stats')
.setDescription("Gets you the stats of yourself or another person")
.addStringOption(function(option){
option.setName("person")
.setDescription(`The person to get the stats of.
If this is not provided, this will automatically get your stats.`)
.addChoices(
{name: "removed", value: "removed"},
{name: "removed", value: "removed"}
)
}),
async execute(interaction){
const person = interaction.options.getString('person')
// Get their stats from the JSON file and display them to the user only.
const type = stats[person].Type
const hp = stats[person].HP
const gold = stats[person].Gold
const mp = stats[person].MP
const statsEmbed = new EmbedBuilder()
.setColor(0xff0000)
.setTitle(`${person}'s Stats`)
.addFields(
{name: "Type/Class", value: type},
{name: "HP", value: hp},
{name: "Gold", value: gold},
{name: "MP", value: mp}
)
.setFooter("Made by BestSpark687090")
await interaction.reply({embeds: [statsEmbed], ephemeral: true})
}
}
13 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
oh i got it working
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
here's what i'm doing to try to save the message (probably definetly not correct): channel.send(cmd).then(message)
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
just a guess tho
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
and it's still same error, would it be channel.message.edit?
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
i'm gonna guess that's a yes
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
ok so you don't want me to add the promise and just do message = channel.send(msg)?
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
i had it saved as a variable called message, so it would be with the msg param message = msg;
30 replies
DIAdiscord.js - Imagine an app
Created by BestSpark687090 on 12/16/2022 in #djs-questions
How do I edit a message using message.edit()?
so then you save it as message?
30 replies