From d39f17925d1bc9a5f25adbc2f52f7807c4e8b163 Mon Sep 17 00:00:00 2001 From: Gryffon Bellish Date: Tue, 19 Nov 2019 15:54:35 -0500 Subject: [PATCH] fix(Invite): fix valueOf returning undefined (#3582) * Update Invite.js * Fix typings * Fix ESLint errors --- src/structures/Invite.js | 4 ++++ typings/index.d.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/structures/Invite.js b/src/structures/Invite.js index d5e9f895d..4d048b3f1 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -183,6 +183,10 @@ class Invite extends Base { guild: 'guildID', }); } + + valueOf() { + return this.code; + } } module.exports = Invite; diff --git a/typings/index.d.ts b/typings/index.d.ts index 1da0d9d2d..3cae781a9 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -878,6 +878,7 @@ declare module 'discord.js' { public setNickname(nickname: string, reason?: string): Promise; public toJSON(): object; public toString(): string; + public valueOf(): string; } export class Integration extends Base {