@@ -1800,6 +1800,7 @@ async def create_forum(
1800
1800
category : Optional [CategoryChannel ] = None ,
1801
1801
slowmode_delay : int = MISSING ,
1802
1802
nsfw : bool = MISSING ,
1803
+ media : bool = MISSING ,
1803
1804
overwrites : Mapping [Union [Role , Member , Object ], PermissionOverwrite ] = MISSING ,
1804
1805
reason : Optional [str ] = None ,
1805
1806
default_auto_archive_duration : int = MISSING ,
@@ -1862,12 +1863,17 @@ async def create_forum(
1862
1863
.. versionadded:: 2.3
1863
1864
default_layout: :class:`ForumLayoutType`
1864
1865
The default layout for posts in this forum.
1866
+ This cannot be set if ``media`` is set to ``True``.
1865
1867
1866
1868
.. versionadded:: 2.3
1867
1869
available_tags: Sequence[:class:`ForumTag`]
1868
1870
The available tags for this forum channel.
1869
1871
1870
1872
.. versionadded:: 2.1
1873
+ media: :class:`bool`
1874
+ Whether to create a media forum channel.
1875
+
1876
+ .. versionadded:: 2.6
1871
1877
1872
1878
Raises
1873
1879
-------
@@ -1919,7 +1925,7 @@ async def create_forum(
1919
1925
else :
1920
1926
raise ValueError (f'default_reaction_emoji parameter must be either Emoji, PartialEmoji, or str' )
1921
1927
1922
- if default_layout is not MISSING :
1928
+ if not media and default_layout is not MISSING :
1923
1929
if not isinstance (default_layout , ForumLayoutType ):
1924
1930
raise TypeError (
1925
1931
f'default_layout parameter must be a ForumLayoutType not { default_layout .__class__ .__name__ } '
@@ -1931,10 +1937,17 @@ async def create_forum(
1931
1937
options ['available_tags' ] = [t .to_dict () for t in available_tags ]
1932
1938
1933
1939
data = await self ._create_channel (
1934
- name = name , overwrites = overwrites , channel_type = ChannelType .forum , category = category , reason = reason , ** options
1940
+ name = name ,
1941
+ overwrites = overwrites ,
1942
+ channel_type = ChannelType .forum if not media else ChannelType .media ,
1943
+ category = category ,
1944
+ reason = reason ,
1945
+ ** options ,
1935
1946
)
1936
1947
1937
- channel = ForumChannel (state = self ._state , guild = self , data = data )
1948
+ channel = ForumChannel (
1949
+ state = self ._state , guild = self , data = data # pyright: ignore[reportArgumentType] # it's the correct data
1950
+ )
1938
1951
1939
1952
# temporarily add to the cache
1940
1953
self ._channels [channel .id ] = channel
0 commit comments