module Discorb # # Represents a user of discord. class User < Discorb::DiscordModel include Discorb::Messageable # # Initializes a new user. # @private # # @param [Discorb::Client] client The client. # @param [Hash] data The user data. def initialize: (Discorb::Client client, json data) -> void # # Format the user as `Username#Discriminator` style. # # @return [String] The formatted username. %a{pure} def to_s: -> String %a{pure} def inspect: -> String # # Whether the user is a owner of the client. # @async # # @param [Boolean] strict Whether don't allow if the user is a member of the team. # # @return [Async::Task] Whether the user is a owner of the client. def bot_owner?: (?strict: bool) -> Async::Task[bool] # @return [Boolean] Whether the user is verified. attr_reader verified: bool # @return [String] The user's username. attr_reader username: String # @return [Discorb::Snowflake] The user's ID. attr_reader id: Discorb::Snowflake # @return [Discorb::User::Flag] The user's flags. attr_reader flag: Discorb::User::Flag # @return [String] The user's discriminator. attr_reader discriminator: String # @return [Discorb::Asset, Discorb::DefaultAvatar] The user's avatar. attr_reader avatar: Discorb::Asset | Discorb::DefaultAvatar # @return [Boolean] Whether the user is a bot. attr_reader bot: bool alias bot? bot # @return [Time] The time the user was created. attr_reader created_at: Time # @return [String] The user's mention. attr_reader mention: String # # Represents the user's flags. # ## Flag fields # |`1 << 0`|`:staff`| # |`1 << 1`|`:partner`| # |`1 << 2`|`:hypesquad`| # |`1 << 3`|`:bug_hunter_level_1`| # |`1 << 6`|`:hypesquad_online_house_1`| # |`1 << 7`|`:hypesquad_online_house_2`| # |`1 << 8`|`:hypesquad_online_house_3`| # |`1 << 9`|`:premium_early_supporter`| # |`1 << 10`|`:team_psuedo_user`| # |`1 << 14`|`:bug_hunter_level_2`| # |`1 << 16`|`:verified_bot`| # |`1 << 17`|`:verified_developer`| # |`1 << 18`|`:certified_moderator`| # |`1 << 19`|`:bot_http_interactions`| class Flag < Discorb::Flag attr_accessor staff: bool attr_accessor partner: bool attr_accessor hypesquad: bool attr_accessor bug_hunter_level_1: bool attr_accessor hypesquad_online_house_1: bool attr_accessor hypesquad_online_house_2: bool attr_accessor hypesquad_online_house_3: bool attr_accessor premium_early_supporter: bool attr_accessor team_psuedo_user: bool attr_accessor bug_hunter_level_2: bool attr_accessor verified_bot: bool attr_accessor verified_developer: bool attr_accessor certified_moderator: bool attr_accessor bot_http_interactions: bool end end end