forked from Galactic/galactic-bot
update to pascalcase
This commit is contained in:
parent
585dd6a4af
commit
2964dc24e5
@ -24,7 +24,7 @@ class AuditLogObserver extends Observer {
|
|||||||
async guildBanAdd({ guild, user, guildWrapper: wrapper }) {
|
async guildBanAdd({ guild, user, guildWrapper: wrapper }) {
|
||||||
const settings = await wrapper.settings();
|
const settings = await wrapper.settings();
|
||||||
if (!settings.moderation.channel || !settings.moderation.infractions.includes('BAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
|
if (!settings.moderation.channel || !settings.moderation.infractions.includes('BAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
|
||||||
const audit = await this._fetchFirstEntry(guild, user, 'MEMBER_BAN_ADD');
|
const audit = await this._fetchFirstEntry(guild, user, 'MemberBanAdd');
|
||||||
if (!audit) return undefined;
|
if (!audit) return undefined;
|
||||||
new Infraction(this.client, {
|
new Infraction(this.client, {
|
||||||
type: 'BAN',
|
type: 'BAN',
|
||||||
@ -39,7 +39,7 @@ class AuditLogObserver extends Observer {
|
|||||||
async guildBanRemove({ guild, user, guildWrapper: wrapper }) {
|
async guildBanRemove({ guild, user, guildWrapper: wrapper }) {
|
||||||
const settings = await wrapper.settings();
|
const settings = await wrapper.settings();
|
||||||
if (!settings.moderation.channel || !settings.moderation.infractions.includes('UNBAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
|
if (!settings.moderation.channel || !settings.moderation.infractions.includes('UNBAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
|
||||||
const audit = await this._fetchFirstEntry(guild, user, 'MEMBER_BAN_REMOVE');
|
const audit = await this._fetchFirstEntry(guild, user, 'MemberBanRemove');
|
||||||
if (!audit) return undefined;
|
if (!audit) return undefined;
|
||||||
new Infraction(this.client, {
|
new Infraction(this.client, {
|
||||||
type: 'UNBAN',
|
type: 'UNBAN',
|
||||||
@ -55,7 +55,7 @@ class AuditLogObserver extends Observer {
|
|||||||
const { guildWrapper: wrapper } = member;
|
const { guildWrapper: wrapper } = member;
|
||||||
const settings = await wrapper.settings();
|
const settings = await wrapper.settings();
|
||||||
if (!settings.moderation.channel || !settings.moderation.infractions.includes('KICK')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
|
if (!settings.moderation.channel || !settings.moderation.infractions.includes('KICK')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
|
||||||
const audit = await this._fetchFirstEntry(member.guild, member.user, 'MEMBER_KICK');
|
const audit = await this._fetchFirstEntry(member.guild, member.user, 'MemberKick');
|
||||||
if (!audit) return undefined;
|
if (!audit) return undefined;
|
||||||
new Infraction(this.client, {
|
new Infraction(this.client, {
|
||||||
type: 'KICK',
|
type: 'KICK',
|
||||||
@ -83,7 +83,7 @@ class AuditLogObserver extends Observer {
|
|||||||
// console.log(oldMember.communicationDisabledUntilTimestamp, newMember.communicationDisabledUntilTimestamp);
|
// console.log(oldMember.communicationDisabledUntilTimestamp, newMember.communicationDisabledUntilTimestamp);
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const mute = newMember.communicationDisabledUntilTimestamp !== null;
|
const mute = newMember.communicationDisabledUntilTimestamp !== null;
|
||||||
const entry = await this._fetchFirstEntry(wrapper, newMember.user, 'MEMBER_UPDATE', 'communication_disabled_until');
|
const entry = await this._fetchFirstEntry(wrapper, newMember.user, 'MemberUpdate', 'communication_disabled_until');
|
||||||
|
|
||||||
// const entry = auditLogs.entries.find((e) => e.changes?.some((e) => e.key === 'communication_disabled_until'));
|
// const entry = auditLogs.entries.find((e) => e.changes?.some((e) => e.key === 'communication_disabled_until'));
|
||||||
if (!entry) return undefined; // || newMember.communicationDisabledUntilTimestamp < now
|
if (!entry) return undefined; // || newMember.communicationDisabledUntilTimestamp < now
|
||||||
@ -122,7 +122,7 @@ class AuditLogObserver extends Observer {
|
|||||||
|
|
||||||
const mutedRole = settings.mute.role;
|
const mutedRole = settings.mute.role;
|
||||||
if (!mutedRole) return undefined;
|
if (!mutedRole) return undefined;
|
||||||
const audit = await this._fetchFirstEntry(newMember.guild, newMember.user, 'MEMBER_ROLE_UPDATE');
|
const audit = await this._fetchFirstEntry(newMember.guild, newMember.user, 'MemberRoleUpdate');
|
||||||
if (!audit) return undefined;
|
if (!audit) return undefined;
|
||||||
let type = null;
|
let type = null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user