fromMap static method

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

Implementation

static Future<ServerDialogContext> fromMap(
    MarshallerContract marshaller, Map<String, dynamic> payload) async {
  return ServerDialogContext(
    customId: payload['data']['custom_id'],
    id: Snowflake(payload['id']),
    applicationId: Snowflake(payload['application_id']),
    token: payload['token'],
    version: payload['version'],
    member: await marshaller.dataStore.member.getMember(
      serverId: Snowflake(payload['guild_id']),
      memberId: Snowflake(payload['member']['user']['id']),
    ),
  );
}