This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcmd_pet.js
80 lines (79 loc) · 3.75 KB
/
cmd_pet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
var request = require('request')
module.exports = function(msg, bot, args) { // pet someone <3
if (args) {
if (msg.mentions[0] != undefined) {
var user = msg.mentions[0]
if (user.id == msg.author.id) {
msg.channel.createMessage("Dont be so lonely! Have a cookie :cookie:")
} else {
//msg.channel.createMessage(":cookie: **" + msg.author.username + " gave " + msg.mentions[0].username + " a cookie OwO** :cookie:")
request('https://nekos.life/api/pat', function(error, response, body) {
let json = JSON.parse(body); // parsing
let result = json.url; // defining the pat
msg.channel.createMessage({
"embed": {
"title": "*" + msg.author.username + "* pats *" + user.username + "*!",
"color": 14625534,
"image": {
"url": result
}
}
})
})
}
} else if (msg.channel.guild.members.find(owo => owo.username.toLowerCase() == args.toLowerCase()) != undefined) {
var user = msg.channel.guild.members.find(owo => owo.username.toLowerCase() == args.toLowerCase())
if (user.id == msg.author.id) {
msg.channel.createMessage("Dont be so lonely! Have a cookie :cookie:")
} else {
request('https://nekos.life/api/pat', function(error, response, body) {
let json = JSON.parse(body); // parsing
let result = json.url; // defining the pat
msg.channel.createMessage({
"embed": {
"title": "*" + msg.author.username + "* pats *" + user.username + "*!",
"color": 14625534,
"image": {
"url": result
}
}
})
})
}
//msg.channel.createMessage(":cookie: **" + msg.author.username + " gave " + user.username + " a cookie OwO** :cookie:")
} else if (msg.channel.guild.members.find(owo => owo.id == args) != undefined) {
var user = msg.channel.guild.members.find(owo => owo.id == args)
if (user.id == msg.author.id) {
msg.channel.createMessage("Dont be so lonely! Have a cookie :cookie:")
} else {
request('https://nekos.life/api/pat', function(error, response, body) {
let json = JSON.parse(body); // parsing
let result = json.url; // defining the pat
msg.channel.createMessage({
"embed": {
"title": "*" + msg.author.username + "* pats *" + user.username + "*!",
"color": 14625534,
"image": {
"url": result
}
}
})
})
}
//msg.channel.createMessage(":cookie: **" + msg.author.username + " gave " + user.username + " a cookie OwO** :cookie:")
}
} else {
request('https://nekos.life/api/pat', function(error, response, body) {
let json = JSON.parse(body); // parsing
let result = json.url; // defining the pat
msg.channel.createMessage({
"embed": {
"color": 14625534,
"image": {
"url": result
}
}
})
})
}
};