Don't say "Sent to Voicemail" when it wasn't

This commit is contained in:
Dragon Fire
2020-05-19 20:46:12 -04:00
parent 02bdd38ae8
commit 65ae1446a8
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -47,9 +47,11 @@ module.exports = class PhoneCall {
await this.origin.send('☎️ Call ended due to inactivity.');
await this.recipient.send('☎️ Call ended due to inactivity.');
} else if (nonQuitter === 'declined') {
const recipientMsg = validation === 0 ? 'Sent to voicemail.' : 'Declined the call.';
await this.recipient.send(`☎️ ${recipientMsg}`);
const canVoicemail = this.recipient.topic && !this.recipient.topic.includes('<xiao:phone:no-voicemail>');
const recipientMsg = validation === 0
? canVoicemail ? 'Sent to voicemail.' : 'Missed the call.'
: 'Declined the call.';
await this.recipient.send(`☎️ ${recipientMsg}`);
if (validation === 0 && canVoicemail) {
await this.origin.send(`☎️ **${this.recipient.guild.name}** didn't answer... Leave a voicemail?`);
const voicemailValidation = await verify(this.origin, null);