Skip to content
Merged
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
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);
}
})();
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');
1 change: 1 addition & 0 deletions src/commands/레벨링/levelset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Leveling/levelset.js');
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/로깅/logging.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Logging/logging.js');
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/반응_역할/reactroles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Reaction_roles/reactroles.js');
3 changes: 3 additions & 0 deletions src/commands/생일/birthday.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Copied from src/commands/Birthday/birthday.js
// (파일 내용은 그대로 유지됩니다.)
module.exports = require('../../src/commands/Birthday/birthday.js');
1 change: 1 addition & 0 deletions src/commands/생일/modules/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Copied directory placeholder
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/서버_통계/serverstats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/ServerStats/serverstats.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/avatar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/avatar.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/firstmsg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/firstmsg.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/report.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/serverinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/serverinfo.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/todo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/todo.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/userinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/userinfo.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/weather.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/weather.js');
1 change: 1 addition & 0 deletions src/commands/유틸리티/wipedata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Utility/wipedata.js');
1 change: 1 addition & 0 deletions src/commands/음악/join.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Music/join.js');
1 change: 1 addition & 0 deletions src/commands/음악/music.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Music/music.js');
1 change: 1 addition & 0 deletions src/commands/음악/nowplaying.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Music/nowplaying.js');
1 change: 1 addition & 0 deletions src/commands/음악/play.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Music/play.js');
1 change: 1 addition & 0 deletions src/commands/음악/queue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Music/queue.js');
1 change: 1 addition & 0 deletions src/commands/인증/autoverify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Verification/autoverify.js');
1 change: 1 addition & 0 deletions src/commands/인증/verification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Verification/verification.js');
1 change: 1 addition & 0 deletions src/commands/인증/verify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Verification/verify.js');
1 change: 1 addition & 0 deletions src/commands/재미/count.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Fun/count.js');
1 change: 1 addition & 0 deletions src/commands/재미/fight.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Fun/fight.js');
1 change: 1 addition & 0 deletions src/commands/재미/flip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Fun/flip.js');
1 change: 1 addition & 0 deletions src/commands/재미/roll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Fun/roll.js');
1 change: 1 addition & 0 deletions src/commands/참여로_생성/jointocreate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/JoinToCreate/jointocreate.js');
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/커뮤니티/app-admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Community/app-admin.js');
1 change: 1 addition & 0 deletions src/commands/커뮤니티/apply.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Community/apply.js');
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/코어/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Core/commands.js');
1 change: 1 addition & 0 deletions src/commands/코어/configWizard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Core/configWizard.js');
1 change: 1 addition & 0 deletions src/commands/코어/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Core/help.js');
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/티켓/claim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Ticket/claim.js');
1 change: 1 addition & 0 deletions src/commands/티켓/close.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Ticket/close.js');
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/환영/autorole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Welcome/autorole.js');
1 change: 1 addition & 0 deletions src/commands/환영/goodbye.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Welcome/goodbye.js');
1 change: 1 addition & 0 deletions src/commands/환영/greet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Welcome/greet.js');
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/환영/welcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/commands/Welcome/welcome.js');