fromMap static method

Future<PrivateDialogContext> fromMap(
  1. MarshallerContract marshaller,
  2. Map<String, dynamic> payload
)

Implementation

static Future<PrivateDialogContext> fromMap(
    MarshallerContract marshaller, Map<String, dynamic> payload) async {
  return PrivateDialogContext(
    customId: payload['data']['custom_id'],
    id: Snowflake(payload['id']),
    applicationId: Snowflake(payload['application_id']),
    token: payload['token'],
    version: payload['version'],
    user: await marshaller.serializers.user.serialize(payload['user']),
  );
}