Skip to content

Commit 0b79131

Browse files
authored
feat: global_name user parameter (#28)
1 parent 101eaeb commit 0b79131

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/DiscordKitCore/Objects/Data/User.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ public struct User: Codable, GatewayData, Identifiable, Equatable {
1212
}
1313

1414
// To work around the default access level
15-
public init(id: Snowflake, username: String, discriminator: String, avatar: HashedAsset?, bot: Bool?, bio: String?, system: Bool?, mfa_enabled: Bool?, banner: HashedAsset?, accent_color: Int?, locale: Locale?, verified: Bool?, flags: User.Flags?, premium_type: PremiumType?, public_flags: User.Flags?) {
15+
public init(id: Snowflake, username: String, discriminator: String, global_name: String?, avatar: HashedAsset?, bot: Bool?, bio: String?, system: Bool?, mfa_enabled: Bool?, banner: HashedAsset?, accent_color: Int?, locale: Locale?, verified: Bool?, flags: User.Flags?, premium_type: PremiumType?, public_flags: User.Flags?) {
1616
self.id = id
1717
self.username = username
1818
self.discriminator = discriminator
19+
self.global_name = global_name
1920
self.avatar = avatar
2021
self.bot = bot
2122
self.bio = bio
@@ -40,6 +41,9 @@ public struct User: Codable, GatewayData, Identifiable, Equatable {
4041
///
4142
/// A string in the format #0000
4243
public let discriminator: String
44+
45+
/// User's Global Name
46+
public let global_name: String?
4347

4448
/// User's avatar hash
4549
public let avatar: HashedAsset?
@@ -109,6 +113,9 @@ public struct CurrentUser: Codable, GatewayData, Equatable {
109113
///
110114
/// A string in the format #0000
111115
public let discriminator: String
116+
117+
/// Global Name of this user
118+
public let global_name: String?
112119

113120
/// The flags of this user
114121
///
@@ -197,6 +204,7 @@ public extension User {
197204
id: user.id,
198205
username: user.username,
199206
discriminator: user.discriminator,
207+
global_name: user.global_name,
200208
avatar: user.avatar,
201209
bot: false,
202210
bio: user.bio,

0 commit comments

Comments
 (0)