#sob
39 messages · Page 1 of 1 (latest)
What could I be doing wrong?
I do have a feeling there is something wrong on the Developer portal maybe
v12 is not supported anymore, upgrade to v14
and also dont deploy your commands on every start
and never use ChatGPT as it uses outdated information. djs is not for beginners, i recommend cheking out #resources to learn the basics of js
Okay bet. Thank you!
I did read the documentation I have a question:
consider this is the code snippet:
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('userinfo')
.setDescription("Displays the user's information")
.addStringOption(option =>
option.setName('user')
.setDescription('Enter the ID of the user or bot')
.setRequired(false)
),
It should show the options right?
like this
but it does not show up for me;
redeploy your commands
probably added the string option after you deployed the first command
yay 😁
The user.flags property are displayed as plain text instead of custom emojis.
Is there a way to display custom emoji badges instead of plain text for Discord user badges in a bot? Can custom emoji IDs be used to replace the default plain text badges provided by the user.flags property?
Here is an example of the code I have tried:
relevant code:
const badgeEmojis = {
brilliance: ':brilliance:',
bravery: ':bravery:'
};
const badges = user.flags?.toArray().map(flag => {
const badgeEmoji = badgeEmojis[flag];
return badgeEmoji ? badgeEmoji : flag;
});
embed code:
const embed = {
title: `${user.username}'s Information`,
thumbnail: {
url: user.displayAvatarURL({ dynamic: true })
},
fields: [
{ name: 'User ID', value: user.id },
{ name: 'Creation Date', value: `<t:${Math.floor(user.createdTimestamp / 1000)}:R>`, inline: true },
{ name: 'Joining Date', value: `<t:${Math.floor(member.joinedTimestamp / 1000)}:R>`, inline: true },
{ name: 'Roles', value: member.roles.cache.map(role => role.toString()).join(' ') },
{ name: 'Badges', value: badges?.join(' ') || 'None' }
]
};
How can I display custom emoji badges instead of plain text for Discord user badges in a bot?
add custom emotes and filter on the badges
could you please
elaborate?
add the custom emotes in your server and based on the array .flags returns map them to the right emote
the commands are showing up twice why is that happening?
it is happening for all commands
commands showing up twice
If you have duplicate commands on your server, you registered both global and guild commands.
You can remove the duplicates by resetting either the global or guild commands
- Resetting global commands:
rest.put(Routes.applicationCommands(clientId), { body: [] }) - Resetting guild commands:
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
thankss
Can I incorporate prefix commands besides slash commands? if so how do you do that?
incorporate prefix commands besides slash commands
Just listen to messageCreate
oh yeah i realised thanks lmfaooo
Buttons not working
How can I implement a dynamic button system in my Discord bot that allows users to navigate through a collection of memes fetched from an external API?
try {
if (memes.length === 0 || currentIndex === -1 || currentIndex === memes.length - 1) {
const response = await axios.get('https://api.imgflip.com/get_memes');
memes = response.data.data.memes;
currentIndex = 0;
} else {
currentIndex++;
}
How to implement a dynamic button system for navigation
?
sob