File tree 5 files changed +48
-1
lines changed
5 files changed +48
-1
lines changed Original file line number Diff line number Diff line change
1
+ const { addPrototype } = require ( "erisify/helper/prototype" ) ;
2
+
3
+ /**
4
+ * @param {import("eris") } Eris
5
+ */
6
+ module . exports . init = ( Eris ) => {
7
+ addPrototype ( Eris , "Member" , function hoistColor ( ) {
8
+ const hoistedRole = this . roles . find ( item => item . hoist ) ;
9
+
10
+ return hoistedRole ?. color || "#FFFF" ;
11
+ } , true ) ;
12
+ } ;
Original file line number Diff line number Diff line change
1
+ const { addPrototype } = require ( "erisify/helper/prototype" ) ;
2
+
3
+ /**
4
+ * @param {import("eris") } Eris
5
+ */
6
+ module . exports . init = ( Eris ) => {
7
+ addPrototype ( Eris , "Member" , function tag ( ) {
8
+ return `${ this . username } #${ this . discriminator } ` ;
9
+ } , true ) ;
10
+ } ;
Original file line number Diff line number Diff line change
1
+ const { addPrototype } = require ( "erisify/helper/prototype" ) ;
2
+
3
+ /**
4
+ * @param {import("eris") } Eris
5
+ */
6
+ module . exports . init = ( Eris ) => {
7
+ addPrototype ( Eris , "Role" , function higherThan ( roleTwo ) {
8
+ // If both roles have the same position then use id's (the lower the id the older it is, so lets return true if it's older)
9
+ if ( this . position === roleTwo . position ) return this . id < roleTwo . id ;
10
+
11
+ return this . position > roleTwo . position ;
12
+ } , true ) ;
13
+ } ;
Original file line number Diff line number Diff line change
1
+ const { addPrototype } = require ( "erisify/helper/prototype" ) ;
2
+
3
+ /**
4
+ * @param {import("eris") } Eris
5
+ */
6
+ module . exports . init = ( Eris ) => {
7
+ addPrototype ( Eris , "Role" , function isHighest ( ) {
8
+ const highestRole = Math . max . apply ( Math , array . map ( item => item . position ) ) ;
9
+
10
+ return highestRole . id === this . id ;
11
+ } , true ) ;
12
+ } ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const { addPrototype } = require("erisify/helper/prototype");
4
4
* @param {import("eris") } Eris
5
5
*/
6
6
module . exports . init = ( Eris ) => {
7
- addPrototype ( Eris , "User" , function guild ( ) {
7
+ addPrototype ( Eris , "User" , function tag ( ) {
8
8
return `${ this . username } #${ this . discriminator } ` ;
9
9
} , true ) ;
10
10
} ;
You can’t perform that action at this time.
0 commit comments