@@ -165,6 +165,22 @@ class Guild extends SnowFlake {
165
165
{ defaultIndex : sysmap . indexOf ( this . properties . system_channel_id ) } ,
166
166
sysmap ,
167
167
) ;
168
+ console . log ( textChannels , this . channels ) ;
169
+ const options : [ "DISCOVERABLE" , "COMMUNITY" , "INVITES_DISABLED" ] = [
170
+ "DISCOVERABLE" ,
171
+ "COMMUNITY" ,
172
+ "INVITES_DISABLED" ,
173
+ ] ;
174
+ const defaultIndex = options . findIndex ( ( _ ) => this . properties . features . includes ( _ ) ) ;
175
+ form . addSelect (
176
+ I18n . guild . howJoin ( ) ,
177
+ "features" ,
178
+ options . map ( ( _ ) => I18n . guild [ _ ] ( ) ) ,
179
+ {
180
+ defaultIndex : defaultIndex == - 1 ? 1 : defaultIndex ,
181
+ } ,
182
+ options ,
183
+ ) ;
168
184
169
185
form . addCheckboxInput ( I18n . getTranslation ( "guild.sendrandomwelcome?" ) , "s1" , {
170
186
initState : ! ( this . properties . system_channel_flags & 1 ) ,
@@ -189,6 +205,11 @@ class Guild extends SnowFlake {
189
205
bits += ( 1 - e . s4 ) * 8 ;
190
206
delete e . s4 ;
191
207
e . system_channel_flags = bits ;
208
+ const temp = this . properties . features ;
209
+ //@ts -ignore
210
+ temp . filter ( ( _ ) => ! options . includes ( _ ) ) ;
211
+ temp . push ( e . features ) ;
212
+ e . features = temp ;
192
213
} ) ;
193
214
194
215
form . addHR ( ) ;
@@ -439,7 +460,6 @@ class Guild extends SnowFlake {
439
460
this . member_count = json . member_count ;
440
461
this . emojis = json . emojis ;
441
462
this . headers = this . owner . headers ;
442
- this . channels = [ ] ;
443
463
if ( this . properties . icon !== json . icon ) {
444
464
this . properties . icon = json . icon ;
445
465
if ( this . HTMLicon ) {
0 commit comments