File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/Discord/Parts/Channel Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1420,6 +1420,13 @@ public function getCreatableAttributes(): array
14201420 'position ' => $ this ->position ,
14211421 ]);
14221422
1423+ if (null === $ this ->type ) {
1424+ // Type was not specified but we must not assume its default to GUILD_TEXT as that is determined by API
1425+ $ this ->discord ->getLogger ()->warning ('Not specifying channel type, creating with all filled attributes ' );
1426+ $ attr += $ this ->getRawAttributes (); // Send the remaining raw attributes
1427+ return $ attr ;
1428+ }
1429+
14231430 switch ($ this ->type ) {
14241431 case self ::TYPE_GUILD_TEXT :
14251432 $ attr += $ this ->makeOptionalAttributes ([
@@ -1479,12 +1486,6 @@ public function getCreatableAttributes(): array
14791486 'default_thread_rate_limit_per_user ' => $ this ->default_thread_rate_limit_per_user , // Canceled documentation #5606
14801487 ]);
14811488 break ;
1482-
1483- case null :
1484- // Type was not specified but we must not assume its default to GUILD_TEXT as that is determined by API
1485- $ this ->discord ->getLogger ()->warning ('Not specifying channel type, creating with all filled attributes ' );
1486- $ attr += $ this ->getRawAttributes (); // Send the remaining raw attributes
1487- break ;
14881489 }
14891490
14901491 return $ attr ;
You can’t perform that action at this time.
0 commit comments