Skip to content

Commit

Permalink
Merge pull request #1079 from LEDBrain/dev
Browse files Browse the repository at this point in the history
fix: Bug in Settings.ts command file
  • Loading branch information
kdev authored May 8, 2024
2 parents 0d8d7e7 + 5829d03 commit c8e39b3
Show file tree
Hide file tree
Showing 8 changed files with 1,885 additions and 415 deletions.
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ -n "$CI" ] && exit 0

npx --no -- commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[ -n "$CI" ] && exit 0

npm run lint
npx lint-staged
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
2,275 changes: 1,866 additions & 409 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,28 @@
"joi": "^17.13.1",
"jsdom": "^24.0.0",
"node-libcurl": "^4.0.0",
"zod": "^3.23.6"
"zod": "^3.23.7"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@hapi/code": "^9.0.3",
"@hapi/iron": "^7.0.0",
"@hapi/lab": "^25.2.0",
"@tsconfig/node16": "^16.1.3",
"@types/hapi__catbox": "^10.2.6",
"@types/jsdom": "^21.1.6",
"@types/ms": "^0.7.34",
"@types/node": "^20.12.8",
"@types/node": "^20.12.10",
"@types/node-fetch": "^2.6.11",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"c8": "^9.1.0",
"cz-conventional-changelog": "^3.3.0",
"esbuild": "0.20.2",
"esbuild": "0.21.1",
"eslint": "^8.56.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prisma": "^5.13.0",
"rimraf": "^5.0.5",
Expand All @@ -72,6 +75,9 @@
"publishConfig": {
"access": "restricted"
},
"lint-staged": {
"*.{js,ts}": "npm run lint"
},
"overrides": {
"@sapphire/shapeshift": "3.9.2"
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
SlashCommandBuilder,
inlineCode,
} from 'discord.js';
import { client } from 'index.js';
import type { Config } from '../base/Command.js';
import Command from '../base/Command.js';
import { client } from '../index.js';

export default class Ping extends Command {
constructor() {
Expand Down
2 changes: 2 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const env = createEnv({
DISCORD_CLIENT_SECRET: z.string().min(1),
DISCORD_REDIRECT_URI: z.string().url().min(1),

DISCORD_ADMIN_ID: z.string().min(1),

COOKIE_SECRET: z.string().min(32),
DATABASE_URL: z.string().url().min(1),

Expand Down
3 changes: 2 additions & 1 deletion src/events/MessageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Message } from 'discord.js';
import { ChannelType } from 'discord.js';
import type Client from '../base/Client.js';
import Event from '../base/Event.js';
import { env } from 'env.js';

export default class MessageCreate extends Event {
constructor() {
Expand All @@ -13,7 +14,7 @@ export default class MessageCreate extends Event {
public async execute(_: Client, message: Message) {
if (
message.content.toLowerCase() === 'deploy' &&
message.author.id === '199964094357307392' // Change this to the bot admin/dev id
message.author.id === env.DISCORD_ADMIN_ID
) {
console.log(`Deploying...`);
(await import('../deploy')).default();
Expand Down

0 comments on commit c8e39b3

Please sign in to comment.