Skip to content

Commit 4575640

Browse files
committed
fix: color on variable warning
1 parent 6cca846 commit 4575640

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/discord.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const refreshApplicationCommands = async (harmonix: Harmonix) => {
3939
const command = apiCommands.find((c) => c.name === cmd.config.name)
4040

4141
if (!command) {
42-
consola.warn(`Command ${cmd.config.name} not found in API.`)
42+
consola.warn(`Command \`${cmd.config.name}\` not found in API.`)
4343
continue
4444
}
4545
cmd.config.id = command.id

src/register.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ClientEvents, Events } from 'discord.js'
22
import consola from 'consola'
3-
import { colors } from 'consola/utils'
43
import { resolveOption } from './utils'
54
import { createError, ctx } from './harmonix'
65
import type { Harmonix, ParsedInputs, ParsedOptions } from './types'
@@ -51,7 +50,7 @@ export const registerCommands = (harmonix: Harmonix) => {
5150
const precondition = harmonix.preconditions.get(prc)
5251

5352
if (!precondition) {
54-
consola.warn(`Precondition ${colors.cyan(prc)} not found.`)
53+
consola.warn(`Precondition \`${prc}\` not found.`)
5554
continue
5655
}
5756
const result = ctx.call(harmonix, () =>
@@ -80,7 +79,7 @@ export const registerContextMenu = (harmonix: Harmonix) => {
8079
const precondition = harmonix.preconditions.get(prc)
8180

8281
if (!precondition) {
83-
consola.warn(`Precondition ${colors.cyan(prc)} not found.`)
82+
consola.warn(`Precondition \`${prc}\` not found.`)
8483
continue
8584
}
8685
const result = ctx.call(harmonix, () =>

src/resolve.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export const resolveEvent = (
4444
const event = jiti(_evtPath) as HarmonixEvent
4545

4646
if (!event.config || !event.callback) {
47-
consola.warn(`Event ${filename(_evtPath)} does not export a valid event.`)
47+
consola.warn(
48+
`Event \`${filename(_evtPath)}\` does not export a valid event.`
49+
)
4850
return { config: { name: filename(_evtPath) }, callback: () => {} }
4951
}
5052
const matchSuffix = filename(_evtPath).match(/\.(on|once)?$/)
@@ -77,7 +79,7 @@ export const resolveCommand = (
7779

7880
if (!command.config || !command.execute) {
7981
consola.warn(
80-
`Command ${filename(_cmdPath)} does not export a valid command.`
82+
`Command \`${filename(_cmdPath)}\` does not export a valid command.`
8183
)
8284
return { config: { name: filename(_cmdPath) }, execute: () => {} }
8385
}
@@ -115,7 +117,7 @@ export const resolveContextMenu = (
115117

116118
if (!contextMenu.config || !contextMenu.callback) {
117119
consola.warn(
118-
`Context Menu ${filename(_ctmPath)} does not export a valid context menu.`
120+
`Context Menu \`${filename(_ctmPath)}\` does not export a valid context menu.`
119121
)
120122
return { config: { name: filename(_ctmPath) }, callback: () => {} }
121123
}
@@ -150,7 +152,7 @@ export const resolveButton = (
150152

151153
if (!button.config || !button.callback) {
152154
consola.warn(
153-
`Button ${filename(_btnPath)} does not export a valid button.`
155+
`Button \`${filename(_btnPath)}\` does not export a valid button.`
154156
)
155157
return {
156158
config: { id: filename(_btnPath), label: '' },
@@ -183,7 +185,9 @@ export const resolveModal = (
183185
const modal = jiti(_mdlPath) as HarmonixModal
184186

185187
if (!modal.config || !modal.callback) {
186-
consola.warn(`Modal ${filename(_mdlPath)} does not export a valid modal.`)
188+
consola.warn(
189+
`Modal \`${filename(_mdlPath)}\` does not export a valid modal.`
190+
)
187191
return {
188192
config: { id: filename(_mdlPath), title: '' },
189193
callback: () => {}
@@ -216,7 +220,7 @@ export const resolveSelectMenu = (
216220

217221
if (!selectMenu.config || !selectMenu.callback) {
218222
consola.warn(
219-
`Select Menu ${filename(_slmPath)} does not export a valid select menu.`
223+
`Select Menu \`${filename(_slmPath)}\` does not export a valid select menu.`
220224
)
221225
return {
222226
config: {
@@ -255,7 +259,7 @@ export const resolvePrecondition = (
255259

256260
if (!precondition.callback) {
257261
consola.warn(
258-
`Precondition ${filename(_prcPath)} does not export a valid precondition.`
262+
`Precondition \`${filename(_prcPath)}\` does not export a valid precondition.`
259263
)
260264
return { name: filename(_prcPath), callback: () => {} }
261265
}

0 commit comments

Comments
 (0)