Skip to content

Commit

Permalink
fix: update packages, fix auditlogChecks function
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklvh committed Dec 19, 2023
1 parent 7607f13 commit f2d3a2d
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 175 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ OAUTH_SECRET=
OAUTH_REDIRECT=
OAUTH_COOKIE=
API_PORT=3000
API_ORIGIN=
API_PREFIX=
API_ORIGIN=*
API_PREFIX=/api/v1

# DATABASE
DATABASE_URL=postgresql://user:pass@host:port/dbname
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Environment variables
.env.development.local
.env.production.local
.env
.env.development

node_modules
dist
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@
"#types/*": "./dist/lib/types/*.js"
},
"dependencies": {
"@prisma/client": "^5.6.0",
"@sapphire/decorators": "^6.0.2",
"@sapphire/discord.js-utilities": "^7.1.2",
"@sapphire/fetch": "^3.0.0",
"@sapphire/framework": "^5.0.0",
"@sapphire/plugin-api": "^6.0.0",
"@sapphire/plugin-logger": "^3.0.7",
"@sapphire/ratelimits": "^2.4.7",
"@sapphire/time-utilities": "^1.7.10",
"@sapphire/utilities": "^3.13.0",
"@skyra/env-utilities": "^1.2.1",
"@prisma/client": "^5.7.1",
"@sapphire/decorators": "^6.0.3",
"@sapphire/discord.js-utilities": "^7.1.4",
"@sapphire/fetch": "^3.0.1",
"@sapphire/framework": "^5.0.4",
"@sapphire/plugin-api": "^6.0.1",
"@sapphire/plugin-logger": "^4.0.1",
"@sapphire/ratelimits": "^2.4.8",
"@sapphire/time-utilities": "^1.7.11",
"@sapphire/utilities": "^3.14.0",
"@skyra/env-utilities": "^1.2.2",
"discord.js": "^14.14.1"
},
"devDependencies": {
"@sapphire/eslint-config": "^5.0.2",
"@sapphire/eslint-config": "^5.0.3",
"@sapphire/ts-config": "^5.0.0",
"@types/node": "^20.10.0",
"prisma": "^5.6.0",
"typescript": "^5.3.2"
"@types/node": "^20.10.5",
"prisma": "^5.7.1",
"typescript": "^5.3.3"
},
"packageManager": "[email protected]",
"_moduleAliases": {
Expand Down
3 changes: 2 additions & 1 deletion src/listeners/guild/messageDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { EmbedBuilder, type Message } from 'discord.js';
})
export class MessageDeleteListener extends Listener {
public async run(message: Message<true>) {
if (message.author.bot) return;
const channel = await this.container.utils.auditlogChecks(message.guild);
if (!channel) return;

if (message.author.bot) return;

const embed = new EmbedBuilder()
.setAuthor({
name: `Message Deleted | ${message.author.tag}`,
Expand Down
6 changes: 4 additions & 2 deletions src/listeners/guild/messageUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { auditlogChecks } from '#classes/Utils';
import { ApplyOptions } from '@sapphire/decorators';
import { Events, Listener } from '@sapphire/framework';
import { EmbedBuilder, type Message } from 'discord.js';
Expand All @@ -7,11 +8,12 @@ import { EmbedBuilder, type Message } from 'discord.js';
})
export class MessageUpdateListener extends Listener {
public async run(oldMessage: Message<true>, newMessage: Message<true>) {
const channel = await auditlogChecks(oldMessage.guild);
if (!channel) return;

if (oldMessage.content === newMessage.content || oldMessage.author.bot)
return;

const channel = await this.container.utils.auditlogChecks(oldMessage.guild);

const embed = new EmbedBuilder()
.setAuthor({
name: `Message Edited | ${oldMessage.author.tag}`,
Expand Down
4 changes: 3 additions & 1 deletion src/listeners/guild/roleCreate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { auditlogChecks } from '#classes/Utils';
import { ApplyOptions } from '@sapphire/decorators';
import { Events, Listener } from '@sapphire/framework';
import { EmbedBuilder, roleMention, type Role } from 'discord.js';
Expand All @@ -7,7 +8,8 @@ import { EmbedBuilder, roleMention, type Role } from 'discord.js';
})
export class RoleCreateListener extends Listener {
public async run(role: Role) {
const channel = await this.container.utils.auditlogChecks(role.guild);
const channel = await auditlogChecks(role.guild);
if (!channel) return;

const embed = new EmbedBuilder()
.setAuthor({
Expand Down
4 changes: 3 additions & 1 deletion src/listeners/guild/roleDelete.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { auditlogChecks } from '#classes/Utils';
import { ApplyOptions } from '@sapphire/decorators';
import { Events, Listener } from '@sapphire/framework';
import { EmbedBuilder, roleMention, type Role } from 'discord.js';
Expand All @@ -7,7 +8,8 @@ import { EmbedBuilder, roleMention, type Role } from 'discord.js';
})
export class RoleDeleteListener extends Listener {
public async run(role: Role) {
const channel = await this.container.utils.auditlogChecks(role.guild);
const channel = await auditlogChecks(role.guild);
if (!channel) return;

const embed = new EmbedBuilder()
.setAuthor({
Expand Down
4 changes: 3 additions & 1 deletion src/listeners/guild/roleUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { auditlogChecks } from '#classes/Utils';
import { ApplyOptions } from '@sapphire/decorators';
import { Events, Listener } from '@sapphire/framework';
import { EmbedBuilder, roleMention, type Role } from 'discord.js';
Expand All @@ -7,7 +8,8 @@ import { EmbedBuilder, roleMention, type Role } from 'discord.js';
})
export class RoleUpdateListener extends Listener {
public async run(oldRole: Role, newRole: Role) {
const channel = await this.container.utils.auditlogChecks(oldRole.guild);
const channel = await auditlogChecks(oldRole.guild);
if (!channel) return;

const embed = new EmbedBuilder()
.setAuthor({
Expand Down
Loading

0 comments on commit f2d3a2d

Please sign in to comment.