Skip to content

Commit c1322db

Browse files
DamegoFayeDel
andauthored
refactor!: rename outdated channel type names to new (#1024)
* refactor!: Rename outdated channel type names to new * refactor: change types in code Co-authored-by: DeltaX <[email protected]>
1 parent 557f8df commit c1322db

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

interactions/api/models/channel.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ class ChannelType(IntEnum):
3939
GUILD_VOICE = 2
4040
GROUP_DM = 3
4141
GUILD_CATEGORY = 4
42-
GUILD_NEWS = 5
42+
GUILD_ANNOUNCEMENT = 5
4343
GUILD_STORE = 6
44-
GUILD_NEWS_THREAD = 10
45-
GUILD_PUBLIC_THREAD = 11
46-
GUILD_PRIVATE_THREAD = 12
44+
ANNOUNCEMENT_THREAD = 10
45+
PUBLIC_THREAD = 11
46+
PRIVATE_THREAD = 12
4747
GUILD_STAGE_VOICE = 13
4848
GUILD_FORUM = 15
4949

@@ -966,7 +966,7 @@ def check_pinned(message):
966966
async def create_thread(
967967
self,
968968
name: str,
969-
type: Optional[ChannelType] = ChannelType.GUILD_PUBLIC_THREAD,
969+
type: Optional[ChannelType] = ChannelType.PUBLIC_THREAD,
970970
auto_archive_duration: Optional[int] = MISSING,
971971
invitable: Optional[bool] = MISSING,
972972
message_id: Optional[Union[int, Snowflake, "Message"]] = MISSING, # noqa
@@ -994,9 +994,9 @@ async def create_thread(
994994
if not self._client:
995995
raise LibraryException(code=13)
996996
if type not in [
997-
ChannelType.GUILD_NEWS_THREAD,
998-
ChannelType.GUILD_PUBLIC_THREAD,
999-
ChannelType.GUILD_PRIVATE_THREAD,
997+
ChannelType.ANNOUNCEMENT_THREAD,
998+
ChannelType.PUBLIC_THREAD,
999+
ChannelType.PRIVATE_THREAD,
10001000
]:
10011001
raise LibraryException(message="type must be a thread type!", code=12)
10021002

interactions/api/models/guild.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ async def create_thread(
724724
self,
725725
name: str,
726726
channel_id: Union[int, Snowflake, Channel],
727-
type: Optional[ChannelType] = ChannelType.GUILD_PUBLIC_THREAD,
727+
type: Optional[ChannelType] = ChannelType.PUBLIC_THREAD,
728728
auto_archive_duration: Optional[int] = MISSING,
729729
invitable: Optional[bool] = MISSING,
730730
message_id: Optional[Union[int, Snowflake, "Message"]] = MISSING,
@@ -754,9 +754,9 @@ async def create_thread(
754754
if not self._client:
755755
raise LibraryException(code=13)
756756
if type not in [
757-
ChannelType.GUILD_NEWS_THREAD,
758-
ChannelType.GUILD_PUBLIC_THREAD,
759-
ChannelType.GUILD_PRIVATE_THREAD,
757+
ChannelType.ANNOUNCEMENT_THREAD,
758+
ChannelType.PUBLIC_THREAD,
759+
ChannelType.PRIVATE_THREAD,
760760
]:
761761
raise LibraryException(message="type must be a thread type!", code=12)
762762

@@ -838,9 +838,9 @@ async def create_channel(
838838
)
839839

840840
if type in [
841-
ChannelType.GUILD_NEWS_THREAD,
842-
ChannelType.GUILD_PUBLIC_THREAD,
843-
ChannelType.GUILD_PRIVATE_THREAD,
841+
ChannelType.ANNOUNCEMENT_THREAD,
842+
ChannelType.PUBLIC_THREAD,
843+
ChannelType.PRIVATE_THREAD,
844844
]:
845845
raise LibraryException(
846846
message="Please use `create_thread` for creating threads!", code=12

0 commit comments

Comments
 (0)