mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 05:51:42 +02:00
Fix
This commit is contained in:
@@ -42,7 +42,6 @@ module.exports = class PhoneCall {
|
|||||||
async hangup(nonQuitter, validation) {
|
async hangup(nonQuitter, validation) {
|
||||||
this.active = false;
|
this.active = false;
|
||||||
clearTimeout(this.timeout);
|
clearTimeout(this.timeout);
|
||||||
this.client.phone.delete(this.id);
|
|
||||||
if (nonQuitter === 'time') {
|
if (nonQuitter === 'time') {
|
||||||
await this.origin.send('☎️ Call ended due to inactivity.');
|
await this.origin.send('☎️ Call ended due to inactivity.');
|
||||||
await this.recipient.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.');
|
await this.origin.send('☎️ No voicemail will be left.');
|
||||||
} else {
|
} else {
|
||||||
const voicemailMsg = voicemail.first();
|
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.');
|
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 nonQuitter.send(`☎️ **${quitter.guild.name}** hung up.`);
|
||||||
await quitter.send('☎️ Hung up.');
|
await quitter.send('☎️ Hung up.');
|
||||||
}
|
}
|
||||||
|
this.client.phone.delete(this.id);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,11 +105,11 @@ module.exports = class PhoneCall {
|
|||||||
return channel.send(`☎️ **${msg.author.tag}:** ${content}\n${attachments || ''}`.trim());
|
return channel.send(`☎️ **${msg.author.tag}:** ${content}\n${attachments || ''}`.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
sendVoicemail(channel, author, message) {
|
sendVoicemail(channel, msg) {
|
||||||
if (!channel.topic || channel.topic.includes('<xiao:phone:no-voicemail>')) return null;
|
if (!channel.topic || channel.topic.includes('<xiao:phone:no-voicemail>')) return null;
|
||||||
return channel.send(stripInvites`
|
return channel.send(stripInvites`
|
||||||
☎️ New Voicemail from **${channel.guild.name}**:
|
☎️ New Voicemail from **${msg.guild.name}**:
|
||||||
**${author.tag}:** ${message}
|
**${msg.author.tag}:** ${msg.content}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user