/[sudobot]/trunk/src/commands/automation/EmbedBuildCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/automation/EmbedBuildCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 251 by rakin, Mon Jul 29 17:29:13 2024 UTC revision 254 by rakin, Mon Jul 29 17:29:13 2024 UTC
# Line 20  export default class EmbedBuildCommand e Line 20  export default class EmbedBuildCommand e
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');
# Line 28  export default class EmbedBuildCommand e Line 28  export default class EmbedBuildCommand e
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]

Legend:
Removed from v.251  
changed lines
  Added in v.254

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26