Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
Add nonce to message
Browse files Browse the repository at this point in the history
  • Loading branch information
Azoy committed Jun 14, 2017
1 parent da6ec0d commit 17f21f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Sword/Types/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public struct Message {
/// Array of Roles that were mentioned
public internal(set) var mentionedRoles = [Snowflake]()

/// Used to validate a message was sent
public let nonce: Snowflake?

/// Array of reactions with message
public internal(set) var reactions = [[String: Any]]()

Expand Down Expand Up @@ -130,6 +133,8 @@ public struct Message {

self.mentionedRoles = (json["mention_roles"] as! [String]).map { Snowflake($0)! }

self.nonce = Snowflake(json["nonce"] as? String)

if let reactions = json["reactions"] as? [[String: Any]] {
self.reactions = reactions
}
Expand Down

0 comments on commit 17f21f2

Please sign in to comment.