-
Notifications
You must be signed in to change notification settings - Fork 281
Expand file tree
/
Copy pathcommandHandler.js
More file actions
67 lines (45 loc) · 1.91 KB
/
commandHandler.js
File metadata and controls
67 lines (45 loc) · 1.91 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
let commands = [];
const tabCmds = [];
const evt = {
events: {},
on(event, callback) {
if (!this.events[event]) {
this.events[event] = [];
}
this.events[event].push(callback);
},
emit(event, data) {
if (this.events[event]) {
this.events[event].forEach((callback) => callback(data));
}
},
};
const randomEmojis = [
"😊", "😎", "🔥", "⭐", "💫", "✨", "🌟", "💥", "🚀", "🎯",
"💯", "❤️", "💕", "💖", "💝", "🎉", "🎊", "🏆", "👑", "💎",
"📌", "📍", "🛎️", "🔔", "🎵", "🎶", "📢", "🔊", "👀", "👁️",
"🧠", "💡", "🔋", "🔌", "💻", "📱", "⌚", "📷", "🎥", "📹",
"☀️", "🌙", "⭐", "🌟", "🌈", "☁️", "⚡", "🔥", "💧", "🌊",
"🎮", "👾", "🕹️", "🎲", "♠️", "♥️", "♦️", "♣️", "🃏", "🀄",
"🏀", "⚽", "🎾", "🏐", "🎱", "⚾", "🏈", "🎯", "🏹", "⛳",
"🚗", "🚓", "🚕", "🚙", "🚌", "🚎", "🏎️", "🚀", "✈️", "🛩️",
"🍎", "🍌", "🍇", "🍓", "🍈", "🍒", "🍑", "🍍", "🥭", "🍉",
"🍕", "🍔", "🍟", "🌭", "🍿", "🧁", "🎂", "🍰", "🍦", "🍩"
];
function getRandomEmoji() {
return randomEmojis[Math.floor(Math.random() * randomEmojis.length)];
}
function keith(obj, functions) {
let infoComs = obj;
if (!obj.category) infoComs.category = "General";
if (!obj.react) infoComs.react = getRandomEmoji();
if (!obj.dontAddCommandList) infoComs.dontAddCommandList = false;
infoComs.function = functions;
const stack = new Error().stack;
const filePath = stack.split('\n')[2].match(/\((.*):\d+:\d+\)/)[1];
infoComs.filename = filePath;
commands.push(infoComs);
return infoComs;
}
module.exports = { keith, commands, evt, getRandomEmoji };
evt.commands = commands;