Skip to content

Commit 41dd1cc

Browse files
committed
renamed files to use dash case
1 parent 124bb98 commit 41dd1cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+59
-57
lines changed

src/commands/banana/banana-donate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { createUser, getUser, setUser } from "../../functions/banana";
55

66
export default {

src/commands/banana/banana-flip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
setCoinFlips,
88
setUser
99
} from "../../functions/banana";
10-
import type { Command } from "../../interfaces/Command";
10+
import type { Command } from "../../interfaces/command";
1111

1212
export default {
1313
name: "banana-flip",

src/commands/banana/banana-jack.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { createUser, getUser, setUser } from "../../functions/banana";
55
import { MessageActionRow, MessageButton } from "discord.js";
66

src/commands/banana/banana-rps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { MessageActionRow, MessageButton } from "discord.js";
44
import { getUser, createUser, setUser } from "../../functions/banana";
5-
import type { Command } from "../../interfaces/Command";
5+
import type { Command } from "../../interfaces/command";
66

77
const currentlyPlaying = new Set<string>();
88

src/commands/banana/banana-top.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { getData, getUser } from "../../functions/banana";
55

66
export default {

src/commands/banana/banana.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { mongoDB } from "../../functions/mongodb";
55
import { createUser, getUser, setUser } from "../../functions/banana";
66
import { User } from "../../types";

src/commands/dev/challenge-requests-stats.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
4-
import { getStats } from "../../dal/challengeRequestStats";
3+
import type { Command } from "../../interfaces/command";
4+
import { getStats } from "../../dal/challenge-request-stats";
55
import { MessageEmbedOptions } from "discord.js";
66
import formatDistanceToNow from "date-fns/formatDistanceToNow";
77

src/commands/dev/fix-wpm-role.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { mongoDB } from "../../functions/mongodb";
55
import { User } from "../../types";
66

src/commands/dev/reset-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { mongoDB } from "../../functions/mongodb";
55
import { DefaultConfig } from "../../constants/default-config";
66
import { User } from "../../types";

src/commands/dev/restart-db.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { exec } from "child_process";
55
import { MessageActionRow, MessageButton } from "discord.js";
66

src/commands/dev/unlock-commands.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @format */
22

33
import { MessageActionRow, MessageButton } from "discord.js";
4-
import type { Command } from "../../interfaces/Command";
5-
import { Client } from "../../structures/Client";
4+
import type { Command } from "../../interfaces/command";
5+
import { Client } from "../../structures/client";
66

77
export default {
88
name: "unlock-commands",

src/commands/dev/upgrade.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { spawn } from "child_process";
55

66
export default {

src/commands/github/issue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import fetch from "node-fetch-commonjs";
55
import { parseJSON, readFileOrCreate } from "../../functions/file";
66
import { ApplicationCommandOption } from "discord.js";

src/commands/github/quote-pr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import SimpleGit from "simple-git";
55
import fetch from "node-fetch";
66

src/commands/github/quote-push.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44

55
import SimpleGit from "simple-git";
66

src/commands/github/quote-sync.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import SimpleGit from "simple-git";
55

66
export default {

src/commands/stats/leaderboard.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { User, LeaderboardEntry } from "../../types";
55
import { mongoDB } from "../../functions/mongodb";
66

src/commands/stats/personal-bests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { mongoDB } from "../../functions/mongodb";
55
import { PersonalBest, User } from "../../types";
66
import { EmbedFieldData, MessageEmbed } from "discord.js";

src/commands/stats/result.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44
import { mongoDB } from "../../functions/mongodb";
55
import { User, Result, Mode, QuoteCollection } from "../../types";
6-
import { toPascalCase } from "../../functions/toPascalCase";
6+
import { toPascalCase } from "../../functions/to-pascal-case";
77
import fetch from "node-fetch-commonjs";
88

99
const quoteLengthMap = {

src/commands/stats/stats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { mongoDB } from "../../functions/mongodb";
4-
import type { Command } from "../../interfaces/Command";
4+
import type { Command } from "../../interfaces/command";
55
import { User } from "../../types";
66
import intervalToDuration from "date-fns/intervalToDuration";
77
import formatDuration from "date-fns/formatDuration";

src/commands/utility/in-role.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { MessageEmbedOptions } from "discord.js";
4-
import type { Command } from "../../interfaces/Command";
4+
import type { Command } from "../../interfaces/command";
55

66
export default {
77
name: "in-role",

src/commands/utility/say.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { NewsChannel, TextChannel } from "discord.js";
4-
import type { Command } from "../../interfaces/Command";
4+
import type { Command } from "../../interfaces/command";
55

66
export default {
77
name: "say",

src/commands/utility/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Command } from "../../interfaces/Command";
3+
import type { Command } from "../../interfaces/command";
44

55
export default {
66
name: "test",

src/dal/challengeRequestStats.ts renamed to src/dal/challenge-request-stats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @format */
2-
import type { ChallengeRequestStats } from "../interfaces/ChallengeRequest";
2+
import type { ChallengeRequestStats } from "../interfaces/challenge-request";
33
import { mongoDB } from "../functions/mongodb";
44

55
export async function getStats(): Promise<ChallengeRequestStats[]> {

src/dal/challengeRequest.ts renamed to src/dal/challenge-request.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @format */
2-
import type { ChallengeRequest } from "../interfaces/ChallengeRequest";
2+
import type { ChallengeRequest } from "../interfaces/challenge-request";
33
import { mongoDB } from "../functions/mongodb";
44

55
export async function getRequestCount(): Promise<number> {

src/events/challengeRequest.ts renamed to src/events/challenge-request.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { Message, MessageActionRow, MessageButton } from "discord.js";
33
import { ObjectId } from "mongodb";
44
import { compareTwoStrings } from "string-similarity";
5-
import { addRequest, getRequestCount } from "../dal/challengeRequest";
6-
import type { Event } from "../interfaces/Event";
5+
import { addRequest, getRequestCount } from "../dal/challenge-request";
6+
import type { Event } from "../interfaces/event";
77

88
type FailReasons = "badFormat" | "invalidChallenge" | "noProof";
99

src/events/challengeResponse.ts renamed to src/events/challenge-response.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/** @format */
22

3-
import type { Event } from "../interfaces/Event";
3+
import type { Event } from "../interfaces/event";
44
import {
55
deleteRequest,
66
getRequest,
77
getRequestCount
8-
} from "../dal/challengeRequest";
8+
} from "../dal/challenge-request";
99
import {
1010
MessageActionRow,
1111
MessageSelectMenu,
@@ -14,7 +14,7 @@ import {
1414
import {
1515
incrementApproved,
1616
incrementDenied
17-
} from "../dal/challengeRequestStats";
17+
} from "../dal/challenge-request-stats";
1818

1919
const declineReasonOptions: MessageSelectOptionData[] = [
2020
{

src/events/interactionCreate.ts renamed to src/events/interaction-create.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Event } from "../interfaces/Event";
3+
import type { Event } from "../interfaces/event";
44

55
export default {
66
event: "interactionCreate",

src/events/messageCreate.ts renamed to src/events/message-create.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { User } from "discord.js";
44
import { randomBoolean } from "../functions/random";
5-
import type { Event } from "../interfaces/Event";
5+
import type { Event } from "../interfaces/event";
66

77
const githubLinkRegex = /\[#([0-9]{1,4})\]/g;
88

src/events/messageDelete.ts renamed to src/events/message-delete.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { Event } from "../interfaces/Event";
3+
import type { Event } from "../interfaces/event";
44

55
export default {
66
event: "messageDelete",

src/events/ready.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import _ from "lodash";
44
import { connectDB } from "../functions/mongodb";
55
import { connectRedis } from "../functions/redis";
66
import * as fs from "fs";
7-
import type { Event } from "../interfaces/Event";
7+
import type { Event } from "../interfaces/event";
88
import { parseJSON, readFileOrCreate } from "../functions/file";
9-
import { Client } from "../structures/Client";
9+
import { Client } from "../structures/client";
1010
import {
1111
ApplicationCommandChoicesOption,
1212
ApplicationCommandData,
@@ -25,7 +25,7 @@ export default {
2525
}
2626

2727
const memberCount =
28-
guild.presences.cache.size ??
28+
guild.presences?.cache?.size ??
2929
guild.approximatePresenceCount ??
3030
guild.memberCount ??
3131
guild.approximateMemberCount;
File renamed without changes.

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/** @format */
22

3-
import { Client } from "./structures/Client";
4-
import type { ClientOptions } from "./interfaces/ClientOptions";
3+
import { Client } from "./structures/client";
4+
import type { ClientOptions } from "./interfaces/client-options";
55
import { config } from "dotenv";
66
import clientOptions from "./config/config.json";
77

88
console.clear();
99

1010
config();
1111

12-
const client = new Client(clientOptions as ClientOptions);
12+
const client = new Client(clientOptions as unknown as ClientOptions);
1313

1414
client.start(process.env["TOKEN"] as string).then(console.log);
File renamed without changes.

src/interfaces/Command.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { ApplicationCommandOption, CommandInteraction } from "discord.js";
4-
import { Client } from "../structures/Client";
4+
import { Client } from "../structures/client";
55

66
export interface Command {
77
name: string;

src/interfaces/Event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { ClientEvents } from "discord.js";
4-
import { Client } from "../structures/Client";
4+
import { Client } from "../structures/client";
55

66
export interface Event<E extends keyof ClientEvents> {
77
event: E;

src/interfaces/Task.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { Guild } from "discord.js";
44
import { Document, WithId } from "mongodb";
5-
import { Client } from "../structures/Client";
5+
import { Client } from "../structures/client";
66

77
export interface Task extends WithId<Document> {
88
name: string;
File renamed without changes.

src/structures/Client.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/** @format */
22

33
import * as Discord from "discord.js";
4-
import type { Channels, ClientOptions } from "../interfaces/ClientOptions";
5-
import type { Command } from "../interfaces/Command";
6-
import type { Event } from "../interfaces/Event";
4+
import type { Channels, ClientOptions } from "../interfaces/client-options";
5+
import type { Command } from "../interfaces/command";
6+
import type { Event } from "../interfaces/event";
77
import type {
88
Task,
99
TaskFile,
1010
TaskResult,
1111
UnknownTask
12-
} from "../interfaces/Task";
12+
} from "../interfaces/task";
1313
import { promisify } from "util";
1414
import { resolve, join } from "path";
1515
import { APIMessage } from "discord-api-types";
@@ -195,11 +195,13 @@ export class Client<T extends boolean> extends Discord.Client<T> {
195195

196196
// Handing slash commands
197197

198-
const slashCommands = await this.application?.commands.fetch({
198+
const fetchOptions = {
199199
guildID: this.clientOptions.guildID,
200200
cache: true,
201201
force: true
202-
});
202+
};
203+
204+
const slashCommands = await this.application?.commands.fetch(fetchOptions);
203205

204206
commands.forEach(async (command) => {
205207
this.commands.set(command.name, command);
@@ -506,7 +508,7 @@ export class Client<T extends boolean> extends Discord.Client<T> {
506508
): Promise<Discord.TextChannel | undefined> {
507509
const guild = await this.guild;
508510

509-
const guildChannel = guild?.channels.cache.find(
511+
const guildChannel = guild?.channels?.cache.find(
510512
(ch) => ch.id === this.clientOptions.channels[channel]
511513
);
512514

src/tasks/announceLeaderboardUpdate.ts renamed to src/tasks/announce-leaderboard-update.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { GuildMember } from "discord.js";
4-
import type { TaskFile } from "../interfaces/Task";
4+
import type { TaskFile } from "../interfaces/task";
55

66
export default {
77
name: "announceLeaderboardUpdate",

src/tasks/awardChallenge.ts renamed to src/tasks/award-challenge.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @format */
22

3-
import type { TaskFile } from "../interfaces/Task";
3+
import type { TaskFile } from "../interfaces/task";
44

55
export default {
66
name: "awardChallenge",

0 commit comments

Comments
 (0)