fixed bugs
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
const { User } = require("./user");
|
||||
const { Website } = require("./website");
|
||||
|
||||
module.exports.data = new StructuredData();
|
||||
|
||||
class StructuredData {
|
||||
|
||||
constructor() {
|
||||
this.data={};
|
||||
}
|
||||
|
||||
|
||||
addUser(id){
|
||||
if(this.data[id] != undefined)
|
||||
{
|
||||
this.data[id] = new User(id);
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {number} id
|
||||
@@ -27,20 +26,22 @@ class StructuredData {
|
||||
getUser(id){
|
||||
return this.data[id];
|
||||
}
|
||||
|
||||
|
||||
deleteUser(id){
|
||||
if(this.data[id] != undefined)
|
||||
{
|
||||
return delete this.data[id];
|
||||
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
module.exports.data = new StructuredData();
|
||||
|
||||
/*
|
||||
data structured:
|
||||
data = {
|
||||
|
||||
@@ -28,7 +28,7 @@ const commands = [
|
||||
|
||||
|
||||
|
||||
const onMessage = (message, client) => {
|
||||
module.exports= onMessage = (message, client) => {
|
||||
|
||||
let command = null;
|
||||
|
||||
@@ -54,6 +54,6 @@ const onMessage = (message, client) => {
|
||||
|
||||
};
|
||||
|
||||
module.exports.onMessage = onMessage;
|
||||
|
||||
|
||||
//export default onMessage;
|
||||
Reference in New Issue
Block a user