Skip to content

Commit

Permalink
Change if isinstance logic to elif
Browse files Browse the repository at this point in the history
Not checking if `activity` is instance of `int` when `activity` is an instance of `EmbeddedActivity` will result in better processing efficiency.
  • Loading branch information
OmLanke authored Dec 8, 2021
1 parent 45c52de commit 5e2a9b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ async def create_activity_invite(self, activity: Union[EmbeddedActivity, int] ,
if isinstance(activity, EmbeddedActivity):
activity = activity.value

if not isinstance(activity, int):
elif not isinstance(activity, int):
raise TypeError('Invalid type provided for the activity.')

return await self.create_invite(
Expand Down

0 comments on commit 5e2a9b3

Please sign in to comment.