Skip to content

Commit 5e2a9b3

Browse files
authored
Change if isinstance logic to elif
Not checking if `activity` is instance of `int` when `activity` is an instance of `EmbeddedActivity` will result in better processing efficiency.
1 parent 45c52de commit 5e2a9b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discord/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ async def create_activity_invite(self, activity: Union[EmbeddedActivity, int] ,
10841084
if isinstance(activity, EmbeddedActivity):
10851085
activity = activity.value
10861086

1087-
if not isinstance(activity, int):
1087+
elif not isinstance(activity, int):
10881088
raise TypeError('Invalid type provided for the activity.')
10891089

10901090
return await self.create_invite(

0 commit comments

Comments
 (0)