#Advanced CreateEmbed
1 messages · Page 1 of 1 (latest)
Help with what?
Create the command, it's difficult to me
The begining of the command.
@primal tide So could you help?
args.split('$v') will return a new array with each embed option object u can remove the {} from each option and pass it onto an embed
but could you personally help me?
just ask
okay
so i want to make it so like you can make the embed like
,ce {title: welcome to server}$v{description: hi}
yea i got that
im assuming 'args' for you returns an array of strings separated by each space right
kk
you can try uhh args.join(' ').split('$v') then console log , it should return an array separated by each $v
should i define args as that?
just console log it to start
kk
name: "cre",
run: async (client, message, args) => {
const Discord = require('discord.js')
const arg = args.join(' ').split('$v')
console.log(arg)
}
}
?
sure
did u send a test embed
no
kk
btw i want it
so the user
can create an embed
yea i know
name: "cre",
run: async (client, message, args) => {
const Discord = require('discord.js')
const arg = args.join(' ').split('$v')
console.log(arg)
const eb = new Discord.MessageEmbed()
.setDescription(arg)
message.channel.send({ embeds: [eb] });
}
}
wha u said
module.exports = {
name: "cre",
run: async (client, message, args) => {
const Discord = require('discord.js')
const arg = args.join(' ').split('$v')
console.log(arg)
}
}
start off with this
all i told u was to send a test embed
like if the command was done
oh
ok
now replace each { } with an empty string so it "removes" it
.replace([{|}]/g, '')
ye
args.join(...).split(...).replace is not a function
[ 'title: f', 'description: f', 'color: #000000' ]
ok now u can just join it with a , and pass arg onto an embed
name: "cre",
run: async (client, message, args) => {
const Discord = require('discord.js')
const arg = args.join(' ').replace(/[{|}]/g , '').split('$v')
console.log(arg)
const eb = new Discord.MessageEmbed()
.setDescription(arg)
message.channel.send({ embeds: [eb] });
}
}```
?
=
it sent that
name: "cre",
run: async (client, message, args) => {
const Discord = require('discord.js')
const arg = args.join(' ').replace(/[{|}]/g , '').split('$v')
console.log(arg)
const eb = new Discord.MessageEmbed()
.setDescription(`${arg}`)
message.channel.send({ embeds: [eb] });
}
}```
@dusty elk you here?
yo
you should really try doing this with interactions... its so much easier to specify every part of the embed with interaction options