fix(MessagePayload): crash when resolving body (#10454)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
n1ck_pro
2024-08-20 19:04:59 +03:00
committed by GitHub
parent b0f8df0f6c
commit dd795da790

View File

@@ -139,7 +139,7 @@ class MessagePayload {
// If `nonce` isn't provided, generate one & set `enforceNonce`
// Unless `enforceNonce` is explicitly set to `false`(not just falsy)
if (nonce === undefined) {
if (this.options.enforceNonce !== false && this.client.options.enforceNonce) {
if (this.options.enforceNonce !== false && this.target.client.options.enforceNonce) {
nonce = DiscordSnowflake.generate().toString();
enforce_nonce = true;
} else if (enforce_nonce) {