Correcting names, and deleting message
There is a known regresion for the MESSAGE_CREATE event while it's not on screen, though I have not been able to replicate it while I'm looking for it. If you see this bug, please let me know the conditions it happens under
This commit is contained in:
@@ -2,6 +2,7 @@ import { Channel } from "./channel.js";
|
||||
import { Contextmenu } from "./contextmenu.js";
|
||||
import { Role } from "./role.js";
|
||||
import { Fullscreen } from "./fullscreen.js";
|
||||
import { Member } from "./member.js";
|
||||
class Guild {
|
||||
owner;
|
||||
headers;
|
||||
@@ -52,15 +53,12 @@ class Guild {
|
||||
},null,_=>{return thisuser.isAdmin()})
|
||||
*/
|
||||
}
|
||||
constructor(JSON, owner) {
|
||||
constructor(JSON, owner, member) {
|
||||
if (JSON === -1) {
|
||||
return;
|
||||
}
|
||||
this.owner = owner;
|
||||
this.headers = this.owner.headers;
|
||||
if (!this.owner) {
|
||||
console.error("localuser was not included, please fix");
|
||||
}
|
||||
this.channels = [];
|
||||
this.channelids = {};
|
||||
this.id = JSON.id;
|
||||
@@ -74,6 +72,7 @@ class Guild {
|
||||
this.roles.push(roleh);
|
||||
this.roleids[roleh.id] = roleh;
|
||||
}
|
||||
Member.resolve(member, this).then(_ => this.member = _);
|
||||
for (const thing of JSON.channels) {
|
||||
const temp = new Channel(thing, this);
|
||||
this.channels.push(temp);
|
||||
@@ -353,19 +352,10 @@ class Guild {
|
||||
body: JSON.stringify(build)
|
||||
});
|
||||
}
|
||||
fillMember(member) {
|
||||
const realroles = [];
|
||||
for (const thing of member.roles) {
|
||||
realroles.push(this.getRole(thing));
|
||||
}
|
||||
member.roles = realroles;
|
||||
return member;
|
||||
}
|
||||
giveMember(member) {
|
||||
this.fillMember(member);
|
||||
this.member = member;
|
||||
}
|
||||
getRole(ID) {
|
||||
if (!this.roleids[ID]) {
|
||||
console.error(`role id ${ID} does not exist`, this.roleids);
|
||||
}
|
||||
return this.roleids[ID];
|
||||
}
|
||||
hasRole(r) {
|
||||
|
Reference in New Issue
Block a user