20 |
} |
} |
21 |
|
|
22 |
try { |
try { |
23 |
const embedData = JSON.parse(options.isInteraction ? options.options.getString('json_schema')! : options.args.join(' ')); |
const embedData = JSON.parse((options.isInteraction ? options.options.getString('json_schema')! : options.args.join(' ')).replace(/^embed\:/, '')); |
24 |
|
|
25 |
if (!embedData) { |
if (!embedData) { |
26 |
throw new Error('Parse Error'); |
throw new Error('Parse Error'); |
28 |
|
|
29 |
try { |
try { |
30 |
const embed = new MessageEmbed(embedData); |
const embed = new MessageEmbed(embedData); |
31 |
|
|
32 |
|
if (embedData.color) { |
33 |
|
try { |
34 |
|
embed.setColor(embedData.color); |
35 |
|
} |
36 |
|
catch (e) { |
37 |
|
console.log(e); |
38 |
|
} |
39 |
|
} |
40 |
|
|
41 |
await message.channel?.send({ |
await message.channel?.send({ |
42 |
embeds: [embed] |
embeds: [embed] |