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

Annotation of /trunk/commands/unban.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (hide annotations)
Mon Jul 29 17:28:16 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 1234 byte(s)
More improvements
1 rakin 25 const History = require("../src/History");
2 rakin 5 const MessageEmbed = require("../src/MessageEmbed");
3    
4     module.exports = {
5     async handle(msg, cm) {
6     if (typeof cm.args[0] === 'undefined') {
7     await msg.reply({
8     embeds: [
9     new MessageEmbed()
10     .setColor('#f14a60')
11     .setDescription(`This command requires at least one argument.`)
12     ]
13     });
14    
15     return;
16     }
17    
18     try {
19 rakin 25 await msg.guild.bans.remove(cm.args[0]);
20 rakin 5 }
21     catch(e) {
22     console.log(e);
23    
24     await msg.reply({
25     embeds: [
26     new MessageEmbed()
27     .setColor('#f14a60')
28 rakin 25 .setDescription(`Invalid user ID or missing permissions or user not banned.`)
29 rakin 5 ]
30     });
31    
32     return;
33     }
34 rakin 25
35     await History.create(cm.args[0], msg.guild, 'unban', msg.author.id, async (data2) => {
36    
37     });
38 rakin 5
39     await msg.reply({
40     embeds: [
41     new MessageEmbed()
42     .setDescription(`The user with ID ${cm.args[0]} has been unbanned`)
43     ]
44     });
45     }
46     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26