chore: sort imports (#226)
All checks were successful
Publish latest version / build (push) Successful in 1m4s

Reviewed-on: #226
Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Co-committed-by: Mylloon <kennel.anri@tutanota.com>
This commit is contained in:
Mylloon 2025-03-06 23:03:50 +01:00 committed by Mylloon
parent c3d4ab4ebf
commit 5ee3ebe6b0
Signed by: Forgejo
GPG key ID: E72245C752A07631
44 changed files with 142 additions and 87 deletions

View file

@ -1,5 +1,3 @@
import { readdir } from "fs/promises";
import { removeExtension } from "../utils/misc";
import {
ChatInputCommandInteraction,
Client,
@ -7,7 +5,10 @@ import {
MessageComponentInteraction,
MessageFlags,
} from "discord.js";
import { readdir } from "fs/promises";
import { getLocale } from "../utils/locales";
import { removeExtension } from "../utils/misc";
import { ButtonActionTypes } from "../utils/monads/ButtonAction";
export default async (client: Client) => {

View file

@ -6,12 +6,13 @@ import {
MessageComponentInteraction,
} from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { embedListReminders } from "../../utils/commands/reminder";
import { reminderListNext, reminderListPrec } from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { embedListReminders } from "../../utils/commands/reminder";
import { collect } from "../loader";
import { reminderListNext, reminderListPrec } from "../../utils/constants";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import { collect } from "../loader";
export default {
data: {

View file

@ -6,12 +6,13 @@ import {
MessageComponentInteraction,
} from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { embedListReminders } from "../../utils/commands/reminder";
import { reminderListNext, reminderListPrec } from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { embedListReminders } from "../../utils/commands/reminder";
import { collect } from "../loader";
import { reminderListNext, reminderListPrec } from "../../utils/constants";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import { collect } from "../loader";
export default {
data: {

View file

@ -1,20 +1,21 @@
import { useMainPlayer, useQueue } from "discord-player";
import { Client, MessageComponentInteraction } from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { getFilename } from "../../utils/misc";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import {
embedLyrics,
embedNowPlaying,
findLyricsFromPlayer,
musicButtons,
} from "../../utils/commands/music";
import { useMainPlayer, useQueue } from "discord-player";
import { getLocale } from "../../utils/locales";
import {
discord_limit_embed_per_message,
musicLyrics,
musicPlayResume,
} from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import { collect } from "../loader";
export default {

View file

@ -1,12 +1,13 @@
import { useQueue } from "discord-player";
import { Client, MessageComponentInteraction } from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { embedNowPlaying, musicButtons, toggleMusicPause } from "../../utils/commands/music";
import { musicLyrics, musicPlayResume } from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { embedNowPlaying, musicButtons, toggleMusicPause } from "../../utils/commands/music";
import { collect } from "../loader";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import { musicLyrics, musicPlayResume } from "../../utils/constants";
import { collect } from "../loader";
export default {
data: {

View file

@ -8,12 +8,13 @@ import {
MessageComponentInteraction,
} from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { collect } from "../loader";
import { embedListQueue } from "../../utils/commands/music";
import { musicQueueNext, musicQueuePrec } from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import { collect } from "../loader";
export default {
data: {

View file

@ -8,12 +8,13 @@ import {
MessageComponentInteraction,
} from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { collect } from "../loader";
import { embedListQueue } from "../../utils/commands/music";
import { musicQueueNext, musicQueuePrec } from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { ButtonAction, ButtonActionTypes } from "../../utils/monads/ButtonAction";
import { collect } from "../loader";
export default {
data: {

View file

@ -1,7 +1,9 @@
import { REST } from "@discordjs/rest";
import { Routes } from "discord-api-types/v9";
import { Client } from "discord.js";
import { readdir } from "fs/promises";
import { REST } from "@discordjs/rest";
import { removeExtension } from "../utils/misc";
/** Load all the commands */

View file

@ -1,4 +1,5 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import "../../modules/string";
import {
ChannelType,
Client,
@ -8,7 +9,9 @@ import {
MessageFlags,
NonThreadGuildBasedChannel,
} from "discord.js";
import "../../modules/string";
import { SlashCommandBuilder } from "@discordjs/builders";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";

View file

@ -1,4 +1,5 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import "../../modules/string";
import {
ApplicationCommandOptionType,
ChatInputCommandInteraction,
@ -7,15 +8,17 @@ import {
EmbedBuilder,
MessageFlags,
} from "discord.js";
import "../../modules/string";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { SlashCommandBuilder } from "@discordjs/builders";
import {
goodDescription,
goodName,
NameNotLocalized,
SubnameNotLocalized,
} from "../../utils/commands/help";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
export default {
scope: () => [],

View file

@ -1,5 +1,7 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { ChatInputCommandInteraction, Client } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";

View file

@ -1,4 +1,5 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import "../../modules/string";
import {
ChannelType,
Client,
@ -7,7 +8,9 @@ import {
EmbedBuilder,
MessageFlags,
} from "discord.js";
import "../../modules/string";
import { SlashCommandBuilder } from "@discordjs/builders";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";

View file

@ -1,4 +1,3 @@
import { ModalActionRowComponentBuilder, SlashCommandBuilder } from "@discordjs/builders";
import {
ActionRowBuilder,
ButtonBuilder,
@ -11,9 +10,10 @@ import {
TextInputStyle,
} from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { ModalActionRowComponentBuilder, SlashCommandBuilder } from "@discordjs/builders";
import { collect } from "../../buttons/loader";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import {
checkOwnershipReminder,
deleteReminder,
@ -22,6 +22,8 @@ import {
newReminder,
} from "../../utils/commands/reminder";
import { reminderListNext, reminderListPrec } from "../../utils/constants";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
export default {
scope: () => [],

View file

@ -1,10 +1,12 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { useMainPlayer, useQueue } from "discord-player";
import { ChatInputCommandInteraction, Client, Message, MessageFlags } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { embedLyrics, findLyricsFromPlayer } from "../../utils/commands/music";
import { discord_limit_embed_per_message, discord_limit_message } from "../../utils/constants";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { discord_limit_embed_per_message, discord_limit_message } from "../../utils/constants";
import { embedLyrics, findLyricsFromPlayer } from "../../utils/commands/music";
export default {
scope: () => [],

View file

@ -1,9 +1,11 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { useQueue } from "discord-player";
import { ChatInputCommandInteraction, Client, EmbedBuilder } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { QueueStatus, toggleMusicPause } from "../../utils/commands/music";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { QueueStatus, toggleMusicPause } from "../../utils/commands/music";
export default {
scope: () => [],

View file

@ -1,4 +1,3 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { SearchResult, useMainPlayer, useQueue } from "discord-player";
import {
AutocompleteInteraction,
@ -7,13 +6,16 @@ import {
EmbedBuilder,
MessageFlags,
} from "discord.js";
import { getLocale, getLocalizations } from "../../utils/locales";
import { Metadata } from "../../utils/metadata";
import { getFilename } from "../../utils/misc";
import { SlashCommandBuilder } from "@discordjs/builders";
import {
discord_limit_autocompletion_list_length,
discord_limit_autocompletion_value_length,
} from "../../utils/constants";
import { getLocale, getLocalizations } from "../../utils/locales";
import { Metadata } from "../../utils/metadata";
import { getFilename } from "../../utils/misc";
import { timeToString } from "../../utils/time";
export default {

View file

@ -1,4 +1,3 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { useQueue } from "discord-player";
import {
ActionRowBuilder,
@ -9,11 +8,14 @@ import {
EmbedBuilder,
} from "discord.js";
import { v4 as uuidv4 } from "uuid";
import { SlashCommandBuilder } from "@discordjs/builders";
import { collect } from "../../buttons/loader";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { embedListQueue } from "../../utils/commands/music";
import { musicQueueNext, musicQueuePrec } from "../../utils/constants";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
export default {
scope: () => [],

View file

@ -1,6 +1,8 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { QueueRepeatMode, useQueue } from "discord-player";
import { ChatInputCommandInteraction, Client } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";

View file

@ -1,6 +1,8 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { useQueue } from "discord-player";
import { ChatInputCommandInteraction, Client } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";

View file

@ -1,6 +1,8 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { useMainPlayer } from "discord-player";
import { ChatInputCommandInteraction, Client } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";

View file

@ -1,5 +1,5 @@
import { Client } from "discord.js";
import { logStart } from "../../utils/misc";
import {
dbReminder,
deleteReminder,
@ -10,6 +10,7 @@ import {
updateReminder,
} from "../../utils/commands/reminder";
import { readSQL } from "../../utils/db";
import { logStart } from "../../utils/misc";
export const once = true;

View file

@ -1,6 +1,7 @@
import { Client, Interaction, InteractionType, MessageFlags } from "discord.js";
import { getLocale } from "../../utils/locales";
import { useMainPlayer } from "discord-player";
import { Client, Interaction, InteractionType, MessageFlags } from "discord.js";
import { getLocale } from "../../utils/locales";
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-interactionCreate */
export default (interaction: Interaction, client: Client) => {

View file

@ -1,6 +1,7 @@
import { PlayerEvents, useMainPlayer } from "discord-player";
import { Client } from "discord.js";
import { readdir } from "fs/promises";
import { isDev, splitFilenameExtensions } from "../utils/misc";
/** Load all the events */

View file

@ -1,9 +1,10 @@
import { Client, EmbedBuilder, Message, TextBasedChannel } from "discord.js";
import { handleAttachments } from "../../utils/events/citation";
import { getLocale } from "../../utils/locales";
import { userWithNickname } from "../../utils/misc";
import { showDate } from "../../utils/time";
import { RegexC, RegExpFlags } from "../../utils/regex";
import { handleAttachments } from "../../utils/events/citation";
import { showDate } from "../../utils/time";
/** https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-messageCreate */
export default async (message: Message, client: Client) => {

View file

@ -1,4 +1,5 @@
import { GuildQueue } from "discord-player";
import { Metadata } from "../../utils/metadata";
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */

View file

@ -1,4 +1,5 @@
import { GuildQueue } from "discord-player";
import { Metadata } from "../../utils/metadata";
/** https://discord-player.js.org/docs/main/master/typedef/PlayerEvents */

View file

@ -1,11 +1,12 @@
import { GuildQueue, Track } from "discord-player";
import { Client } from "discord.js";
import { Metadata } from "../../utils/metadata";
import { v4 as uuidv4 } from "uuid";
import { collect } from "../../buttons/loader";
import { embedNowPlaying, musicButtons } from "../../utils/commands/music";
import { getLocale } from "../../utils/locales";
import { musicLyrics, musicPlayResume } from "../../utils/constants";
import { getLocale } from "../../utils/locales";
import { Metadata } from "../../utils/metadata";
/** https://discord-player.js.org/docs/types/discord-player/GuildQueueEvents */
export default async (queue: GuildQueue<Metadata>, track: Track, client: Client) => {

View file

@ -3,7 +3,6 @@ import loadCommands from "./commands/loader";
import loadEvents from "./events/loader";
import loadModals from "./modals/loader";
import loadClient, { quit } from "./utils/client";
import { isDev, logStart } from "./utils/misc";
/** Run the bot */

View file

@ -1,5 +1,6 @@
import { Client } from "discord.js";
import { readdir } from "fs/promises";
import { removeExtension } from "../utils/misc";
export default async (client: Client) => {

View file

@ -1,6 +1,7 @@
import { Client, MessageFlags, ModalSubmitInteraction } from "discord.js";
import { getFilename } from "../../utils/misc";
import { newReminder } from "../../utils/commands/reminder";
import { getFilename } from "../../utils/misc";
export default {
data: {

View file

@ -1,9 +1,9 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { Collection } from "discord.js";
import { Database } from "sqlite3";
import { ButtonAction } from "../utils/monads/ButtonAction";
export {};
import { SlashCommandBuilder } from "@discordjs/builders";
import { ButtonAction } from "../utils/monads/ButtonAction";
declare module "discord.js" {
export interface Client {

View file

@ -1,14 +1,17 @@
import "../modules/client";
import { Player } from "discord-player";
import { YoutubeiExtractor } from "discord-player-youtubei";
import { ActivityType, Client, Collection, GatewayIntentBits } from "discord.js";
import { readFileSync } from "fs";
import { Database } from "sqlite3";
import "../modules/client";
import { loadLocales } from "./locales";
import { YoutubeiExtractor } from "discord-player-youtubei";
import { readSQL } from "./db";
import { isDev } from "./misc";
import { DefaultExtractors } from "@discord-player/extractor";
import { readSQL } from "./db";
import { loadLocales } from "./locales";
import { isDev } from "./misc";
/** Creation of the client and definition of its properties */
export default async () => {
const activities = isDev ? [] : [{ name: "/help", type: ActivityType.Watching }];

View file

@ -1,9 +1,11 @@
import { EmbedBuilder } from "@discordjs/builders";
import { GuildQueue, LrcSearchResult, Player, QueueRepeatMode, Track } from "discord-player";
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, Client } from "discord.js";
import { EmbedBuilder } from "@discordjs/builders";
import { discord_limit_embed_description_length, discord_limit_embed_field } from "../constants";
import { getLocale } from "../locales";
import { blank, emojiPng } from "../misc";
import { discord_limit_embed_description_length, discord_limit_embed_field } from "../constants";
import { RegexC } from "../regex";
export const embedListQueue = (

View file

@ -1,9 +1,10 @@
import { Client, Colors, EmbedBuilder, User } from "discord.js";
import { readSQL } from "../db";
import { getLocale } from "../locales";
import { blank, cleanCodeBlock } from "../misc";
import { showDate, strToSeconds, timeDeltaToString } from "../time";
import { RegexC, RegExpFlags } from "../regex";
import { readSQL } from "../db";
import { showDate, strToSeconds, timeDeltaToString } from "../time";
/**
* Option possible for reminders

View file

@ -1,4 +1,5 @@
import fs from "node:fs";
import { isDev } from "./misc";
export const readSQL = (path: string) => {

View file

@ -1,4 +1,5 @@
import { APIEmbedField, Attachment, Collection, EmbedBuilder } from "discord.js";
import { isImage } from "../misc";
export const handleAttachments = (

View file

@ -1,5 +1,6 @@
import { Client } from "discord.js";
import { readdir } from "fs/promises";
import { removeExtension } from "./misc";
/**

View file

@ -1,4 +1,5 @@
import moment from "moment-timezone";
import { RegexC, RegExpFlags } from "./regex";
/**

View file

@ -1,7 +1,7 @@
import "../../src/modules/string";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { describe, it } from "node:test";
describe("Capitalize", () => {
{

View file

@ -1,7 +1,7 @@
import { OptionReminder, splitTime } from "../../../src/utils/commands/reminder";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { OptionReminder, splitTime } from "../../../src/utils/commands/reminder";
describe("Time splitter", () => {
{

View file

@ -1,8 +1,9 @@
import { Attachment, Collection, EmbedBuilder } from "discord.js";
import { handleAttachments } from "../../../src/utils/events/citation";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { Attachment, Collection, EmbedBuilder } from "discord.js";
import { handleAttachments } from "../../../src/utils/events/citation";
/**
* Generate a new random string

View file

@ -1,3 +1,6 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import {
cleanCodeBlock,
emojiPng,
@ -6,9 +9,6 @@ import {
splitFilenameExtensions,
} from "../../src/utils/misc";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Filename splitter", () => {
{
const name = "test.js";

View file

@ -1,7 +1,7 @@
import { RegexC, RegExpFlags } from "../../src/utils/regex";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { RegexC, RegExpFlags } from "../../src/utils/regex";
describe("Regex flags", () => {
it("One parameter", () => {

View file

@ -1,3 +1,6 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import {
nextTimeUnit,
showDate,
@ -6,9 +9,6 @@ import {
TimeSecond,
} from "../../src/utils/time";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Date with correct timezone", () => {
const map = new Map([["u_time_at", "@"]]);
const date = new Date(1727434767686);