Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce lower-camel-case file names #214

Merged
merged 9 commits into from
May 7, 2024
File renamed without changes.
2 changes: 1 addition & 1 deletion src/@types/Command.d.ts → src/@types/command.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ declare interface Command {
}

type ExecuteCommand = (
bot: import('@classes/Bot').default,
bot: import('@classes/bot').default,
interaction: import('discord.js').ChatInputCommandInteraction,
args: unknown[]
) => Promise<void>;
2 changes: 1 addition & 1 deletion src/@types/Event.d.ts → src/@types/event.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ declare interface Event {
run: Execute;
}

type Execute = (bot: import('@classes/Bot').default, ...params: any[]) => Promise<void>;
type Execute = (bot: import('@classes/bot').default, ...params: any[]) => Promise<void>;
8 changes: 4 additions & 4 deletions src/classes/Bot.ts → src/classes/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
import { BotEvents, createBot } from 'mineflayer';
import EventEmitter from 'events';
import consola from 'consola';
import isObjKey from '@util/isObjKey';
import logError from '@util/logError';
import isObjKey from '@util/is-obj-key';
import logError from '@util/log-error';
import path from 'path';
import recursiveWalkDir from '@util/recursiveWalkDir';
import recursiveWalkDir from '@util/recursive-walk-dir';
import regex from '@util/regex';
import Discord from './Client';
import Discord from './client';

class Bot {
public readonly logger = consola;
Expand Down
File renamed without changes.
23 changes: 12 additions & 11 deletions src/commands/blacklist.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ApplicationCommandOptionType, EmbedBuilder, TextChannel } from 'discord.js';
import _blacklist from '@util/blacklist/_blacklist.json';
import fetchErrorEmbed from '@util/requests/fetchErrorEmbed';
import fetchMojangProfile from '@util/requests/fetchMojangProfile';
import isFetchError from '@util/requests/isFetchError';
import writeToJsonFile from '@util/writeToJsonFile';
import fetchErrorEmbed from '@util/requests/fetch-error-embed';
import fetchMojangProfile from '@util/requests/fetch-mojang-profile';
import isFetchError from '@util/requests/is-fetch-error';
import writeToJsonFile from '@util/write-to-json-file';

export default {
data: {
Expand Down Expand Up @@ -78,13 +78,9 @@ export default {
const endDate = args[1] as string;
const reason = args[2] as string;
const embed = new EmbedBuilder()
.setAuthor({
name: 'Blacklist',
iconURL:
'https://media.discordapp.net/attachments/522930879413092388/849317688517853294/misc.png',
})
.setAuthor({ name: 'Blacklist' })
.setColor('Red')
.setFooter({ text: `UUID: ${mojangProfile.id}` })
.setFooter({ text: mojangProfile.id })
.setThumbnail(`https://visage.surgeplay.com/full/${mojangProfile.id}.png`)
.setTimestamp()
.setTitle(mojangProfile.name)
Expand Down Expand Up @@ -127,7 +123,12 @@ export default {
} the blacklist!`
);

writeToJsonFile('./s@util/_blacklist.json', blacklist, interaction, successEmbed);
writeToJsonFile(
'./src/util/blacklist/_blacklist.json',
blacklist,
interaction,
successEmbed
);
},
staffOnly: true,
} as Command;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js';
import capitaliseString from '@util/capitaliseString';
import capitaliseString from '@util/capitalise-string';

export default {
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/toggleMute.ts → 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/capitaliseString';
import capitaliseString from '@util/capitalise-string';

export default {
data: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { escapeMarkdown } from 'discord.js';
import getRankColor from '@util/getRankColor';
import getRankColor from '@util/get-rank-color';

export default {
name: 'chat:guildChat',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetchHypixelPlayerProfile from '@util/requests/fetchHypixelPlayerProfile';
import fetchMojangProfile from '@util/requests/fetchMojangProfile';
import isFetchError from '@util/requests/isFetchError';
import isUserBlacklisted from '@util/blacklist/isUserBlacklisted';
import fetchHypixelPlayerProfile from '@util/requests/fetch-hypixel-player-profile';
import fetchMojangProfile from '@util/requests/fetch-mojang-profile';
import isFetchError from '@util/requests/is-fetch-error';
import isUserBlacklisted from '@util/blacklist/is-user-blacklisted';

export default {
name: 'chat:joinRequest',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Emojis from '@util/emojis';
import { escapeMarkdown } from 'discord.js';
import fetchMojangProfile from '@util/requests/fetchMojangProfile';
import isFetchError from '@util/requests/isFetchError';
import isUserBlacklisted from '@util/blacklist/isUserBlacklisted';
import getRankColor from '@util/getRankColor';
import fetchMojangProfile from '@util/requests/fetch-mojang-profile';
import isFetchError from '@util/requests/is-fetch-error';
import isUserBlacklisted from '@util/blacklist/is-user-blacklisted';
import getRankColor from '@util/get-rank-color';

export default {
name: 'chat:memberJoinLeave',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { escapeMarkdown } from 'discord.js';
import Emojis from '@util/emojis';
import getRankColor from '@util/getRankColor';
import getRankColor from '@util/get-rank-color';

export default {
name: 'chat:promoteDemote',
Expand Down
6 changes: 3 additions & 3 deletions src/events/mineflayer/chat/whisper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fetchHypixelGuild from '@util/requests/fetchHypixelGuild';
import fetchMojangProfile from '@util/requests/fetchMojangProfile';
import isFetchError from '@util/requests/isFetchError';
import fetchHypixelGuild from '@util/requests/fetch-hypixel-guild';
import fetchMojangProfile from '@util/requests/fetch-mojang-profile';
import isFetchError from '@util/requests/is-fetch-error';

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

config();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CommandInteraction, EmbedBuilder } from 'discord.js';
import { writeFile } from 'fs';
import logError from './logError';
import logError from './log-error';

/**
* @param path The path to the target file. Path must begin from the path root.
Expand Down