DiscordGuildMember

public struct DiscordGuildMember

Represents a guild member.

  • The id of the guild of this member.

    Declaration

    Swift

    public let guildId: GuildID
  • The date this member joined the guild.

    Declaration

    Swift

    public let joinedAt: Date
  • The user object for this member.

    Declaration

    Swift

    public let user: DiscordUser
  • Whether this member has been deafened. Changing this will cause the client to attempt to change the deafen status on Discord.

    Declaration

    Swift

    public var deaf: Bool
  • If this member has a guild object attached, this returns the DiscordRoles for the member. If a guild is unavailable, you can call roles(for:) on this member’s guild directly.

    Declaration

    Swift

    public var roles: [DiscordRole]?

    Return Value

    An Array of DiscordRole or nil if there is no guild attached to this member.

  • Whether this member is muted. Changing this will cause the client to attempt to change the deafen status on Discord.

    Declaration

    Swift

    public var mute: Bool
  • This member’s nickname, if they have one. Changing this value will cause the client to attempt to change the nick on Discord.

    Declaration

    Swift

    public var nick: String?
  • An array of role snowflake ids that this user has.

    Declaration

    Swift

    public var roleIds: [RoleID]
  • The guild this member is on

    Declaration

    Swift

    public internal(set) weak var guild: DiscordGuild?
  • Searches this member for a role with a name that matches.

    • return: Whether or not they have this role.

    Declaration

    Swift

    public func hasRole(_ role: String) -> Bool

    Parameters

    role

    The role’s name to look for.