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. def to_s: -> String 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`|`:discord_employee`| # |`1 << 1`|`:partnered_server_owner`| # |`1 << 2`|`:hypesquad_events`| # |`1 << 3`|`:bug_hunter_level_1`| # |`1 << 6`|`:house_bravery`| # |`1 << 7`|`:house_brilliance`| # |`1 << 8`|`:house_balance`| # |`1 << 9`|`:early_supporter`| # |`1 << 10`|`:team_user`| # |`1 << 14`|`:bug_hunter_level_2`| # |`1 << 16`|`:verified_bot`| # |`1 << 17`|`:early_verified_bot_developer`| # |`1 << 18`|`:discord_certified_moderator`| class Flag < Discorb::Flag attr_accessor discord_employee: bool attr_accessor partnered_server_owner: bool attr_accessor hypesquad_events: bool attr_accessor bug_hunter_level_1: bool attr_accessor house_bravery: bool attr_accessor house_brilliance: bool attr_accessor house_balance: bool attr_accessor early_supporter: bool attr_accessor team_user: bool attr_accessor bug_hunter_level_2: bool attr_accessor verified_bot: bool attr_accessor early_verified_bot_developer: bool attr_accessor discord_certified_moderato: bool end end end