File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ limitations under the License. */
3030 padding : 20px 0 ;
3131}
3232
33+ .memberMenuRolesDiv {
34+ width : 100% ;
35+ background-color : # 2f3136 ;
36+ padding : 20px 0 ;
37+ }
38+
3339.memberIcon {
3440 height : 80px ;
3541 width : 80px ;
@@ -78,6 +84,28 @@ limitations under the License. */
7884 max-width : 100% ;
7985}
8086
87+ .menuRolesDiv {
88+ width : 80% ;
89+ margin-left : auto;
90+ margin-right : auto;
91+ display : block;
92+ }
93+
94+ .memberRoles {
95+ color : # b9bbbe ;
96+ font-size : 15px ;
97+ display : inline-block;
98+ word-wrap : break-word;
99+ white-space : pre-wrap;
100+ max-width : 100% ;
101+ }
102+
103+ .memberRoles span {
104+ background-color : # 202225 ;
105+ margin : 4px ;
106+ padding : 1px ;
107+ }
108+
81109.memberCustomEmoji {
82110 display : inline-block;
83111 transform : translateY (4px );
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ function buildMemberMenu(parent) {
2626 user . classList . add ( 'memberMenuUserDiv' ) ;
2727 div . appendChild ( user ) ;
2828
29+ // The top section of the member menu
30+ let roles = document . createElement ( 'div' ) ;
31+ roles . classList . add ( 'memberMenuRolesDiv' ) ;
32+ div . appendChild ( roles ) ;
33+
2934 // The user icon
3035 let userIcon = document . createElement ( 'img' ) ;
3136 userIcon . classList . add ( 'memberIcon' ) ;
@@ -88,6 +93,24 @@ function buildMemberMenu(parent) {
8893 presenceDiv . appendChild ( custPres ) ;
8994 }
9095
96+ // roles :D
97+ let rolesDiv = document . createElement ( 'div' ) ;
98+ rolesDiv . classList . add ( 'menuRolesDiv' ) ;
99+ roles . appendChild ( rolesDiv ) ;
100+
101+ let rolestext = document . createElement ( 'div' ) ;
102+ rolestext . classList . add ( 'memberRoles' ) ;
103+
104+ member . _roles . forEach ( ( roleid ) => {
105+ console . log ( roleid ) ;
106+ let rolename = selectedGuild . roles . cache . get ( roleid ) ;
107+ let spans = document . createElement ( 'span' ) ;
108+ spans . innerText = rolename . name ;
109+ rolestext . appendChild ( spans ) ;
110+ } )
111+
112+ rolesDiv . appendChild ( rolestext ) ;
113+
91114 // Set the final position of the menu
92115 let borderOffset = 40 ;
93116 let y = window . pageYOffset + parent . getBoundingClientRect ( ) . top - 20 ;
You can’t perform that action at this time.
0 commit comments