mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 00:06:42 +02:00
Add phone call abuse notice
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: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.
|
||||
* `<xiao:phone:block:INSERTIDHERE>` Blocks a channel or server from contacting the channel via phone.
|
||||
|
||||
@@ -23,6 +23,7 @@ module.exports = class OptionsCommand extends Command {
|
||||
|
||||
__Phone Options__
|
||||
\`<xiao:phone>\` Allows this channel to recieve 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.
|
||||
\`<xiao:phone:block:INSERTIDHERE>\` Blocks a channel or server from contacting you via phone.
|
||||
|
||||
@@ -53,10 +53,13 @@ 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);
|
||||
await this.origin.send(`☎️ **${this.recipient.guild.name}** picked up! Use ${usage} to hang up.`);
|
||||
if (this.originDM) {
|
||||
await this.sendNotice(this.recipient, true);
|
||||
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);
|
||||
await this.recipient.send(`☎️ Accepted call from **${this.origin.guild.name}**. Use ${usage} to hang up.`);
|
||||
}
|
||||
return this;
|
||||
@@ -162,4 +165,14 @@ module.exports = class PhoneCall {
|
||||
str = preventURLEmbeds(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
sendNotice(channel, dm) {
|
||||
const reportUsage = this.client.registry.commands.get('report').usage('abuse <reason>');
|
||||
return channel.send(stripIndents`
|
||||
⚠️ **Notice:** ⚠️
|
||||
Sending illegal, NSFW, obscene, or hateful content can result in you and your server being banned from Xiao.
|
||||
To report abuse, use ${reportUsage} (please include IDs and user tags).
|
||||
${dm ? '' : 'To hide this notice, place `<xiao:phone:no-notice>` in your channel topic.'}
|
||||
`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user