mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add auto-accept phone calls option
This commit is contained in:
@@ -251,6 +251,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
* `<xiao:disable-leave>` Disables leave messages (Place in the channel you recieve welcome messages in).
|
||||
* `<xiao:phone>` Allows a channel to recieve phone calls from the `phone` command.
|
||||
* `<xiao:phone:auto-accept>` Automatically accepts all incoming phone calls.
|
||||
* `<xiao:phone:no-notice>` Hides the abuse notice from phone call pick-ups.
|
||||
* `<xiao:phone:no-voicemail>` Prevents this channel from recieving voicemails for missed calls.
|
||||
* `<xiao:phone:no-random>` Makes the channel only able to be called directly in the `phone` command, rather than be picked at random.
|
||||
|
||||
@@ -23,6 +23,7 @@ module.exports = class OptionsCommand extends Command {
|
||||
|
||||
__Phone Options__
|
||||
\`<xiao:phone>\` Allows this channel to recieve phone calls.
|
||||
\`<xiao:phone:auto-accept>\` Automatically accepts all incoming phone calls.
|
||||
\`<xiao:phone:no-notice>\` Hides the abuse notice from phone call pick-ups.
|
||||
\`<xiao:phone:no-voicemail>\` Prevents this channel from recieving voicemails for missed calls.
|
||||
\`<xiao:phone:no-random>\` Makes the channel only able to be called directly, rather than picked randomly.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "129.7.0",
|
||||
"version": "129.7.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -30,6 +30,10 @@ module.exports = class PhoneCall {
|
||||
}
|
||||
} else {
|
||||
await this.origin.send(`☎️ Calling **${this.recipient.guild.name} (${this.recipient.id})**...`);
|
||||
if (this.recipient.topic && this.recipient.topic.includes('<xiao:phone:auto-accept>')) {
|
||||
await this.accept();
|
||||
return this;
|
||||
}
|
||||
if (this.originDM) {
|
||||
await this.recipient.send(
|
||||
`☎️ Incoming call from **${this.startUser.tag}'s DM (${this.startUser.id})**. Pick up?`
|
||||
@@ -53,13 +57,19 @@ module.exports = class PhoneCall {
|
||||
this.setTimeout();
|
||||
if (this.adminCall) return this;
|
||||
const usage = this.client.registry.commands.get('hang-up').usage();
|
||||
if (!this.origin.topic.includes('<xiao:phone:no-notice>')) await this.sendNotice(this.origin);
|
||||
if (this.originDM || (this.origin.topic && !this.origin.topic.includes('<xiao:phone:no-notice>'))) {
|
||||
await this.sendNotice(this.origin, this.originDM);
|
||||
}
|
||||
await this.origin.send(`☎️ **${this.recipient.guild.name}** picked up! Use ${usage} to hang up.`);
|
||||
if (this.originDM) {
|
||||
await this.sendNotice(this.recipient, true);
|
||||
if (this.recipient.topic && !this.recipient.topic.includes('<xiao:phone:no-notice>')) {
|
||||
await this.sendNotice(this.recipient);
|
||||
}
|
||||
await this.recipient.send(`☎️ Accepted call from **${this.startUser.tag}'s DM**. Use ${usage} to hang up.`);
|
||||
} else {
|
||||
if (!this.recipient.topic.includes('<xiao:phone:no-notice>')) await this.sendNotice(this.recipient);
|
||||
if (this.recipient.topic && !this.recipient.topic.includes('<xiao:phone:no-notice>')) {
|
||||
await this.sendNotice(this.recipient);
|
||||
}
|
||||
await this.recipient.send(`☎️ Accepted call from **${this.origin.guild.name}**. Use ${usage} to hang up.`);
|
||||
}
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user