-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrps.js
More file actions
48 lines (48 loc) · 1.85 KB
/
Copy pathrps.js
File metadata and controls
48 lines (48 loc) · 1.85 KB
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
module.exports.config = {
name: "rps",
version: "1.0.0",
hasPermssion: 0,
credits: "JustGon", //Giữ Credit tôn trọng thằng làm ra
description: "búa bao kéo",
commandCategory: "rps",
usages: "[tag]",
cooldowns: 5,
dependencies: {
}
};
module.exports.run = async function ({ event, api, args }) {
function outMsg(data) {
api.sendMessage(data, event.threadID, event.messageID);
}
if(!args[0]) {
outMsg("Vui lòng nhập ✌️ hoặc 👊 hoặc ✋")
}
var turnbot = ["✌️","👊","✋"]
var botturn = turnbot[Math.floor(Math.random() * turnbot.length)]
var userturn = args.join( " ")
if (userturn == "✌️"||userturn == "👊"||userturn == "✋") {
if (userturn == turnbot) {
return outMsg(`Hòa\nUser : ${userturn}\nBot : ${botturn} `)
} else if (userturn == "✌️") {
if (botturn == "👊") {
return outMsg(`Bot win\nUser : ${userturn}\nBot : ${botturn} `)
} else if (botturn == "✋") {
return outMsg(`User win\nUser : ${userturn}\nBot : ${botturn} `)
}
} else if (userturn == "👊") {
if (botturn == "✋") {
return outMsg(`Bot win\nUser : ${userturn}\nBot : ${botturn} `)
} else if (botturn == "✌️") {
return outMsg(`User win\nUser : ${userturn}\nBot : ${botturn} `)
}
} else if (userturn == "✋") {
if (botturn == "✌️") {
return outMsg(`Bot win\nUser : ${userturn}\nBot : ${botturn} `)
} else if (botturn == "👊") {
return outMsg(`User win\nUser : ${userturn}\nBot : ${botturn} `)
}
}
} else {
return outMsg("Sai Format")
}
}