chore: Seperating command categorys (generals, chattings)
This commit is contained in:
parent
7af353ebf3
commit
8712eb4f58
8 changed files with 44 additions and 30 deletions
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
|
@ -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 {
|
23
src/commands/generals/help.ts
Normal file
23
src/commands/generals/help.ts
Normal 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) {}
|
||||
}
|
|
@ -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 {
|
|
@ -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)
|
||||
}
|
||||
}
|
11
src/lib/commandCategory.ts
Normal file
11
src/lib/commandCategory.ts
Normal 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 '채팅'
|
||||
}
|
||||
}
|
Reference in a new issue