Skip to content

Commit 8f03c52

Browse files
committed
Lint
1 parent 52138e6 commit 8f03c52

File tree

4 files changed

+44
-13
lines changed

4 files changed

+44
-13
lines changed

discord/application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,8 @@ def __init__(
10681068
) -> None:
10691069
self._state = state
10701070
self.application_id = application.id if application else int(data['application_id']) # type: ignore
1071-
self.application: Optional[PartialApplication] = (
1072-
application or (PartialApplication(state=state, data=data['application']) if 'application' in data else None)
1071+
self.application: Optional[PartialApplication] = application or (
1072+
PartialApplication(state=state, data=data['application']) if 'application' in data else None
10731073
)
10741074
self._user = state.create_user(data['user']) if 'user' in data else None
10751075
self.user_id: int = int(data['user_id']) if 'user_id' in data else state.self_id # type: ignore

discord/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4446,7 +4446,12 @@ async def create_authorization(
44464446
return data['location']
44474447

44484448
async def entitlements(
4449-
self, *, with_sku: bool = True, with_application: bool = True, include_ended: bool = True, entitlement_type: Optional[EntitlementType] = None
4449+
self,
4450+
*,
4451+
with_sku: bool = True,
4452+
with_application: bool = True,
4453+
include_ended: bool = True,
4454+
entitlement_type: Optional[EntitlementType] = None,
44504455
) -> List[Entitlement]:
44514456
"""|coro|
44524457

discord/guild.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4966,7 +4966,13 @@ async def apply_premium_subscription_slots(self, *subscription_slots: Snowflake)
49664966
return [PremiumGuildSubscription(state=state, data=sub) for sub in data]
49674967

49684968
async def entitlements(
4969-
self, *, with_sku: bool = True, with_application: bool = True, include_ended: bool = True, include_deleted: bool = True, entitlement_type: Optional[EntitlementType] = None
4969+
self,
4970+
*,
4971+
with_sku: bool = True,
4972+
with_application: bool = True,
4973+
include_ended: bool = True,
4974+
include_deleted: bool = True,
4975+
entitlement_type: Optional[EntitlementType] = None,
49704976
) -> List[Entitlement]:
49714977
"""|coro|
49724978
@@ -5007,7 +5013,12 @@ async def entitlements(
50075013
"""
50085014
state = self._state
50095015
data = await state.http.get_guild_entitlements(
5010-
self.id, with_sku=with_sku, with_application=with_application, exclude_ended=not include_ended, exclude_deleted=not include_deleted, entitlement_type=int(entitlement_type) if entitlement_type else None
5016+
self.id,
5017+
with_sku=with_sku,
5018+
with_application=with_application,
5019+
exclude_ended=not include_ended,
5020+
exclude_deleted=not include_deleted,
5021+
entitlement_type=int(entitlement_type) if entitlement_type else None,
50115022
)
50125023
return [Entitlement(state=state, data=d) for d in data]
50135024

discord/http.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,7 +3174,10 @@ def get_app_entitlements(
31743174
after: Optional[Snowflake] = None,
31753175
limit: int = 100,
31763176
) -> Response[List[entitlements.Entitlement]]:
3177-
params: Dict[str, Any] = {'exclude_ended': str(exclude_ended).lower(), 'exclude_deleted': str(exclude_deleted).lower()}
3177+
params: Dict[str, Any] = {
3178+
'exclude_ended': str(exclude_ended).lower(),
3179+
'exclude_deleted': str(exclude_deleted).lower(),
3180+
}
31783181
if user_id:
31793182
params['user_id'] = user_id
31803183
if guild_id:
@@ -3237,25 +3240,37 @@ def get_user_app_entitlements(
32373240
)
32383241

32393242
def get_user_entitlements(
3240-
self, with_sku: bool = True, with_application: bool = True, exclude_ended: bool = False, entitlement_type: Optional[int] = None
3243+
self,
3244+
with_sku: bool = True,
3245+
with_application: bool = True,
3246+
exclude_ended: bool = False,
3247+
entitlement_type: Optional[int] = None,
32413248
) -> Response[List[entitlements.Entitlement]]:
3242-
params: Dict[str, Any] = {'with_sku': str(with_sku).lower(), 'with_application': str(with_application).lower(), 'exclude_ended': str(exclude_ended).lower()}
3249+
params: Dict[str, Any] = {
3250+
'with_sku': str(with_sku).lower(),
3251+
'with_application': str(with_application).lower(),
3252+
'exclude_ended': str(exclude_ended).lower(),
3253+
}
32433254
if entitlement_type is not None:
32443255
params['entitlement_type'] = entitlement_type
32453256

32463257
return self.request(Route('GET', '/users/@me/entitlements'), params=params)
32473258

3248-
def get_giftable_entitlements(
3249-
self, country_code: Optional[str] = None
3250-
) -> Response[List[entitlements.Entitlement]]:
3259+
def get_giftable_entitlements(self, country_code: Optional[str] = None) -> Response[List[entitlements.Entitlement]]:
32513260
params = {}
32523261
if country_code:
32533262
params['country_code'] = country_code
32543263

32553264
return self.request(Route('GET', '/users/@me/entitlements/gifts'), params=params)
32563265

32573266
def get_guild_entitlements(
3258-
self, guild_id: Snowflake, with_sku: bool = True, with_application: bool = True, exclude_ended: bool = False, exclude_deleted: bool = True, entitlement_type: Optional[int] = None
3267+
self,
3268+
guild_id: Snowflake,
3269+
with_sku: bool = True,
3270+
with_application: bool = True,
3271+
exclude_ended: bool = False,
3272+
exclude_deleted: bool = True,
3273+
entitlement_type: Optional[int] = None,
32593274
) -> Response[List[entitlements.Entitlement]]:
32603275
params: Dict[str, Any] = {
32613276
'with_sku': str(with_sku).lower(),
@@ -4541,7 +4556,7 @@ def get_oauth2_authorization(
45414556
if state:
45424557
params['state'] = state
45434558
if nonce:
4544-
params['nonce'] = nonce
4559+
params['nonce'] = nonce
45454560

45464561
return self.request(Route('GET', '/oauth2/authorize'), params=params)
45474562

0 commit comments

Comments
 (0)