Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
chore: update import paths to use absolute paths instead of relative …
Browse files Browse the repository at this point in the history
…paths for better maintainability and readability

refactor(commands): update import paths to use relative paths instead of absolute paths to improve maintainability and readability

refactor(commands): update import paths to use absolute paths instead of relative paths to improve maintainability and avoid errors

refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
fix: fix typo in guild.util.ts file
fix: fix typo in github-link-reaction.event.ts file

refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
feat: add support for process.env.PORT environment variable to be able to run app on a configurable port
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to use absolute paths instead of relative paths for better maintainability and readability
refactor: update import paths to

refactor: change import paths to use absolute paths instead of relative paths to improve code readability and maintainability

refactor(rest.util.ts): change import path of logger to match new alias
chore(tsconfig.json, vitest.config.ts): change alias for $core to # to improve semantics and consistency
  • Loading branch information
Bluzzi committed May 31, 2023
1 parent 8e94243 commit 7b088e5
Show file tree
Hide file tree
Showing 89 changed files with 407 additions and 407 deletions.
4 changes: 2 additions & 2 deletions src/api/func/main-channel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getChannels } from "$core/api/requests/main-channel";
import { gqlRequest } from "$core/utils/request";
import { getChannels } from "#/api/requests/main-channel";
import { gqlRequest } from "#/utils/request";

type ChannelsByCategory = {
[category: string]: string[];
Expand Down
4 changes: 2 additions & 2 deletions src/api/func/main-role.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getRoles } from "$core/api/requests/main-role";
import { gqlRequest } from "$core/utils/request";
import { getRoles } from "#/api/requests/main-role";
import { gqlRequest } from "#/utils/request";

type RolesByCategory = {
[category: string]: string[];
Expand Down
6 changes: 3 additions & 3 deletions src/api/func/member.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { GetMonthActivityQuery } from "$core/utils/request";
import { getMonthActivity } from "$core/api/requests/member";
import { gqlRequest } from "$core/utils/request";
import type { GetMonthActivityQuery } from "#/utils/request";
import { getMonthActivity } from "#/api/requests/member";
import { gqlRequest } from "#/utils/request";

export const getInactiveMembers = async(): Promise<GetMonthActivityQuery["members"] | null> => {
const monthActivityQuery = await gqlRequest(getMonthActivity);
Expand Down
2 changes: 1 addition & 1 deletion src/api/requests/main-channel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql } from "$core/utils/request";
import { graphql } from "#/utils/request";

export const addChannel = graphql(`
mutation addChannel($channelId: ID!, $category: String!){
Expand Down
2 changes: 1 addition & 1 deletion src/api/requests/main-role.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql } from "$core/utils/request";
import { graphql } from "#/utils/request";

export const addRole = graphql(`
mutation addRole($roleId: ID!, $category: String!){
Expand Down
2 changes: 1 addition & 1 deletion src/api/requests/member.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql } from "$core/utils/request";
import { graphql } from "#/utils/request";

export const createMember = graphql(`
mutation createMember($id: ID!, $username: String!, $profilePicture: String!){
Expand Down
2 changes: 1 addition & 1 deletion src/api/requests/presence-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql } from "$core/utils/request";
import { graphql } from "#/utils/request";

export const getPresenceMessages = graphql(`
query getPresenceMessages {
Expand Down
2 changes: 1 addition & 1 deletion src/api/requests/server-activity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphql } from "$core/utils/request";
import { graphql } from "#/utils/request";

export const getCurrentServerActivity = graphql(`
query getCurrentServerActivity {
Expand Down
8 changes: 4 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Client as DiscordClient, GatewayIntentBits, Partials, Team, User } from "discord.js";
import { logger } from "$core/utils/logger";
import { logger } from "#/utils/logger";
import { version, displayName } from "../package.json";
import { env } from "./configs/env/env.config";
import { listener, load as loadCommands, register } from "$core/utils/handler/command";
import { load as loadEvents } from "$core/utils/handler/event";
import { load as loadTasks } from "$core/utils/handler/task";
import { listener, load as loadCommands, register } from "#/utils/handler/command";
import { load as loadEvents } from "#/utils/handler/event";
import { load as loadTasks } from "#/utils/handler/task";
import { sep } from "path";

export const client = new DiscordClient({
Expand Down
16 changes: 8 additions & 8 deletions src/commands/anniversaire/[sub-commands]/list.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { CommandExecute } from "$core/utils/handler/command";
import { getBirthdays } from "$core/api/requests/member";
import type { CommandExecute } from "#/utils/handler/command";
import { getBirthdays } from "#/api/requests/member";
import { memberPerPage } from "./list.const";
import { DayJS } from "$core/configs/day-js";
import { simpleEmbed } from "$core/utils/discord/embed";
import { dateFormat, getAge } from "$core/utils/function/date";
import { msgParams } from "$core/utils/message";
import { gqlRequest } from "$core/utils/request";
import { commands } from "$core/configs/message/command";
import { DayJS } from "#/configs/day-js";
import { simpleEmbed } from "#/utils/discord/embed";
import { dateFormat, getAge } from "#/utils/function/date";
import { msgParams } from "#/utils/message";
import { gqlRequest } from "#/utils/request";
import { commands } from "#/configs/message/command";

export const execute: CommandExecute = async(command) => {
let page = command.options.getNumber(commands.birthday.subcmds.list.options.page.name) ?? 1;
Expand Down
16 changes: 8 additions & 8 deletions src/commands/anniversaire/[sub-commands]/next.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { CommandExecute } from "$core/utils/handler/command";
import { getBirthdays } from "$core/api/requests/member";
import { simpleEmbed } from "$core/utils/discord/embed";
import { commands } from "$core/configs/message/command";
import { gqlRequest } from "$core/utils/request";
import { DayJS } from "$core/configs/day-js";
import { msgParams } from "$core/utils/message";
import { getAge } from "$core/utils/function/date";
import type { CommandExecute } from "#/utils/handler/command";
import { getBirthdays } from "#/api/requests/member";
import { simpleEmbed } from "#/utils/discord/embed";
import { commands } from "#/configs/message/command";
import { gqlRequest } from "#/utils/request";
import { DayJS } from "#/configs/day-js";
import { msgParams } from "#/utils/message";
import { getAge } from "#/utils/function/date";

export const execute: CommandExecute = async(command) => {
const response = await gqlRequest(getBirthdays);
Expand Down
22 changes: 11 additions & 11 deletions src/commands/anniversaire/[sub-commands]/set.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { CommandExecute } from "$core/utils/handler/command";
import { DayJS } from "$core/configs/day-js";
import { commands } from "$core/configs/message/command";
import { global } from "$core/configs/global";
import { getAge } from "$core/utils/function/date";
import { simpleEmbed } from "$core/utils/discord/embed";
import { msgParams } from "$core/utils/message";
import { gqlRequest } from "$core/utils/request";
import { setBirthday } from "$core/api/requests/member";
import { logger } from "$core/utils/logger";
import { userWithId } from "$core/utils/discord/user";
import type { CommandExecute } from "#/utils/handler/command";
import { DayJS } from "#/configs/day-js";
import { commands } from "#/configs/message/command";
import { global } from "#/configs/global";
import { getAge } from "#/utils/function/date";
import { simpleEmbed } from "#/utils/discord/embed";
import { msgParams } from "#/utils/message";
import { gqlRequest } from "#/utils/request";
import { setBirthday } from "#/api/requests/member";
import { logger } from "#/utils/logger";
import { userWithId } from "#/utils/discord/user";

export const execute: CommandExecute = async(command) => {
const dateString = command.options.getString(commands.birthday.subcmds.set.options.date.name, true);
Expand Down
4 changes: 2 additions & 2 deletions src/commands/anniversaire/anniversaire.builder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SlashCommandDefition } from "$core/utils/handler/command";
import type { SlashCommandDefition } from "#/utils/handler/command";
import { SlashCommandBuilder } from "discord.js";
import { commands } from "$core/configs/message/command";
import { commands } from "#/configs/message/command";

export const slashCommand: SlashCommandDefition = new SlashCommandBuilder()
.setName(commands.birthday.name)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/clean/clean.builder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SlashCommandDefition } from "$core/utils/handler/command";
import type { SlashCommandDefition } from "#/utils/handler/command";
import { SlashCommandBuilder } from "discord.js";
import { commands } from "$core/configs/message/command";
import { commands } from "#/configs/message/command";

export const slashCommand: SlashCommandDefition = new SlashCommandBuilder()
.setName(commands.clean.name)
Expand Down
12 changes: 6 additions & 6 deletions src/commands/clean/clean.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { simpleEmbed } from "$core/utils/discord/embed";
import type { CommandExecute } from "$core/utils/handler/command";
import { logger } from "$core/utils/logger";
import { msgParams } from "$core/utils/message";
import { commands } from "$core/configs/message/command";
import { simpleEmbed } from "#/utils/discord/embed";
import type { CommandExecute } from "#/utils/handler/command";
import { logger } from "#/utils/logger";
import { msgParams } from "#/utils/message";
import { commands } from "#/configs/message/command";
import { ChannelType } from "discord.js";
import { userWithId } from "$core/utils/discord/user";
import { userWithId } from "#/utils/discord/user";

export const execute: CommandExecute = async(command) => {
const number = command.options.getNumber(commands.clean.options.count.name) ?? 10;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/emoji/emoji.builder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SlashCommandDefition } from "$core/utils/handler/command";
import type { SlashCommandDefition } from "#/utils/handler/command";
import { SlashCommandBuilder } from "discord.js";
import { commands } from "$core/configs/message/command";
import { commands } from "#/configs/message/command";

export const slashCommand: SlashCommandDefition = new SlashCommandBuilder()
.setName(commands.emoji.name)
Expand Down
16 changes: 8 additions & 8 deletions src/commands/emoji/emoji.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { CommandExecute } from "$core/utils/handler/command";
import type { CommandExecute } from "#/utils/handler/command";
import { StopReason, maxEmojiByGuildTier } from "./emoji.const";
import { simpleEmbed } from "$core/utils/discord/embed";
import { msgParams } from "$core/utils/message";
import { commands } from "$core/configs/message/command";
import { simpleEmbed } from "#/utils/discord/embed";
import { msgParams } from "#/utils/message";
import { commands } from "#/configs/message/command";
import { AttachmentBuilder, BaseGuildTextChannel } from "discord.js";
import { proposals } from "$core/configs/global";
import { logger } from "$core/utils/logger";
import { getGuildTypeById, guilds } from "$core/configs/guild";
import { userWithId } from "$core/utils/discord/user";
import { proposals } from "#/configs/global";
import { logger } from "#/utils/logger";
import { getGuildTypeById, guilds } from "#/configs/guild";
import { userWithId } from "#/utils/discord/user";

export const execute: CommandExecute = async(command) => {
const guild = command.guild;
Expand Down
10 changes: 5 additions & 5 deletions src/commands/forum/[sub-commands]/rename.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { simpleEmbed } from "$core/utils/discord/embed";
import type { CommandExecute } from "$core/utils/handler/command";
import { logger } from "$core/utils/logger";
import { msgParams } from "$core/utils/message";
import { commands } from "$core/configs/message/command";
import { simpleEmbed } from "#/utils/discord/embed";
import type { CommandExecute } from "#/utils/handler/command";
import { logger } from "#/utils/logger";
import { msgParams } from "#/utils/message";
import { commands } from "#/configs/message/command";
import { ChannelType, ForumChannel } from "discord.js";

export const execute: CommandExecute = async(command) => {
Expand Down
12 changes: 6 additions & 6 deletions src/commands/forum/[sub-commands]/resolve.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Message } from "discord.js";
import type { CommandExecute } from "$core/utils/handler/command";
import { simpleEmbed } from "$core/utils/discord/embed";
import { msgParams } from "$core/utils/message";
import { commands } from "$core/configs/message/command";
import type { CommandExecute } from "#/utils/handler/command";
import { simpleEmbed } from "#/utils/discord/embed";
import { msgParams } from "#/utils/message";
import { commands } from "#/configs/message/command";
import { ChannelType, ForumChannel } from "discord.js";
import { logger } from "$core/utils/logger";
import { userWithId } from "$core/utils/discord/user";
import { logger } from "#/utils/logger";
import { userWithId } from "#/utils/discord/user";
import { trustDiscordLinks } from "../forum.const";

export const execute: CommandExecute = async(command) => {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/forum/[sub-commands]/why.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { simpleEmbed } from "$core/utils/discord/embed";
import type { CommandExecute } from "$core/utils/handler/command";
import { commands } from "$core/configs/message/command";
import { msgParams } from "$core/utils/message";
import { simpleEmbed } from "#/utils/discord/embed";
import type { CommandExecute } from "#/utils/handler/command";
import { commands } from "#/configs/message/command";
import { msgParams } from "#/utils/message";

export const execute: CommandExecute = (command) => {
const user = command.options.getUser(commands.forum.subcmds.why.options.user.name, false);
Expand Down
6 changes: 3 additions & 3 deletions src/commands/forum/forum.builder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SlashCommandDefition } from "$core/utils/handler/command";
import type { SlashCommandDefition } from "#/utils/handler/command";
import { SlashCommandBuilder } from "discord.js";
import { commands } from "$core/configs/message/command";
import type { GuildsCommand } from "$core/utils/handler/command/command.type";
import { commands } from "#/configs/message/command";
import type { GuildsCommand } from "#/utils/handler/command/command.type";

export const guilds: GuildsCommand = ["pro"];

Expand Down
6 changes: 3 additions & 3 deletions src/commands/inactive/inactive.builder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SlashCommandDefition } from "$core/utils/handler/command";
import type { SlashCommandDefition } from "#/utils/handler/command";
import { SlashCommandBuilder } from "discord.js";
import { commands } from "$core/configs/message/command";
import type { GuildsCommand } from "$core/utils/handler/command/command.type";
import { commands } from "#/configs/message/command";
import type { GuildsCommand } from "#/utils/handler/command/command.type";

export const guilds: GuildsCommand = ["pro"];

Expand Down
20 changes: 10 additions & 10 deletions src/commands/inactive/inactive.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type { CommandExecute } from "$core/utils/handler/command";
import type { CommandExecute } from "#/utils/handler/command";
import type { CacheType, ComponentType, ModalSubmitInteraction } from "discord.js";
import { getInactiveMembers } from "$core/api/func/member";
import { getInactiveMembers } from "#/api/func/member";
import { confirmationModal, getActionRow, getEmbed, getPage, pageNumberByMember } from "./inactive.util";
import { interactionId } from "$core/configs/global";
import { guilds } from "$core/configs/guild";
import { commands } from "$core/configs/message/command";
import { simpleEmbed } from "$core/utils/discord/embed";
import { msgParams } from "$core/utils/message";
import { interactionId } from "#/configs/global";
import { guilds } from "#/configs/guild";
import { commands } from "#/configs/message/command";
import { simpleEmbed } from "#/utils/discord/embed";
import { msgParams } from "#/utils/message";
import { GuildMember, PermissionFlagsBits } from "discord.js";
import { reasonId } from "./inactive.const";
import { logger } from "$core/utils/logger";
import { userWithId } from "$core/utils/discord/user";
import { getGuildMembers } from "$core/utils/discord/guild";
import { logger } from "#/utils/logger";
import { userWithId } from "#/utils/discord/user";
import { getGuildMembers } from "#/utils/discord/guild";

export const execute: CommandExecute = async(command) => {
if (command.guild?.id !== guilds.pro.guildId) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/inactive/inactive.type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Tier } from "$core/configs/guild/guild.type";
import type { Tier } from "#/configs/guild/guild.type";
import type { ActionRowBuilder, ButtonBuilder, EmbedBuilder, Snowflake } from "discord.js";

export type Page = {
Expand Down
14 changes: 7 additions & 7 deletions src/commands/inactive/inactive.util.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Page } from "./inactive.type";
import { getMember } from "$core/api/requests/member";
import { getMember } from "#/api/requests/member";
import { reasonId } from "./inactive.const";
import { interactionId } from "$core/configs/global";
import { guilds } from "$core/configs/guild";
import { commands } from "$core/configs/message/command";
import { objectKeys } from "$core/utils/function/object";
import { msgParams } from "$core/utils/message";
import { gqlRequest } from "$core/utils/request";
import { interactionId } from "#/configs/global";
import { guilds } from "#/configs/guild";
import { commands } from "#/configs/message/command";
import { objectKeys } from "#/utils/function/object";
import { msgParams } from "#/utils/message";
import { gqlRequest } from "#/utils/request";
import type {
GuildMember,
Snowflake } from "discord.js";
Expand Down
10 changes: 5 additions & 5 deletions src/commands/interaction/[sub-commands]/verif.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { candidatBtn } from "./verif.util";
import { simpleEmbed } from "$core/utils/discord/embed";
import type { CommandExecute } from "$core/utils/handler/command";
import { commands } from "$core/configs/message/command";
import { simpleEmbed } from "#/utils/discord/embed";
import type { CommandExecute } from "#/utils/handler/command";
import { commands } from "#/configs/message/command";
import { ChannelType } from "discord.js";
import { logger } from "$core/utils/logger";
import { userWithId } from "$core/utils/discord/user";
import { logger } from "#/utils/logger";
import { userWithId } from "#/utils/discord/user";

export const execute: CommandExecute = async(command) => {
const channel = command.channel;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/interaction/[sub-commands]/verif.util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
import { interactionId } from "$core/configs/global";
import { commands } from "$core/configs/message/command";
import { interactionId } from "#/configs/global";
import { commands } from "#/configs/message/command";

export const candidatBtn = new ActionRowBuilder<ButtonBuilder>().addComponents(new ButtonBuilder()
.setCustomId(interactionId.button.verify)
Expand Down
6 changes: 3 additions & 3 deletions src/commands/interaction/interaction.builder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SlashCommandDefition } from "$core/utils/handler/command";
import type { SlashCommandDefition } from "#/utils/handler/command";
import { SlashCommandBuilder } from "discord.js";
import { commands } from "$core/configs/message/command";
import type { GuildsCommand } from "$core/utils/handler/command/command.type";
import { commands } from "#/configs/message/command";
import type { GuildsCommand } from "#/utils/handler/command/command.type";

export const guilds: GuildsCommand = ["pro"];

Expand Down
16 changes: 8 additions & 8 deletions src/commands/main/[sub-commands]/group-add/add-channel.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { CommandExecute } from "$core/utils/handler/command";
import { addChannel } from "$core/api/requests/main-channel";
import { simpleEmbed } from "$core/utils/discord/embed";
import { msgParams } from "$core/utils/message";
import { gqlRequest } from "$core/utils/request";
import { commands } from "$core/configs/message/command";
import { logger } from "$core/utils/logger";
import { userWithId } from "$core/utils/discord/user";
import type { CommandExecute } from "#/utils/handler/command";
import { addChannel } from "#/api/requests/main-channel";
import { simpleEmbed } from "#/utils/discord/embed";
import { msgParams } from "#/utils/message";
import { gqlRequest } from "#/utils/request";
import { commands } from "#/configs/message/command";
import { logger } from "#/utils/logger";
import { userWithId } from "#/utils/discord/user";

export const execute: CommandExecute = async(command) => {
const channel = command.options.getChannel(commands.main.groups.add.subcmds.channel.options.channel.name, true);
Expand Down
16 changes: 8 additions & 8 deletions src/commands/main/[sub-commands]/group-add/add-role.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { CommandExecute } from "$core/utils/handler/command";
import { addRole } from "$core/api/requests/main-role";
import { simpleEmbed } from "$core/utils/discord/embed";
import { commands } from "$core/configs/message/command";
import { gqlRequest } from "$core/utils/request";
import { msgParams } from "$core/utils/message";
import { logger } from "$core/utils/logger";
import { userWithId } from "$core/utils/discord/user";
import type { CommandExecute } from "#/utils/handler/command";
import { addRole } from "#/api/requests/main-role";
import { simpleEmbed } from "#/utils/discord/embed";
import { commands } from "#/configs/message/command";
import { gqlRequest } from "#/utils/request";
import { msgParams } from "#/utils/message";
import { logger } from "#/utils/logger";
import { userWithId } from "#/utils/discord/user";

export const execute: CommandExecute = async(command) => {
const role = command.options.getRole(commands.main.groups.add.subcmds.role.options.role.name, true);
Expand Down
Loading

0 comments on commit 7b088e5

Please sign in to comment.