1 |
const History = require("../src/History"); |
const History = require("../src/History"); |
2 |
const MessageEmbed = require("../src/MessageEmbed"); |
const MessageEmbed = require("../src/MessageEmbed"); |
3 |
|
const { getUser } = require("../src/UserInput"); |
4 |
|
|
5 |
module.exports = { |
module.exports = { |
6 |
async handle(msg, cm) { |
async handle(msg, cm) { |
16 |
return; |
return; |
17 |
} |
} |
18 |
|
|
19 |
var user = await msg.mentions.members.first(); |
try { |
20 |
let reason; |
var user = await getUser(cm.args[0], msg); |
|
|
|
|
if (typeof cm.args[1] !== 'undefined') { |
|
|
let args = [...cm.args]; |
|
|
args.shift(); |
|
21 |
|
|
22 |
await (reason = args.join(' ')); |
console.log(user); |
|
} |
|
|
|
|
|
if (typeof user !== 'object') { |
|
|
try { |
|
|
user = await msg.guild.members.fetch(cm.args[0]); |
|
|
} |
|
|
catch(e) { |
|
23 |
|
|
24 |
|
if (!user) { |
25 |
|
throw new Error('Invalid User'); |
26 |
} |
} |
27 |
} |
} |
28 |
|
catch (e) { |
29 |
|
console.log(e); |
30 |
|
|
|
if (typeof user !== 'object') { |
|
31 |
await msg.reply({ |
await msg.reply({ |
32 |
embeds: [ |
embeds: [ |
33 |
new MessageEmbed() |
new MessageEmbed() |
39 |
return; |
return; |
40 |
} |
} |
41 |
|
|
42 |
|
let reason; |
43 |
|
|
44 |
|
if (typeof cm.args[1] !== 'undefined') { |
45 |
|
let args = [...cm.args]; |
46 |
|
args.shift(); |
47 |
|
|
48 |
|
await (reason = args.join(' ')); |
49 |
|
} |
50 |
|
|
51 |
this.bean(user, reason, msg); |
this.bean(user, reason, msg); |
52 |
|
|
53 |
await msg.reply({ |
await msg.reply({ |