Skip to content

Commit

Permalink
fix: prevent blacklisted users from messaging in calls (#276)
Browse files Browse the repository at this point in the history
* fix: prevent blacklisted users from messaging in calls

* await
  • Loading branch information
Rexogamer authored Mar 8, 2021
1 parent b2a45f1 commit 1875554
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Commands/Support/blacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async(client, msg, suffix) => {

client.log(`:wrench: ID \`${target}\` has been removed from the blacklist by \`${msg.author.tag}\`.`);
if (!silent && dmChannel) {
dmChannel.send({ embed: { color: config.colors.info, title: "You've been pardoned", description: "You have been removed from the blacklist.\nYour record, however, has not be cleansed. Meaning any violation will put you back on the blacklist." } })
dmChannel.send({ embed: { color: config.colors.info, title: "You've been pardoned", description: "You have been removed from the blacklist.\nHowever, your strikes have not been cleared, meaning any violation will put you back on the blacklist." } })
.catch(e => null);
}
return msg.channel.send({ embed: {
Expand All @@ -54,7 +54,7 @@ module.exports = async(client, msg, suffix) => {

client.log(`:hammer: ID \`${target}\` has been added to the blacklist by \`${msg.author.tag}\`.`);
if (!silent && dmChannel) {
dmChannel.send({ embed: { color: config.colors.error, title: "You've been blacklisted", description: "This means you can no longer use DTel.\n\nIf you feel like this action was unjust, you can dispute it with one of the bosses in the support server." } })
dmChannel.send({ embed: { color: config.colors.error, title: "You've been blacklisted", description: "This means you can no longer use DTel.\n\nIf you feel like this action was unfair, you can dispute it with one of the bosses in the support server. (Don't try calling 611, as you can't use the bot.) If you evade this blacklist with an alternate account, we will ignore your appeals." } })
.catch(e => null);
}
return msg.channel.send({ embed: {
Expand Down
3 changes: 3 additions & 0 deletions Internals/callHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = async(cmd, msg, suffix, call) => {
// Send hidden?
let hidden = toSendSupport ? false : fromSend.hidden;

// ignore messages from blacklisted users
if (await msg.author.blacklisted) return;

// get right phone
let phone = config.callPhones.default;
if (fromvip) phone = config.callPhones.donator;
Expand Down

0 comments on commit 1875554

Please sign in to comment.