import { MainUser, PrivateChannel, User } from "./discord";

export enum Opcode {
  DISPATCH = 0,
  HEARTBEAT = 1,
  IDENTIFY = 2,
  RECONNECT = 7,
  INVALID_SESSION = 9,
  HELLO = 10,
  HEARTBEAT_ACK = 11,
}

export interface ReadyOp {
  _trace?: string[];
  v: number;
  user: MainUser;
  user_settings: {
    index: number;
    afk_timeout: number;
    allow_accessibility_detection: boolean;
    animate_emoji: boolean;
    animate_stickers: number;
    contact_sync_enabled: boolean;
    convert_emoticons: boolean;
    custom_status: string;
    default_guilds_restricted: boolean;
    detect_platform_accounts: boolean;
    developer_mode: boolean;
    disable_games_tab: boolean;
    enable_tts_command: boolean;
    explicit_content_filter: 0;
    friend_discovery_flags: 0;
    friend_source_flags: {
      all: boolean;
    };
    gateway_connected: boolean;
    gif_auto_play: boolean;
    guild_positions: [];
    inline_attachment_media: boolean;
    inline_embed_media: boolean;
    locale: string;
    message_display_compact: boolean;
    native_phone_integration_enabled: boolean;
    render_embeds: boolean;
    render_reactions: boolean;
    restricted_guilds: [];
    show_current_game: boolean;
    status: string;
    stream_notifications_enabled: boolean;
    theme: string;
    timezone_offset: number;
    view_nsfw_guilds: boolean;
  };
  //guilds: guildjson[];
  /*relationships: {
    id: string;
    type: 0 | 1 | 2 | 3 | 4;
    nickname: string | null;
    user: userjson;
  }[];*/
  read_state: {
    entries: {
      id: string;
      channel_id: string;
      last_message_id: string;
      last_pin_timestamp: string;
      mention_count: number;
    }[];
    partial: boolean;
    version: number;
  };
  /*user_guild_settings: {
    entries: GuildOverrides[];
    partial: boolean;
    version: number;
  };*/
  private_channels: PrivateChannel[];
  session_id: string;
  country_code: string;
  users: User[];
  //merged_members: [memberjson][];
  sessions: {
    active: boolean;
    activities: []; //will need to find example of this
    client_info: {
      version: number;
    };
    session_id: string;
    status: string;
  }[];
  resume_gateway_url: string;
  consents: {
    personalization: {
      consented: boolean;
    };
  };
  experiments: []; //not sure if I need to do this :P
  guild_join_requests: []; //need to get examples
  connected_accounts: []; //need to get examples
  guild_experiments: []; //need to get examples
  geo_ordered_rtc_regions: []; //need to get examples
  api_code_version: number;
  friend_suggestion_count: number;
  analytics_token: string;
  tutorial: boolean;
  session_type: string;
  auth_session_id_hash: string;
  notification_settings: {
    flags: number;
  };
}