mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat(Message): added string type for message nonce (#4782)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -151,8 +151,11 @@ class APIMessage {
|
||||
|
||||
let nonce;
|
||||
if (typeof this.options.nonce !== 'undefined') {
|
||||
nonce = parseInt(this.options.nonce);
|
||||
if (isNaN(nonce) || nonce < 0) throw new RangeError('MESSAGE_NONCE_TYPE');
|
||||
nonce = this.options.nonce;
|
||||
// eslint-disable-next-line max-len
|
||||
if (typeof nonce === 'number' ? !Number.isInteger(nonce) : typeof nonce !== 'string') {
|
||||
throw new RangeError('MESSAGE_NONCE_TYPE');
|
||||
}
|
||||
}
|
||||
|
||||
const embedLikes = [];
|
||||
|
||||
Reference in New Issue
Block a user