/[sudobot]/trunk/commands/delsnippet.js
ViewVC logotype

Annotation of /trunk/commands/delsnippet.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (hide annotations)
Mon Jul 29 17:28:16 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 1024 byte(s)
Added -send command and added support of attachments in snippets
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 rakin 27 let status = cm.snippetManager.delete(msg.guild.id, cm.args[0]);
18 rakin 5
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     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26