Skip to content

Member.joined_at is now nullable due to breaking API change #1811

@hypergonial

Description

@hypergonial

Steps to reproduce

  1. Invite guest via guest invite
  2. Try deserializing the incoming events that contain the member (VOICE_STATE_UPDATE is definitely affected, unsure about the rest)
  3. Bot explod

Expected result

Bot not explod

Actual result

Bot explod

TypeError: argument must be str
E 2024-01-20 01:05:35,693 asyncio: Exception occurred in raw event dispatch conduit
task: <Task pending name='dispatch VOICE_STATE_UPDATE' coro=<EventManagerBase._handle_dispatch() running at \hikari\impl\event_manager_base.py:609>>
Traceback (most recent call last):
  File "\hikari\impl\event_manager_base.py", line 602, in _handle_dispatch
    await consumer.callback(shard, payload)
  File "\hikari\impl\event_manager.py", line 810, in on_voice_state_update
    event = self._event_factory.deserialize_voice_state_update_event(shard, payload, old_state=old)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\hikari\impl\event_factory.py", line 919, in deserialize_voice_state_update_event
    state = self._app.entity_factory.deserialize_voice_state(payload)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\hikari\impl\entity_factory.py", line 3598, in deserialize_voice_state
    member = self.deserialize_member(payload["member"], guild_id=guild_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\hikari\impl\entity_factory.py", line 1809, in deserialize_member
    joined_at = time.iso8601_datetime_string_to_datetime(payload["joined_at"])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Further info

The joined_at field is now nullable, according to this PR on the DAPI docs:

discord/discord-api-docs#6247

This seems to only affect VOICE_STATE_UPDATE for now(?)

Checklist

  • I have made sure to remove ANY sensitive information (bot token, passwords, credentials, personal details, etc.).
  • I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions