diff --git a/core/index.ts b/core/index.ts index eebd4fd..15c3648 100644 --- a/core/index.ts +++ b/core/index.ts @@ -8,6 +8,7 @@ export { default as Config } from './internal/config'; export * as Logger from './internal/logger'; export * as Schedules from './internal/schedules'; +export * from './util/calendar'; export * from './util/languages'; export { default as Pager } from './util/pager'; export * as Result from './util/result'; diff --git a/packages/misc/util/calendar.ts b/core/util/calendar.ts similarity index 100% rename from packages/misc/util/calendar.ts rename to core/util/calendar.ts diff --git a/packages/misc/commands/cal.ts b/packages/images/commands/cal.ts similarity index 96% rename from packages/misc/commands/cal.ts rename to packages/images/commands/cal.ts index 5f66599..e92a62f 100644 --- a/packages/misc/commands/cal.ts +++ b/packages/images/commands/cal.ts @@ -1,6 +1,11 @@ import { createCanvas } from 'canvas'; -import { SimpleSlashCommandBuilder, LANG, strFormat } from 'core'; -import { DayOfWeek, MonthCalendar } from '../util/calendar'; +import { + SimpleSlashCommandBuilder, + LANG, + strFormat, + DayOfWeek, + MonthCalendar, +} from 'core'; import { BoundingBox, CanvasTable, diff --git a/packages/misc/commands/graph.js b/packages/images/commands/graph.js similarity index 100% rename from packages/misc/commands/graph.js rename to packages/images/commands/graph.js diff --git a/packages/misc/commands/pie_chart.js b/packages/images/commands/pie_chart.js similarity index 100% rename from packages/misc/commands/pie_chart.js rename to packages/images/commands/pie_chart.js diff --git a/packages/misc/commands/ping.js b/packages/images/commands/ping.js similarity index 100% rename from packages/misc/commands/ping.js rename to packages/images/commands/ping.js diff --git a/packages/images/index.ts b/packages/images/index.ts index 86518f4..4445445 100644 --- a/packages/images/index.ts +++ b/packages/images/index.ts @@ -1,9 +1,19 @@ -import { Feature } from 'core'; +import { CommandManager, Feature } from 'core'; +import { registerConfiguredFont } from './util/canvasUtils'; +import { Client } from 'discord.js'; +import path from 'path'; class ImagesFeature extends Feature { enabled: boolean = true; name: string = 'images'; + + async onLoad(client: Client): Promise { + registerConfiguredFont(); + await CommandManager.default.loadDirectory( + path.join(__dirname, 'commands'), + ); + } } export const feature = new ImagesFeature(); diff --git a/packages/misc/util/canvasUtils.ts b/packages/images/util/canvasUtils.ts similarity index 100% rename from packages/misc/util/canvasUtils.ts rename to packages/images/util/canvasUtils.ts diff --git a/packages/misc/commands/date.ts b/packages/misc/commands/date.ts index 6fe24b2..9e83b4c 100644 --- a/packages/misc/commands/date.ts +++ b/packages/misc/commands/date.ts @@ -1,5 +1,4 @@ -import { CompoundCommandBuilder, LANG, strFormat } from 'core'; -import { CalendarDate } from '../util/calendar'; +import { CompoundCommandBuilder, LANG, strFormat, CalendarDate } from 'core'; const builder = new CompoundCommandBuilder( LANG.commands.date.name, diff --git a/packages/misc/index.ts b/packages/misc/index.ts index 48e0d6b..1662bf6 100644 --- a/packages/misc/index.ts +++ b/packages/misc/index.ts @@ -3,7 +3,6 @@ import { ClientMessageHandler } from './util/messages'; import path from 'path'; import { Feature, CommandManager, Config } from 'core'; -import { registerConfiguredFont } from './util/canvasUtils'; import { Client } from 'discord.js'; class MiscFeature extends Feature { @@ -17,7 +16,6 @@ class MiscFeature extends Feature { client.on('messageCreate', (message) => this.messageHandler?.handleMessage(message), ); - registerConfiguredFont(); await CommandManager.default.loadDirectory( path.join(__dirname, 'commands'), );