1 |
rakin |
5 |
const MessageEmbed = require("../src/MessageEmbed"); |
2 |
|
|
|
3 |
|
|
module.exports = { |
4 |
|
|
async handle(msg, cm) { |
5 |
|
|
if (cm.args[0] === undefined) { |
6 |
|
|
await msg.reply({ |
7 |
|
|
embeds: [ |
8 |
|
|
new MessageEmbed() |
9 |
|
|
.setColor('#f14a60') |
10 |
|
|
.setDescription('This command requires at least 1 argument.') |
11 |
|
|
] |
12 |
|
|
}); |
13 |
|
|
|
14 |
|
|
return; |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
let status = cm.snippetManager.delete(cm.args[0]); |
18 |
|
|
|
19 |
|
|
if (status) { |
20 |
|
|
await msg.reply({ |
21 |
|
|
embeds: [ |
22 |
|
|
new MessageEmbed() |
23 |
|
|
.setDescription('Snippet deleted successfully!') |
24 |
|
|
] |
25 |
|
|
}); |
26 |
|
|
} |
27 |
|
|
else { |
28 |
|
|
await msg.reply({ |
29 |
|
|
embeds: [ |
30 |
|
|
new MessageEmbed() |
31 |
|
|
.setColor('#f14a60') |
32 |
|
|
.setDescription('No snippet was found with that name.') |
33 |
|
|
] |
34 |
|
|
}); |
35 |
|
|
} |
36 |
|
|
} |
37 |
|
|
}; |