Sexus Prime
Sexus Prime
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 7/9/2023 in #djs-questions
send base64 string on Embed
image is not showing @.gwapes
const imageBuffer = Buffer.from(imagemQrcode)

const embed = new EmbedBuilder()
.setImage('attachment://qrcode')
.setDescription(`chave: \`${qrcode}\``);

const attachment = new AttachmentBuilder(imageBuffer, { name: 'qrcode' })

interaction.editReply({ embeds: [embed], files: [attachment] })
const imageBuffer = Buffer.from(imagemQrcode)

const embed = new EmbedBuilder()
.setImage('attachment://qrcode')
.setDescription(`chave: \`${qrcode}\``);

const attachment = new AttachmentBuilder(imageBuffer, { name: 'qrcode' })

interaction.editReply({ embeds: [embed], files: [attachment] })
9 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 7/2/2023 in #djs-questions
Cannot read properties of null on guild.commands.create
@luna🌈 @qjuh worked, tks!
13 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 7/2/2023 in #djs-questions
Cannot read properties of null on guild.commands.create
ok, i gonna try..
13 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 7/2/2023 in #djs-questions
Cannot read properties of null on guild.commands.create
memory: 🔥
13 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 7/2/2023 in #djs-questions
Cannot read properties of null on guild.commands.create
but how would I not be logged in if the guild returns the data?
13 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 7/2/2023 in #djs-questions
Cannot read properties of null on guild.commands.create
node: v18.15.0
13 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/11/2023 in #djs-questions
Using djs types globally
thanks bro
7 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/11/2023 in #djs-questions
Using djs types globally
I thought about this my whole life before I saw a post about it
7 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/11/2023 in #djs-questions
Using djs types globally
sorry about that, i saw that information recently somewhere..
7 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/11/2023 in #djs-questions
Using djs types globally
confused.. so if in file A I import discord.js, and in file B I import it again, won't discord.js be loaded twice?
7 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/11/2023 in #djs-questions
Using djs types globally
I realized that package is too heavy to be importing in each file, so I found a way to import in a single file. Of course, importing types in typescript won't weigh more, because when compiled it won't appear, but now it's weird to import only the types, and I'm sure there's some way to use global types without needing to import When vscode imports the type, it never puts the "type" keyword so I can end up forgetting to put it and discord.js is imported
7 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/7/2023 in #djs-questions
Interaction class
static async run(interaction: ChatInputCommandInteraction) {
console.log()
let groupSubCommand = interaction.options.data.find(d => d.type === 2)?.name;
let subCommand = interaction.options.data.find(d => d.type === 1)?.name;

if(groupSubCommand) {
executionPaths[groupSubCommand][<string>subCommand](interaction);
}
else if(subCommand) {
executionPaths[subCommand](interaction);
}
else {
executionPaths.main(interaction);
}
}
static async run(interaction: ChatInputCommandInteraction) {
console.log()
let groupSubCommand = interaction.options.data.find(d => d.type === 2)?.name;
let subCommand = interaction.options.data.find(d => d.type === 1)?.name;

if(groupSubCommand) {
executionPaths[groupSubCommand][<string>subCommand](interaction);
}
else if(subCommand) {
executionPaths[subCommand](interaction);
}
else {
executionPaths.main(interaction);
}
}
6 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/7/2023 in #djs-questions
Interaction class
bot.on('interactionCreate', (interaction) => {
if(!interaction.isChatInputCommand()) return;

const selectedCommand = bot.commands.get(interaction.commandName);

if(selectedCommand) {
const responseMethods = ResponseMethods.get();
Object.assign(interaction, responseMethods);

selectedCommand.run({ bot, interaction });
}
})
bot.on('interactionCreate', (interaction) => {
if(!interaction.isChatInputCommand()) return;

const selectedCommand = bot.commands.get(interaction.commandName);

if(selectedCommand) {
const responseMethods = ResponseMethods.get();
Object.assign(interaction, responseMethods);

selectedCommand.run({ bot, interaction });
}
})
6 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 2/7/2023 in #djs-questions
Interaction class
node: v16.19.0
6 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 1/22/2023 in #djs-questions
Error using GuildMember.roles.add()
thanks broo 👍🏽
5 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 1/22/2023 in #djs-questions
Error using GuildMember.roles.add()
5 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 10/18/2022 in #djs-questions
wait post
thanks broo
21 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 10/18/2022 in #djs-questions
wait post
how?
21 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 10/18/2022 in #djs-questions
wait post
if I use on, is there any way I can stop it whenever I want?
21 replies
DIAdiscord.js - Imagine an app
Created by Sexus Prime on 10/18/2022 in #djs-questions
wait post
...
21 replies