Parent Directory
|
Revision Log
Added base commands
1 | rakin | 5 | const MessageEmbed = require("../src/MessageEmbed"); |
2 | |||
3 | module.exports = { | ||
4 | async handle(msg, cm) { | ||
5 | if (typeof cm.args[0] === 'undefined') { | ||
6 | await msg.reply({ | ||
7 | embeds: [ | ||
8 | new MessageEmbed() | ||
9 | .setColor('#f14a60') | ||
10 | .setDescription(`This command requires at least one argument.`) | ||
11 | ] | ||
12 | }); | ||
13 | |||
14 | return; | ||
15 | } | ||
16 | |||
17 | try { | ||
18 | await msg.guild.members.unban(cm.args[0]); | ||
19 | } | ||
20 | catch(e) { | ||
21 | console.log(e); | ||
22 | |||
23 | await msg.reply({ | ||
24 | embeds: [ | ||
25 | new MessageEmbed() | ||
26 | .setColor('#f14a60') | ||
27 | .setDescription(`Invalid user ID or missing permissions.`) | ||
28 | ] | ||
29 | }); | ||
30 | |||
31 | return; | ||
32 | } | ||
33 | |||
34 | await msg.reply({ | ||
35 | embeds: [ | ||
36 | new MessageEmbed() | ||
37 | .setDescription(`The user with ID ${cm.args[0]} has been unbanned`) | ||
38 | ] | ||
39 | }); | ||
40 | } | ||
41 | }; |
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |