DiscordVoiceState.fromJson constructor

DiscordVoiceState.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DiscordVoiceState.fromJson(Map<String, dynamic> json) =>
    DiscordVoiceState(
      guildId: json[guildIdEntry] != null
          ? DiscordSnowflake(json[guildIdEntry] as String)
          : null,
      channelId: json[channelIdEntry] != null
          ? DiscordSnowflake(json[channelIdEntry] as String)
          : null,
      userId: DiscordSnowflake(json[userIdEntry] as String),
      member: json[memberEntry] != null
          ? DiscordGuildMember.fromJson(
              json[memberEntry] as Map<String, dynamic>,
            )
          : null,
      sessionId: json[sessionIdEntry] as String,
      deaf: json[deafEntry] as bool,
      muted: json[mutedEntry] as bool,
      selfDeaf: json[selfDeafEntry] as bool,
      selfMuted: json[selfMutedEntry] as bool,
      selfStream: json[selfStreamEntry] as bool?,
      selfVideo: json[selfVideoEntry] as bool,
      suppress: json[suppressEntry] as bool,
      requestToSpeakTimestamp: json[requestToSpeakTimestampEntry] as String?,
    );