<commit_before>require "./converters"

module Discord
  struct Message
    JSON.mapping(
      type: {type: UInt8, nilable: true},
      content: String,
      id: {type: UInt64, converter: SnowflakeConverter},
      channel_id: {type: UInt64, converter: SnowflakeConverter},
      author: User,
      timestamp: {type: Time, converter: Time::Format::ISO_8601_DATE},
      tts: Bool,
      mention_everyone: Bool,
      mentions: Array(User),
      mention_roles: {type: Array(UInt64), converter: SnowflakeArrayConverter},
      attachments: Array(Attachment),
      embeds: Array(Embed),
      nonce: {type: UInt64?, converter: MaybeSnowflakeConverter},
      pinned: {type: Bool, nilable: true}
    )
  end

  struct Channel
    JSON.mapping(
      id: {type: UInt64, converter: SnowflakeConverter},
      type: UInt8,
      guild_id: {type: UInt64?, converter: MaybeSnowflakeConverter},
      name: {type: String, nilable: true},
      is_private: {type: Bool, nilable: true},
      permission_overwrites: {type: Array(Overwrite), nilable: true},
      topic: {type: String, nilable: true},
      last_message_id: {type: UInt64?, converter: MaybeSnowflakeConverter},
      bitrate: {type: UInt32, nilable: true},
      user_limit: {type: UInt32, nilable: true},
      recipients: {type: Array(User), nilable: true}
    )
  end

  struct PrivateChannel
    JSON.mapping(
      id: {type: UInt64, converter: SnowflakeConverter},
      type: UInt8,
      recipients: Array(User),
      last_message_id: UInt64
    )
  end

  struct Overwrite
    JSON.mapping(
      id: {type: UInt64, converter: SnowflakeConverter},
      type: String,<commit_msg>Fix the last_message_id typing in PrivateChannel<commit_after>require "./converters"

module Discord
  struct Message
    JSON.mapping(
      type: {type: UInt8, nilable: true},
      content: String,
      id: {type: UInt64, converter: SnowflakeConverter},
      channel_id: {type: UInt64, converter: SnowflakeConverter},
      author: User,
      timestamp: {type: Time, converter: Time::Format::ISO_8601_DATE},
      tts: Bool,
      mention_everyone: Bool,
      mentions: Array(User),
      mention_roles: {type: Array(UInt64), converter: SnowflakeArrayConverter},
      attachments: Array(Attachment),
      embeds: Array(Embed),
      nonce: {type: UInt64?, converter: MaybeSnowflakeConverter},
      pinned: {type: Bool, nilable: true}
    )
  end

  struct Channel
    JSON.mapping(
      id: {type: UInt64, converter: SnowflakeConverter},
      type: UInt8,
      guild_id: {type: UInt64?, converter: MaybeSnowflakeConverter},
      name: {type: String, nilable: true},
      is_private: {type: Bool, nilable: true},
      permission_overwrites: {type: Array(Overwrite), nilable: true},
      topic: {type: String, nilable: true},
      last_message_id: {type: UInt64?, converter: MaybeSnowflakeConverter},
      bitrate: {type: UInt32, nilable: true},
      user_limit: {type: UInt32, nilable: true},
      recipients: {type: Array(User), nilable: true}
    )
  end

  struct PrivateChannel
    JSON.mapping(
      id: {type: UInt64, converter: SnowflakeConverter},
      type: UInt8,
      recipients: Array(User),
      last_message_id: {type: UInt64?, converter: MaybeSnowflakeConverter}
    )
  end

  struct Overwrite
    JSON.mapping(
      id: {type: UInt64, converter: SnowflakeConverter},
      type: String,
{'fraction_non_alphanumeric': 0.11611374407582939, 'fraction_numerical': 0.018364928909952605, 'mean_word_length': 3.41437908496732, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1344764', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1080, 'n_words': 283}