Skip to content

Commit 7e5781d

Browse files
authored
Merge pull request #733 from QwireTeam/master
Fix attribute error for ScheduledEventLocation
2 parents 98e4b6a + 18c5391 commit 7e5781d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

discord/audit_logs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ def __init__(self, entry: AuditLogEntry, data: List[AuditLogChangePayload], *, s
254254
if hasattr(self.before, 'location_type'):
255255
from .scheduled_events import ScheduledEventLocation
256256
if self.before.location_type is enums.ScheduledEventLocationType.external:
257-
before = ScheduledEventLocation(state=state, location=before)
257+
before = ScheduledEventLocation(state=state, value=before)
258258
elif hasattr(self.before, 'channel'):
259-
before = ScheduledEventLocation(state=state, location=self.before.channel)
259+
before = ScheduledEventLocation(state=state, value=self.before.channel)
260260

261261
setattr(self.before, attr, before)
262262

@@ -272,9 +272,9 @@ def __init__(self, entry: AuditLogEntry, data: List[AuditLogChangePayload], *, s
272272
if hasattr(self.after, 'location_type'):
273273
from .scheduled_events import ScheduledEventLocation
274274
if self.after.location_type is enums.ScheduledEventLocationType.external:
275-
after = ScheduledEventLocation(state=state, location=after)
275+
after = ScheduledEventLocation(state=state, value=after)
276276
elif hasattr(self.after, 'channel'):
277-
after = ScheduledEventLocation(state=state, location=self.after.channel)
277+
after = ScheduledEventLocation(state=state, value=self.after.channel)
278278

279279
setattr(self.after, attr, after)
280280

discord/guild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,7 @@ async def create_scheduled_event(
32643264
payload["privacy_level"] = int(privacy_level)
32653265

32663266
if not isinstance(location, ScheduledEventLocation):
3267-
location = ScheduledEventLocation(state=self._state, location=location)
3267+
location = ScheduledEventLocation(state=self._state, value=location)
32683268

32693269
payload["entity_type"] = location.type.value
32703270

discord/scheduled_events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ def __init__(self, *, state: ConnectionState, guild: Guild, creator: Optional[Me
200200
entity_metadata = data.get('entity_metadata')
201201
channel_id = data.get('channel_id', None)
202202
if channel_id != None:
203-
self.location = ScheduledEventLocation(state=state, location=int(channel_id))
203+
self.location = ScheduledEventLocation(state=state, value=int(channel_id))
204204
else:
205-
self.location = ScheduledEventLocation(state=state, location=entity_metadata["location"])
205+
self.location = ScheduledEventLocation(state=state, value=entity_metadata["location"])
206206

207207
def __str__(self) -> str:
208208
return self.name
@@ -304,7 +304,7 @@ async def edit(
304304

305305
if location is not MISSING:
306306
if not isinstance(location, (ScheduledEventLocation, utils._MissingSentinel)):
307-
location = ScheduledEventLocation(state=self._state, location=location)
307+
location = ScheduledEventLocation(state=self._state, value=location)
308308

309309
if location.type is ScheduledEventLocationType.external:
310310
payload["channel_id"] = None

0 commit comments

Comments
 (0)