chore: Seperating command categorys (generals, chattings)

This commit is contained in:
Siwoo Jeon 2025-03-16 19:54:54 +09:00
parent 7af353ebf3
commit 8712eb4f58
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
8 changed files with 44 additions and 30 deletions

View file

@ -1,6 +1,6 @@
import type { Context } from '../lib/context'
import { MuffinCustomId } from '../lib/customId'
import { Learn } from '../lib/databases'
import type { Context } from '../../lib/context'
import { MuffinCustomId } from '../../lib/customId'
import { Learn } from '../../lib/databases'
import { ApplyOptions } from '@sapphire/decorators'
import { Args, Command } from '@sapphire/framework'
import {

View file

@ -1,5 +1,5 @@
import type { Context } from '../lib/context'
import { Learn } from '../lib/databases'
import type { Context } from '../../lib/context'
import { Learn } from '../../lib/databases'
import { ApplyOptions } from '@sapphire/decorators'
import { Args, Command } from '@sapphire/framework'
import {

View file

@ -1,5 +1,5 @@
import type { Context } from '../lib/context'
import { Learn } from '../lib/databases'
import type { Context } from '../../lib/context'
import { Learn } from '../../lib/databases'
import { ApplyOptions } from '@sapphire/decorators'
import { Command } from '@sapphire/framework'
import {

View file

@ -1,5 +1,5 @@
import type { Context } from '../lib/context'
import { Learn, Text } from '../lib/databases'
import type { Context } from '../../lib/context'
import { Learn, Text } from '../../lib/databases'
import { ApplyOptions } from '@sapphire/decorators'
import { Command } from '@sapphire/framework'
import {

View file

@ -0,0 +1,23 @@
import type { Context } from '../../lib/context'
import { ApplyOptions } from '@sapphire/decorators'
import { Args, Command } from '@sapphire/framework'
import type { ChatInputCommandInteraction, Message } from 'discord.js'
@ApplyOptions<Command.Options>({
name: '도움말',
aliases: ['도움', '명령어', 'help'],
description: '기본적인 사용ㅂ법이에요.',
})
export default class HelpCommand extends Command {
public async messageRun(msg: Message<true>, args: Args) {
return await this._run(msg, args)
}
public async chatInputRun(
interaction: ChatInputCommandInteraction<'cached'>,
) {
return await this._run(interaction)
}
private async _run(ctx: Context, args?: Args) {}
}

View file

@ -1,4 +1,4 @@
import type { Context } from '../lib/context'
import type { Context } from '../../lib/context'
import { ApplyOptions } from '@sapphire/decorators'
import { Command } from '@sapphire/framework'
import {

View file

@ -1,20 +0,0 @@
import { ApplyOptions } from '@sapphire/decorators'
import { Command } from '@sapphire/framework'
import type { ChatInputCommandInteraction, Message } from 'discord.js'
@ApplyOptions<Command.Options>({
name: '도움말',
aliases: ['도움', '명령어', 'help'],
description: '기본적인 사용ㅂ법이에요.',
})
export default class HelpCommand extends Command {
private async _run(
ctx: Message<true> | ChatInputCommandInteraction<'cached'>,
) {
ctx.reply('현재 준ㅂ비중')
}
public async messageRun(message: Message<true>) {
await this._run(message)
}
}

View file

@ -0,0 +1,11 @@
export type Category = '일반' | '채팅'
export type CategoryByEnglish = 'generals' | 'chattings'
export function getCategory(category: CategoryByEnglish): Category {
switch (category) {
case 'generals':
return '일반'
case 'chattings':
return '채팅'
}
}