Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/register-commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Register Korean Localized Commands

on:
workflow_dispatch:
push:
branches:
- translate/commands-ko

permissions:
contents: read
actions: read

jobs:
register-commands:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install deps
run: npm ci

- name: Register commands to test guild
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
GUILD_ID: ${{ secrets.GUILD_ID }}
run: node scripts/register-guild-commands.js
64 changes: 64 additions & 0 deletions scripts/register-guild-commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import 'dotenv/config';
import fs from 'fs/promises';
import path from 'path';
import { pathToFileURL } from 'url';
import { REST } from '@discordjs/rest';
import { Routes } from 'discord-api-types/v10';

const TOKEN = process.env.BOT_TOKEN;
const CLIENT_ID = process.env.CLIENT_ID;
const GUILD_ID = process.env.GUILD_ID;

if (!TOKEN || !CLIENT_ID || !GUILD_ID) {
console.error('Required env vars: BOT_TOKEN, CLIENT_ID, GUILD_ID');
process.exit(1);
}

const rest = new REST({ version: '10' }).setToken(TOKEN);

async function getAllFiles(dir, fileList = []) {
const entries = await fs.readdir(dir, { withFileTypes: true });
for (const entry of entries) {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) {
if (entry.name === 'modules') continue;
await getAllFiles(full, fileList);
} else if (entry.isFile() && entry.name.endsWith('.js')) {
fileList.push(full);
}
}
return fileList;
}

async function loadCommands() {
const commands = [];
const commandsPath = path.join(process.cwd(), 'src', 'commands');
const files = await getAllFiles(commandsPath);

for (const file of files) {
try {
const fileUrl = pathToFileURL(file).href;
const mod = await import(`${fileUrl}`);
const cmd = mod.default || mod;
if (cmd && cmd.data && typeof cmd.data.toJSON === 'function') {
commands.push(cmd.data.toJSON());
}
} catch (err) {
console.error(`Failed to load command file ${file}:`, err);
}
}

return commands;
}

(async () => {
try {
const commands = await loadCommands();
console.log(`Registering ${commands.length} commands to guild ${GUILD_ID}`);
const res = await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), { body: commands });
console.log('Registration result:', Array.isArray(res) ? `${res.length} commands registered` : res);
} catch (err) {
console.error('Error registering guild commands:', err);
process.exit(1);
}
})();
49 changes: 25 additions & 24 deletions src/commands/Birthday/birthday.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,66 @@ import nextBirthdays from './modules/next_birthdays.js';
import birthdaySetchannel from './modules/birthday_setchannel.js';

import { InteractionHelper } from '../../utils/interactionHelper.js';

export default {
data: new SlashCommandBuilder()
.setName('birthday')
.setDescription('Birthday system commands')
.setName('생일 설정')
.setDescription('생일 시스템 명령어 모음이에요')
.addSubcommand(subcommand =>
subcommand
.setName('set')
.setDescription('Set your birthday')
.setName('설정')
.setDescription('내 생일을 설정해요')
.addIntegerOption(option =>
option
.setName('month')
.setDescription('Birth month (1-12)')
.setName('')
.setDescription('태어난 월 (1-12)')
.setRequired(true)
.setMinValue(1)
.setMaxValue(12)
)
.addIntegerOption(option =>
option
.setName('day')
.setDescription('Birth day (1-31)')
.setName('')
.setDescription('태어난 일 (1-31)')
.setRequired(true)
.setMinValue(1)
.setMaxValue(31)
)
)
.addSubcommand(subcommand =>
subcommand
.setName('info')
.setDescription('View birthday information')
.setName('정보')
.setDescription('생일 정보를 확인해요')
.addUserOption(option =>
option
.setName('user')
.setDescription('User to check birthday for')
.setName('유저')
.setDescription('생일을 확인할 유저를 선택해요')
.setRequired(false)
)
)
.addSubcommand(subcommand =>
subcommand
.setName('list')
.setDescription('List all birthdays in the server')
.setName('생일 목록')
.setDescription('서버 내 모든 유저의 생일 목록을 봐요')
)
.addSubcommand(subcommand =>
subcommand
.setName('remove')
.setDescription('Remove your birthday')
.setName('생일 삭제')
.setDescription('등록된 내 생일을 삭제해요')
)
.addSubcommand(subcommand =>
subcommand
.setName('next')
.setDescription('Show upcoming birthdays')
.setName('다음 생일 목록')
.setDescription('다가오는 생일 목록을 확인해요')
)
.addSubcommand(subcommand =>
subcommand
.setName('setchannel')
.setDescription('Set or disable the channel for birthday announcements. (Manage Server required)')
.setName('알림 설정')
.setDescription('생일 알림 채널을 설정하거나 비활성화해요. (서버 관리 권한 필요)')
.addChannelOption(option =>
option
.setName('channel')
.setDescription('The text channel for announcements. Leave empty to disable.')
.setName('알림 보낼 채널')
.setDescription('알림을 보낼 텍스트 채널이에요. 비워두면 비활성화돼요.')
.addChannelTypes(ChannelType.GuildText)
.setRequired(false)
)
Expand All @@ -91,7 +92,7 @@ export default {
case 'setchannel':
return await birthdaySetchannel.execute(interaction, config, client);
default:
return await replyUserError(interaction, { type: ErrorTypes.UNKNOWN, message: 'Unknown subcommand' });
return await replyUserError(interaction, { type: ErrorTypes.UNKNOWN, message: '알 수 없는 하위 명령어예요.' });
}
}
};
}
6 changes: 4 additions & 2 deletions src/commands/Core/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ export default {
slashOnly: true,
data: new SlashCommandBuilder()
.setName("help")
.setDescription("Displays the help menu with all available commands"),
.setNameLocalizations({ ko: '도움말' })
.setDescription("Displays the help menu with all available commands")
.setDescriptionLocalizations({ ko: '사용 가능한 모든 명령어가 포함된 도움 메뉴를 표시' }),

async execute(interaction, guildConfig, client) {

Expand Down Expand Up @@ -178,4 +180,4 @@ export default {
}
}, HELP_MENU_TIMEOUT_MS);
},
};
};
6 changes: 4 additions & 2 deletions src/commands/Core/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { InteractionHelper } from '../../utils/interactionHelper.js';
export default {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Checks the bot's latency and API speed"),
.setNameLocalizations({ ko: '핑' })
.setDescription("Checks the bot's latency and API speed")
.setDescriptionLocalizations({ ko: '지연 시간 및 API 응답 속도 확인' }),

async prefixExecute(interaction) {
try {
Expand Down Expand Up @@ -78,4 +80,4 @@ export default {
}
}
},
};
};
8 changes: 7 additions & 1 deletion src/commands/Music/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ export default {
category: 'Music',
data: new SlashCommandBuilder()
.setName('play')
.setNameLocalizations({ ko: '재생' })
.setDescription('Play a song or add it to the queue')
.setDescriptionLocalizations({ ko: '노래를 재생하거나 대기열에 추가' })
.addStringOption((opt) =>
opt.setName('query').setDescription('Song name or URL').setRequired(true),
opt.setName('query')
.setNameLocalizations({ ko: '검색어' })
.setDescription('Song name or URL')
.setDescriptionLocalizations({ ko: '노래 제목 또는 URL' })
.setRequired(true),
),

async execute(interaction, config, client) {
Expand Down
17 changes: 17 additions & 0 deletions src/commands/README-translate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 번역된 폴더명 변경 PR

이 PR은 src/commands 디렉터리 내의 폴더명을 한국어(한글)로 노출시키기 위한 초기 변경입니다.

변경사항 요약:
- 영어 폴더별로 한글 폴더를 생성하고, 각 한글 폴더에 원본 파일을 require하는 proxy 파일들을 추가했습니다.
- 원본(영어) 폴더는 그대로 유지됩니다.

검증 및 주의사항:
- 프록시 방식은 빠른 노출을 위해 사용되었지만, require 상대경로가 정확한지 로컬에서 테스트가 필요합니다.
- 동적 임포트나 템플릿 문자열 경로는 자동 갱신되지 않았을 수 있습니다.

다음 단계 제안:
1) CI/테스트 실행 (아래 참고)
2) 문제 없으면 PR 머지 후 실제 파일 복사/경로 치환을 진행

---
1 change: 1 addition & 0 deletions src/commands/검색/modules/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// placeholder
1 change: 1 addition & 0 deletions src/commands/검색/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Search/search.js');
1 change: 1 addition & 0 deletions src/commands/경제/balance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Economy/balance.js');
1 change: 1 addition & 0 deletions src/commands/경제/beg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Economy/beg.js');
1 change: 1 addition & 0 deletions src/commands/경제/buy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Economy/buy.js');
1 change: 1 addition & 0 deletions src/commands/경제/crime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Economy/crime.js');
1 change: 1 addition & 0 deletions src/commands/경제/daily.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Economy/daily.js');
1 change: 1 addition & 0 deletions src/commands/경제/deposit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Economy/deposit.js');
1 change: 1 addition & 0 deletions src/commands/경품/gcreate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Giveaway/gcreate.js');
1 change: 1 addition & 0 deletions src/commands/경품/gdelete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Giveaway/gdelete.js');
1 change: 1 addition & 0 deletions src/commands/경품/gend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Giveaway/gend.js');
1 change: 1 addition & 0 deletions src/commands/경품/greroll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Giveaway/greroll.js');
1 change: 1 addition & 0 deletions src/commands/관리/ban.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/ban.js');
1 change: 1 addition & 0 deletions src/commands/관리/cases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/cases.js');
1 change: 1 addition & 0 deletions src/commands/관리/dm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/dm.js');
1 change: 1 addition & 0 deletions src/commands/관리/kick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/kick.js');
1 change: 1 addition & 0 deletions src/commands/관리/lock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/lock.js');
1 change: 1 addition & 0 deletions src/commands/관리/massban.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/massban.js');
1 change: 1 addition & 0 deletions src/commands/관리/masskick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/masskick.js');
1 change: 1 addition & 0 deletions src/commands/관리/purge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/purge.js');
1 change: 1 addition & 0 deletions src/commands/관리/say.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/say.js');
1 change: 1 addition & 0 deletions src/commands/관리/timeout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/timeout.js');
1 change: 1 addition & 0 deletions src/commands/관리/unban.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/unban.js');
1 change: 1 addition & 0 deletions src/commands/관리/unlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/unlock.js');
1 change: 1 addition & 0 deletions src/commands/관리/untimeout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/untimeout.js');
1 change: 1 addition & 0 deletions src/commands/관리/usernotes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/usernotes.js');
1 change: 1 addition & 0 deletions src/commands/관리/warn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/warn.js');
1 change: 1 addition & 0 deletions src/commands/관리/warnings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Moderation/warnings.js');
1 change: 1 addition & 0 deletions src/commands/도구/baseconvert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/baseconvert.js');
1 change: 1 addition & 0 deletions src/commands/도구/calculate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/calculate.js');
1 change: 1 addition & 0 deletions src/commands/도구/countdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/countdown.js');
1 change: 1 addition & 0 deletions src/commands/도구/embedbuilder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/embedbuilder.js');
1 change: 1 addition & 0 deletions src/commands/도구/generatepassword.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/generatepassword.js');
1 change: 1 addition & 0 deletions src/commands/도구/hexcolor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/hexcolor.js');
1 change: 1 addition & 0 deletions src/commands/도구/poll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/poll.js');
1 change: 1 addition & 0 deletions src/commands/도구/randomuser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/randomuser.js');
1 change: 1 addition & 0 deletions src/commands/도구/shorten.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/shorten.js');
1 change: 1 addition & 0 deletions src/commands/도구/time.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/time.js');
1 change: 1 addition & 0 deletions src/commands/도구/unixtime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Tools/unixtime.js');
1 change: 1 addition & 0 deletions src/commands/레벨링/leaderboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Leveling/leaderboard.js');
1 change: 1 addition & 0 deletions src/commands/레벨링/level.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Leveling/level.js');
1 change: 1 addition & 0 deletions src/commands/레벨링/leveladd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Leveling/leveladd.js');
1 change: 1 addition & 0 deletions src/commands/레벨링/levelremove.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Leveling/levelremove.js');
Loading