Black_Wither
Black_Wither
DIAdiscord.js - Imagine an app
Created by Black_Wither on 5/11/2024 in #djs-questions
Wrong user count
It shows me the amount of guilds 😅
14 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 5/11/2024 in #djs-questions
Wrong user count
It's constant now, but it returns me 90.000+ instead of 30.000+ I think it counts the duplicated members also
14 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 3/29/2024 in #djs-questions
Locale Descriptions
I fixed it 🤓 the option is description_localization not descriptionLocalization
slashCommands.push({
name: slashCommand.name,
description: slashCommand.description,
description_localizations: {de: "Test"},//slashCommand.descriptionLocalizations ? slashCommand.descriptionLocalizations : null,
type: slashCommand.type,
options: slashCommand.options ? slashCommand.options : null,
default_permission: slashCommand.default_permission ? slashCommand.default_permission : null,
default_member_permissions: slashCommand.default_member_permissions ? PermissionsBitField.resolve(slashCommand.default_member_permissions).toString() : null
});
slashCommands.push({
name: slashCommand.name,
description: slashCommand.description,
description_localizations: {de: "Test"},//slashCommand.descriptionLocalizations ? slashCommand.descriptionLocalizations : null,
type: slashCommand.type,
options: slashCommand.options ? slashCommand.options : null,
default_permission: slashCommand.default_permission ? slashCommand.default_permission : null,
default_member_permissions: slashCommand.default_member_permissions ? PermissionsBitField.resolve(slashCommand.default_member_permissions).toString() : null
});
4 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 3/29/2024 in #djs-questions
Locale Descriptions
The locale translation Here is a example slash command:
3|sc_ideas | {
3|sc_ideas | name: 'help',
3|sc_ideas | description: 'Shows you all commands',
3|sc_ideas | descriptionLocalizations: { de: 'Zeigt dir alle Befehle an' },
3|sc_ideas | cooldown: 3000,
3|sc_ideas | type: 1,
3|sc_ideas | options: [],
3|sc_ideas | run: [AsyncFunction: run]
3|sc_ideas | }
3|sc_ideas | {
3|sc_ideas | name: 'help',
3|sc_ideas | description: 'Shows you all commands',
3|sc_ideas | descriptionLocalizations: { de: 'Zeigt dir alle Befehle an' },
3|sc_ideas | cooldown: 3000,
3|sc_ideas | type: 1,
3|sc_ideas | options: [],
3|sc_ideas | run: [AsyncFunction: run]
3|sc_ideas | }
But it makes no difference whether my language is set to German or English, only the normal description comes
4 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 3/1/2024 in #djs-questions
MessageCreate API
Should I create a post in #other-js-ts ?
5 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 1/8/2024 in #djs-questions
Canva Image to .setImage()
Thank you!
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 1/8/2024 in #djs-questions
Canva Image to .setImage()
🥹
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 1/8/2024 in #djs-questions
Canva Image to .setImage()
interaction.editReply({ embeds: [embed], components: [row] })
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 1/8/2024 in #djs-questions
Canva Image to .setImage()
const resultBuffer = canvas.toBuffer("image/png");

const attachment = new AttachmentBuilder(resultBuffer, {name: "avatars.png"});

const embed = new EmbedBuilder()
.setColor("#ff0000")
.setDescription("*Currently unavailable*")
.setImage(`attachment://${attachment.name}`)
.setFooter(interaction.message.embeds[0].footer)
const resultBuffer = canvas.toBuffer("image/png");

const attachment = new AttachmentBuilder(resultBuffer, {name: "avatars.png"});

const embed = new EmbedBuilder()
.setColor("#ff0000")
.setDescription("*Currently unavailable*")
.setImage(`attachment://${attachment.name}`)
.setFooter(interaction.message.embeds[0].footer)
@arcticwolvinny 🌈 no error and no image Cry
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 10/15/2023 in #djs-questions
Can‘t find message by id
Ah ok, thank you very much
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 10/15/2023 in #djs-questions
Can‘t find message by id
So it would be?:
const dmChannel = user.createDM()
const message = dmChannel.messages.fetch(…)
const dmChannel = user.createDM()
const message = dmChannel.messages.fetch(…)
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 10/15/2023 in #djs-questions
Can‘t find message by id
Even if some DMs have already been sent?
9 replies
DIAdiscord.js - Imagine an app
Created by Black_Wither on 10/15/2023 in #djs-questions
Can‘t find message by id
The user and the message id are correct
9 replies
DIAdiscord.js - Imagine an app
Created by Обкуренный on 8/5/2023 in #djs-questions
Made a command for user information, gives an error
Can you show me \events\InteractionCreate.js line 18?
18 replies
DIAdiscord.js - Imagine an app
Created by 𝑆𝑘𝑢𝑙𝑙𝑦 ඞ on 8/4/2023 in #djs-questions
Edit message according to selected value
I hope you understand what I say because I‘m german and dont talk very well english xD
36 replies
DIAdiscord.js - Imagine an app
Created by 𝑆𝑘𝑢𝑙𝑙𝑦 ඞ on 8/4/2023 in #djs-questions
Edit message according to selected value
like you have for example 30mins to select something or when the bot restart you need to make the command again to click something in the select menu
36 replies
DIAdiscord.js - Imagine an app
Created by 𝑆𝑘𝑢𝑙𝑙𝑦 ඞ on 8/4/2023 in #djs-questions
Edit message according to selected value
no problem
36 replies
DIAdiscord.js - Imagine an app
Created by 𝑆𝑘𝑢𝑙𝑙𝑦 ඞ on 8/4/2023 in #djs-questions
Edit message according to selected value
yes
36 replies
DIAdiscord.js - Imagine an app
Created by 𝑆𝑘𝑢𝑙𝑙𝑦 ඞ on 8/4/2023 in #djs-questions
Edit message according to selected value
you can put it in with an listener, but this is only temporary. A other possibility is, that you create a select menu handler, what this is, you can search in the internet
36 replies
DIAdiscord.js - Imagine an app
Created by 𝑆𝑘𝑢𝑙𝑙𝑦 ඞ on 8/4/2023 in #djs-questions
Edit message according to selected value
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

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

client.commands = new Collection();
const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
client.commands.set(command.data.name, command);
}

client.once(Events.ClientReady, () => {
console.log('Prêt !');
});

client.on(Events.InteractionCreate, async interaction => {

if(interaction.customId == 'helppageredirect') {
if(interaction.values[0] == 'commandes'){
const commandes = new EmbedBuilder()
.setTitle('Commandes')
.setDescription('Voici la liste des commandes :')
.setColor(0xcd6f57)
.setAuthor({
url: `https://discord.gg/56aN5xCqnQ`,
iconURL: interaction.user.displayAvatarURL(),
name: interaction.user.tag
})
await interaction.update({
embeds: [commandes],
})
}
}
if (!interaction.isChatInputCommand()) return;

const command = client.commands.get(interaction.commandName);

if (!command) return;

try {
await command.execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'Il y a un problème lors de l\'exécution de la commande ! Veuillez vérifier le code ou demander de l\'aide à un administrateur !', ephemeral: true });
}
});

client.login(token);
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

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

client.commands = new Collection();
const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
client.commands.set(command.data.name, command);
}

client.once(Events.ClientReady, () => {
console.log('Prêt !');
});

client.on(Events.InteractionCreate, async interaction => {

if(interaction.customId == 'helppageredirect') {
if(interaction.values[0] == 'commandes'){
const commandes = new EmbedBuilder()
.setTitle('Commandes')
.setDescription('Voici la liste des commandes :')
.setColor(0xcd6f57)
.setAuthor({
url: `https://discord.gg/56aN5xCqnQ`,
iconURL: interaction.user.displayAvatarURL(),
name: interaction.user.tag
})
await interaction.update({
embeds: [commandes],
})
}
}
if (!interaction.isChatInputCommand()) return;

const command = client.commands.get(interaction.commandName);

if (!command) return;

try {
await command.execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'Il y a un problème lors de l\'exécution de la commande ! Veuillez vérifier le code ou demander de l\'aide à un administrateur !', ephemeral: true });
}
});

client.login(token);
36 replies