From 93c02f18022fcfb5ff64e76117aa5cef9730e6e6 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 19 May 2020 14:12:23 -0400 Subject: [PATCH] Fix --- structures/phone/PhoneCall.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/structures/phone/PhoneCall.js b/structures/phone/PhoneCall.js index cc9e4cea..37bd199e 100644 --- a/structures/phone/PhoneCall.js +++ b/structures/phone/PhoneCall.js @@ -42,7 +42,6 @@ module.exports = class PhoneCall { async hangup(nonQuitter, validation) { this.active = false; clearTimeout(this.timeout); - this.client.phone.delete(this.id); if (nonQuitter === 'time') { await this.origin.send('☎️ Call ended due to inactivity.'); await this.recipient.send('☎️ Call ended due to inactivity.'); @@ -65,7 +64,7 @@ module.exports = class PhoneCall { await this.origin.send('☎️ No voicemail will be left.'); } else { const voicemailMsg = voicemail.first(); - await this.sendVoicemail(this.recipient, voicemailMsg.author, voicemailMsg.content); + await this.sendVoicemail(this.recipient, voicemailMsg); await this.origin.send('☎️ Your voicemail has been left.'); } } @@ -78,6 +77,7 @@ module.exports = class PhoneCall { await nonQuitter.send(`☎️ **${quitter.guild.name}** hung up.`); await quitter.send('☎️ Hung up.'); } + this.client.phone.delete(this.id); return this; } @@ -105,11 +105,11 @@ module.exports = class PhoneCall { return channel.send(`☎️ **${msg.author.tag}:** ${content}\n${attachments || ''}`.trim()); } - sendVoicemail(channel, author, message) { + sendVoicemail(channel, msg) { if (!channel.topic || channel.topic.includes('')) return null; return channel.send(stripInvites` - ☎️ New Voicemail from **${channel.guild.name}**: - **${author.tag}:** ${message} + ☎️ New Voicemail from **${msg.guild.name}**: + **${msg.author.tag}:** ${msg.content} `); }