mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add blocking of users fully from phone
This commit is contained in:
@@ -52,6 +52,15 @@ module.exports = class XiaoClient extends CommandoClient {
|
||||
return this.phone.some(call => call.origin.id === channel.id || call.recipient.id === channel.id);
|
||||
}
|
||||
|
||||
isBlockedFromPhone(origin, recipient, caller) {
|
||||
return !recipient.topic.includes(`<xiao:phone:block:${origin.channel.id}>`)
|
||||
&& !recipient.topic.includes(`<xiao:phone:block:${caller.id}>`)
|
||||
&& (origin.guild ? !recipient.topic.includes(`<xiao:phone:block:${origin.guild.id}>`) : true)
|
||||
&& (origin.guild ? !origin.topic.includes(`<xiao:phone:block:${recipient.channel.id}>`) : true)
|
||||
&& (origin.guild ? !origin.topic.includes(`<xiao:phone:block:${recipient.guild.id}>`) : true)
|
||||
&& (origin.guild ? !origin.topic.includes(`<xiao:phone:block:${caller.id}>`) : true);
|
||||
}
|
||||
|
||||
importCommandLeaderboard() {
|
||||
const read = fs.readFileSync(path.join(__dirname, '..', 'command-leaderboard.json'), {
|
||||
encoding: 'utf8'
|
||||
|
||||
Reference in New Issue
Block a user