make the buttons for kicking, banning, and friending
This commit is contained in:
parent
3a1eac3df3
commit
ecf93e6fd3
1 changed files with 11 additions and 8 deletions
|
@ -183,7 +183,7 @@ class User extends SnowFlake {
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
function () {
|
function () {
|
||||||
return this.relationshipType !== 2;
|
return this.relationshipType !== 2 && this.id !== this.localuser.user.id;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ class User extends SnowFlake {
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
function () {
|
function () {
|
||||||
return this.relationshipType === 2;
|
return this.relationshipType === 2 && this.id !== this.localuser.user.id;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
this.contextmenu.addbutton(
|
this.contextmenu.addbutton(
|
||||||
|
@ -204,7 +204,10 @@ class User extends SnowFlake {
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
function () {
|
function () {
|
||||||
return this.relationshipType === 0 || this.relationshipType === 3;
|
return (
|
||||||
|
(this.relationshipType === 0 || this.relationshipType === 3) &&
|
||||||
|
this.id !== this.localuser.user.id
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
this.contextmenu.addbutton(
|
this.contextmenu.addbutton(
|
||||||
|
@ -214,7 +217,7 @@ class User extends SnowFlake {
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
function () {
|
function () {
|
||||||
return this.relationshipType === 1;
|
return this.relationshipType === 1 && this.id !== this.localuser.user.id;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
this.contextmenu.addbutton(
|
this.contextmenu.addbutton(
|
||||||
|
@ -223,7 +226,7 @@ class User extends SnowFlake {
|
||||||
member?.kick();
|
member?.kick();
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
(member) => {
|
function (member) {
|
||||||
if (!member) return false;
|
if (!member) return false;
|
||||||
const us = member.guild.member;
|
const us = member.guild.member;
|
||||||
if (member.id === us.id) {
|
if (member.id === us.id) {
|
||||||
|
@ -232,7 +235,7 @@ class User extends SnowFlake {
|
||||||
if (member.id === member.guild.properties.owner_id) {
|
if (member.id === member.guild.properties.owner_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return us.hasPermission("KICK_MEMBERS") || false;
|
return us.hasPermission("KICK_MEMBERS") && this.id !== this.localuser.user.id;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -253,7 +256,7 @@ class User extends SnowFlake {
|
||||||
member?.ban();
|
member?.ban();
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
(member) => {
|
function (member) {
|
||||||
if (!member) return false;
|
if (!member) return false;
|
||||||
const us = member.guild.member;
|
const us = member.guild.member;
|
||||||
if (member.id === us.id) {
|
if (member.id === us.id) {
|
||||||
|
@ -262,7 +265,7 @@ class User extends SnowFlake {
|
||||||
if (member.id === member.guild.properties.owner_id) {
|
if (member.id === member.guild.properties.owner_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return us.hasPermission("BAN_MEMBERS") || false;
|
return us.hasPermission("BAN_MEMBERS") && this.id !== this.localuser.user.id;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
this.contextmenu.addbutton(
|
this.contextmenu.addbutton(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue