Skip to content

Commit

Permalink
Fix: change to absolute paths (running scripts is usually not allowed…
Browse files Browse the repository at this point in the history
… on hosters)
  • Loading branch information
Vliegenier04 committed Dec 12, 2024
1 parent f8d8ffe commit 3289e1f
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 22 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"pm2:kill": "pm2 kill",
"pm2:start": "pm2 start dist/index.js --attach --name bridge",
"setup-files": "node scripts/setup-files.js",
"start": "node ."
"start": "node -r tsconfig-paths/register dist/index.js"
},
"dependencies": {
"consola": "^2.15.3",
Expand All @@ -25,7 +25,8 @@
"obscenity": "^0.1.4",
"pnpm": "^9.14.2",
"prismarine-chat": "^1.10.1",
"zod": "^3.23.8"
"zod": "^3.23.8",
"tsconfig-paths": "^4.2.0"
},
"devDependencies": {
"@jejebecarte/eslint-config": "^1.0.6",
Expand Down
10 changes: 5 additions & 5 deletions src/classes/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { BotEvents, createBot } from 'mineflayer';
import logger from 'consola';
import EventEmitter from 'events';
import path from 'path';
import isObjKey from '@util/is-obj-key';
import logError from '@util/log-error';
import recursiveWalkDir from '@util/recursive-walk-dir';
import regex from '@events/regex';
import env from '@util/env';
import isObjKey from '../util/is-obj-key';
import logError from '../util/log-error';
import recursiveWalkDir from '../util/recursive-walk-dir';
import regex from '../events/regex';
import env from '../util/env';
import Discord from './client';

class Bot {
Expand Down
12 changes: 6 additions & 6 deletions src/commands/blacklist.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ApplicationCommandOptionType, EmbedBuilder, TextChannel } from 'discord.js';
import env from '@util/env';
import _blacklist from '@blacklist/_blacklist.json';
import writeToJsonFile from '@util/write-to-json-file';
import fetchErrorEmbed from '@requests/fetch-error-embed';
import fetchMojangProfile from '@requests/fetch-mojang-profile';
import isFetchError from '@requests/is-fetch-error';
import env from '../util/env';
import _blacklist from '../blacklist/_blacklist.json';
import writeToJsonFile from '../util/write-to-json-file';
import fetchErrorEmbed from '../requests/fetch-error-embed';
import fetchMojangProfile from '../requests/fetch-mojang-profile';
import isFetchError from '../requests/is-fetch-error';

export default {
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/promote-demote.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js';
import capitaliseString from '@util/capitalise-string';
import capitaliseString from '../util/capitalise-string';

export default {
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/toggle-mute.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js';
import capitaliseString from '@util/capitalise-string';
import capitaliseString from '../util/capitalise-string';

export default {
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/events/discord/interaction-create.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logger from 'consola';
import { ApplicationCommandOptionType, EmbedBuilder, GuildMember, Interaction } from 'discord.js';
import env from '@util/env';
import env from '../../util/env';

export default {
name: 'interactionCreate',
Expand Down
4 changes: 2 additions & 2 deletions src/events/discord/message.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logger from 'consola';
import { Message } from 'discord.js';
import { DataSet, RegExpMatcher, englishDataset, englishRecommendedTransformers } from 'obscenity';
import emojis from '@util/emojis';
import env from '@util/env';
import emojis from '../../util/emojis';
import env from '../../util/env';

const whitelist = ['ass', 'bitch', 'cock', 'dick', 'fuck'];
const dataset = new DataSet<{ originalWord: string }>()
Expand Down
2 changes: 1 addition & 1 deletion src/events/discord/ready.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TextChannel } from 'discord.js';
import env from '@util/env';
import env from '../../util/env';

export default {
name: 'ready',
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Bot from '@classes/bot';
import Bot from './classes/bot';

export default new Bot();
2 changes: 1 addition & 1 deletion src/requests/fetch-hypixel-guild.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import env from '@util/env';
import env from '../util/env';

export default async (uuid: string) => {
const response = await fetch(
Expand Down
2 changes: 1 addition & 1 deletion src/requests/fetch-hypixel-player-profile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import env from '@util/env';
import env from '../util/env';

export default async (username: string) => {
const response = await fetch(
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"allowJs": false,
"skipLibCheck": true,
"isolatedModules": true,
"baseUrl": "",
"paths": {
"@blacklist/*": ["./src/blacklist/*"],
"@classes/*": ["./src/classes/*"],
Expand Down

0 comments on commit 3289e1f

Please sign in to comment.