-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b1d651
commit ed24080
Showing
14 changed files
with
345 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { getRoomAnalysis } from '../../services/room/analysis' | ||
import { roomGroup } from './index' | ||
import { Extension } from '@pikokr/command.ts' | ||
import { | ||
ChatInputCommandInteraction, | ||
Colors, | ||
EmbedBuilder, | ||
codeBlock, | ||
inlineCode, | ||
} from 'discord.js' | ||
|
||
class BuildingExtension extends Extension { | ||
@roomGroup.command({ | ||
name: 'buildings', | ||
nameLocalizations: { ko: '시설' }, | ||
description: | ||
'이 낚시터의 시설을 조회할 수 있어요! (관리자는 시설 철거도 가능)', | ||
dmPermission: false, | ||
}) | ||
async buildings(i: ChatInputCommandInteraction) { | ||
if (!i.channel || i.channel.isDMBased()) return | ||
} | ||
|
||
@roomGroup.command({ | ||
name: 'build', | ||
nameLocalizations: { ko: '시설건설' }, | ||
description: '이 낚시터에 시설을 건설할 수 있어요!', | ||
dmPermission: false, | ||
}) | ||
async info(i: ChatInputCommandInteraction) { | ||
if (!i.channel || i.channel.isDMBased()) return | ||
} | ||
} | ||
|
||
export const setup = async () => { | ||
return new BuildingExtension() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { getBiomeName } from '../../constants' | ||
import { Biome } from '../../types/room' | ||
import { roomGroup } from './index' | ||
import { Extension, option } from '@pikokr/command.ts' | ||
import { | ||
APIApplicationCommandOptionChoice, | ||
ApplicationCommandOptionType, | ||
ChatInputCommandInteraction, | ||
Colors, | ||
EmbedBuilder, | ||
} from 'discord.js' | ||
|
||
const biomeCategories: APIApplicationCommandOptionChoice<number>[] = [ | ||
{ name: getBiomeName(Biome.Sea), value: Biome.Sea }, | ||
{ name: getBiomeName(Biome.River), value: Biome.River }, | ||
{ name: getBiomeName(Biome.Lake), value: Biome.Lake }, | ||
{ name: getBiomeName(Biome.Valley), value: Biome.Valley }, | ||
{ name: getBiomeName(Biome.Swamp), value: Biome.Swamp }, | ||
{ name: getBiomeName(Biome.Foreshore), value: Biome.Foreshore }, | ||
{ name: getBiomeName(Biome.Desert), value: Biome.Desert }, | ||
] | ||
|
||
class ChangeBiomeExtension extends Extension { | ||
@roomGroup.command({ | ||
name: 'change_biome', | ||
nameLocalizations: { ko: '지형변경' }, | ||
description: '낚시터의 지형을 변경할 수 있어!', | ||
dmPermission: false, | ||
}) | ||
async buy( | ||
i: ChatInputCommandInteraction, | ||
@option({ | ||
name: 'biome', | ||
name_localizations: { ko: '지형' }, | ||
description: '어떤 지형으로 변경할 건가요?', | ||
type: ApplicationCommandOptionType.Integer, | ||
choices: biomeCategories, | ||
required: true, | ||
}) | ||
biome: Biome | ||
) { | ||
if (!i.channel || i.channel.isDMBased()) return | ||
await i.deferReply() | ||
|
||
const room = await i.channel.epRoom | ||
const originBiome = room.biome | ||
|
||
if (originBiome === biome) { | ||
return i.editReply('이미 이 낚시터의 지형이에요!') | ||
} | ||
|
||
room.biome = biome | ||
await room.save() | ||
|
||
const embed = new EmbedBuilder() | ||
.setTitle(`🏞️ ' ${room.name} ' 낚시터 지형 변경`) | ||
.setDescription( | ||
[ | ||
`- \`지형\` ${getBiomeName(originBiome)} → ${getBiomeName(biome)}`, | ||
`- \`지형 조성 비용\` 💰 ${(99999).toLocaleString()}`, | ||
].join('\n') | ||
) | ||
.setColor(Colors.Blue) | ||
.setTimestamp() | ||
|
||
await i.editReply({ embeds: [embed] }) | ||
} | ||
} | ||
|
||
export const setup = async () => { | ||
return new ChangeBiomeExtension() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.