mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 14:55:40 +02:00
Add phone call abuse notice
This commit is contained in:
@@ -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