forked from Galactic/galactic-bot
bugfixes
This commit is contained in:
parent
487e533089
commit
37d69f315e
@ -137,7 +137,7 @@ module.exports = class AutoModeration extends Observer {
|
|||||||
|
|
||||||
if (!enabled || roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return;
|
if (!enabled || roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return;
|
||||||
|
|
||||||
const missing = channel.permissionsFor(this.client.user).missing('ManageMessages');
|
const missing = channel.permissionsFor(this.client.user)?.missing('ManageMessages') || [];
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'word', permissions: missing });
|
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'word', permissions: missing });
|
||||||
return;
|
return;
|
||||||
@ -440,7 +440,7 @@ module.exports = class AutoModeration extends Observer {
|
|||||||
|
|
||||||
if (roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return;
|
if (roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return;
|
||||||
|
|
||||||
const missing = channel.permissionsFor(this.client.user).missing('ManageMessages');
|
const missing = channel.permissionsFor(this.client.user)?.missing('ManageMessages') || [];
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'link', permissions: missing });
|
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'link', permissions: missing });
|
||||||
return;
|
return;
|
||||||
@ -567,7 +567,7 @@ module.exports = class AutoModeration extends Observer {
|
|||||||
|
|
||||||
if (roles.some((r) => bypass?.includes(r)) || ignore?.includes(channel.id)) return;
|
if (roles.some((r) => bypass?.includes(r)) || ignore?.includes(channel.id)) return;
|
||||||
|
|
||||||
const missing = channel.permissionsFor(this.client.user).missing('ManageMessages');
|
const missing = channel.permissionsFor(this.client.user)?.missing('ManageMessages') || [];
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'invite', permissions: missing });
|
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'invite', permissions: missing });
|
||||||
return;
|
return;
|
||||||
@ -626,7 +626,7 @@ module.exports = class AutoModeration extends Observer {
|
|||||||
|
|
||||||
if (!enabled || roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return;
|
if (!enabled || roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return;
|
||||||
|
|
||||||
const missing = channel.permissionsFor(this.client.user).missing('ManageMessages');
|
const missing = channel.permissionsFor(this.client.user)?.missing('ManageMessages') || [];
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'mention', permissions: missing });
|
this.client.emit('filterMissingPermissions', { channel, guild: wrapper, filter: 'mention', permissions: missing });
|
||||||
return;
|
return;
|
||||||
|
@ -110,7 +110,8 @@ class MuteInfraction extends Infraction {
|
|||||||
&& c.infraction.target === this.target.id).first();
|
&& c.infraction.target === this.target.id).first();
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
this.data.removedRoles = [...new Set([...this.data.removedRoles, ...callback.infraction.data.removedRoles])];
|
if (!this.data.removedRoles) this.data.removedRoles = [];
|
||||||
|
this.data.removedRoles = [...new Set([...this.data.removedRoles, ...callback.infraction.data.removedRoles||[]])];
|
||||||
this.client.moderationManager.removeCallback(callback.infraction, true);
|
this.client.moderationManager.removeCallback(callback.infraction, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user