diff --git a/.vscode/settings.json b/.vscode/settings.json index 67255fe9..f6c9fc5e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "typescript.tsdk": "node_modules/typescript/lib", "eslint.codeActionsOnSave.mode": "problems", "eslint.format.enable": true, - "eslint.experimental.useFlatConfig": true, + "eslint.useFlatConfig": true, "[typescript]": { "editor.formatOnSave": true, "editor.defaultFormatter": "dbaeumer.vscode-eslint" diff --git a/src/bot/callback-data/index.ts b/src/bot/callback-data/index.ts deleted file mode 100644 index 21c84d0b..00000000 --- a/src/bot/callback-data/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './change-language.js' diff --git a/src/bot/features/admin.ts b/src/bot/features/admin.ts index 0bb84461..3e9bc87e 100644 --- a/src/bot/features/admin.ts +++ b/src/bot/features/admin.ts @@ -1,8 +1,8 @@ import { chatAction } from '@grammyjs/auto-chat-action' import { Composer } from 'grammy' import type { Context } from '#root/bot/context.js' -import { isAdmin } from '#root/bot/filters/index.js' -import { setCommandsHandler } from '#root/bot/handlers/index.js' +import { isAdmin } from '#root/bot/filters/is-admin.js' +import { setCommandsHandler } from '#root/bot/handlers/commands/setcommands.js' import { logHandle } from '#root/bot/helpers/logging.js' const composer = new Composer() diff --git a/src/bot/features/index.ts b/src/bot/features/index.ts deleted file mode 100644 index b838f8b4..00000000 --- a/src/bot/features/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './admin.js' -export * from './language.js' -export * from './unhandled.js' -export * from './welcome.js' diff --git a/src/bot/features/language.ts b/src/bot/features/language.ts index 8626eae2..93a43fdf 100644 --- a/src/bot/features/language.ts +++ b/src/bot/features/language.ts @@ -1,9 +1,9 @@ import { Composer } from 'grammy' -import { changeLanguageData } from '#root/bot/callback-data/index.js' +import { changeLanguageData } from '#root/bot/callback-data/change-language.js' import type { Context } from '#root/bot/context.js' import { logHandle } from '#root/bot/helpers/logging.js' import { i18n } from '#root/bot/i18n.js' -import { createChangeLanguageKeyboard } from '#root/bot/keyboards/index.js' +import { createChangeLanguageKeyboard } from '#root/bot/keyboards/change-language.js' const composer = new Composer() diff --git a/src/bot/filters/index.ts b/src/bot/filters/index.ts deleted file mode 100644 index 43036632..00000000 --- a/src/bot/filters/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './is-admin.js' diff --git a/src/bot/handlers/index.ts b/src/bot/handlers/index.ts deleted file mode 100644 index 46ed09fb..00000000 --- a/src/bot/handlers/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './error.js' -export * from './commands/setcommands.js' diff --git a/src/bot/index.ts b/src/bot/index.ts index cdfe48ce..8228db23 100644 --- a/src/bot/index.ts +++ b/src/bot/index.ts @@ -3,22 +3,15 @@ import { hydrate } from '@grammyjs/hydrate' import { hydrateReply, parseMode } from '@grammyjs/parse-mode' import type { BotConfig, StorageAdapter } from 'grammy' import { Bot as TelegramBot, session } from 'grammy' -import type { - Context, - SessionData, -} from '#root/bot/context.js' -import { - createContextConstructor, -} from '#root/bot/context.js' -import { - adminFeature, - languageFeature, - unhandledFeature, - welcomeFeature, -} from '#root/bot/features/index.js' -import { errorHandler } from '#root/bot/handlers/index.js' +import { welcomeFeature } from './features/welcome.js' +import { adminFeature } from './features/admin.js' +import { languageFeature } from './features/language.js' +import { unhandledFeature } from './features/unhandled.js' +import { errorHandler } from './handlers/error.js' +import { updateLogger } from './middlewares/update-logger.js' +import type { Context, SessionData } from '#root/bot/context.js' +import { createContextConstructor } from '#root/bot/context.js' import { i18n, isMultipleLocales } from '#root/bot/i18n.js' -import { updateLogger } from '#root/bot/middlewares/index.js' import { config } from '#root/config.js' import { logger } from '#root/logger.js' diff --git a/src/bot/keyboards/change-language.ts b/src/bot/keyboards/change-language.ts index 5f0da8f8..e1bf1f27 100644 --- a/src/bot/keyboards/change-language.ts +++ b/src/bot/keyboards/change-language.ts @@ -1,6 +1,6 @@ import { InlineKeyboard } from 'grammy' import ISO6391 from 'iso-639-1' -import { changeLanguageData } from '#root/bot/callback-data/index.js' +import { changeLanguageData } from '#root/bot/callback-data/change-language.js' import type { Context } from '#root/bot/context.js' import { i18n } from '#root/bot/i18n.js' import { chunk } from '#root/bot/helpers/keyboard.js' diff --git a/src/bot/keyboards/index.ts b/src/bot/keyboards/index.ts deleted file mode 100644 index 21c84d0b..00000000 --- a/src/bot/keyboards/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './change-language.js' diff --git a/src/bot/middlewares/index.ts b/src/bot/middlewares/index.ts deleted file mode 100644 index e8a6812f..00000000 --- a/src/bot/middlewares/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './update-logger.js'