Implemented RemoteEvent class

This commit is contained in:
SrGooglo 2025-02-05 02:34:17 +00:00
parent c3df679449
commit 913e9b067c

View File

@ -0,0 +1,26 @@
export default class RemoteEvent {
constructor(id, payload) {
if (typeof id !== "string") {
console.error("Event id is required")
return false
}
this.id = id
this.payload = payload
this.send().catch((err) => {
console.error("Failed to send remote event >", err)
})
}
send = async () => {
app.cores.api.customRequest({
url: "/events/client",
method: "POST",
data: {
id: this.id,
payload: this.payload
}
})
}
}