Autosave: 20260217-191159
This commit is contained in:
parent
2c5ca6a915
commit
0e42ce02fa
2
bot.log
2
bot.log
@ -3,6 +3,6 @@ Bot Starting...
|
|||||||
Keep-Alive aktif di port 8080
|
Keep-Alive aktif di port 8080
|
||||||
Bot logged in as XiaoMao#2565
|
Bot logged in as XiaoMao#2565
|
||||||
Memulai refresh slash commands...
|
Memulai refresh slash commands...
|
||||||
(node:20219) DeprecationWarning: The ready event has been renamed to clientReady to distinguish it from the gateway READY event and will only emit under that name in v15. Please use clientReady instead.
|
(node:20667) DeprecationWarning: The ready event has been renamed to clientReady to distinguish it from the gateway READY event and will only emit under that name in v15. Please use clientReady instead.
|
||||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||||
Berhasil mendaftarkan slash commands!
|
Berhasil mendaftarkan slash commands!
|
||||||
|
|||||||
10
index.js
10
index.js
@ -60,15 +60,13 @@ const commands = [
|
|||||||
|
|
||||||
// 5. Interaction Handling
|
// 5. Interaction Handling
|
||||||
client.on('interactionCreate', async interaction => {
|
client.on('interactionCreate', async interaction => {
|
||||||
|
await interaction.deferReply().catch(e => console.error(e));
|
||||||
|
console.log('--- COMMAND DITERIMA: ' + interaction.commandName + ' ---');
|
||||||
if (!interaction.isChatInputCommand()) return;
|
if (!interaction.isChatInputCommand()) return;
|
||||||
|
|
||||||
const { commandName } = interaction;
|
const { commandName } = interaction;
|
||||||
|
|
||||||
if (commandName === 'play') {
|
if (commandName === 'play') {
|
||||||
// PRIORITAS UTAMA: Defer secepat mungkin untuk menghindari timeout
|
|
||||||
await interaction.deferReply();
|
|
||||||
console.log('Command diterima, sedang memproses...');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const query = interaction.options.getString('query');
|
const query = interaction.options.getString('query');
|
||||||
|
|
||||||
@ -93,8 +91,6 @@ client.on('interactionCreate', async interaction => {
|
|||||||
} else {
|
} else {
|
||||||
// Untuk command lain, kita tetap gunakan try-catch global
|
// Untuk command lain, kita tetap gunakan try-catch global
|
||||||
try {
|
try {
|
||||||
await interaction.deferReply();
|
|
||||||
|
|
||||||
if (!interaction.member.voice.channel) {
|
if (!interaction.member.voice.channel) {
|
||||||
return interaction.editReply('Kamu harus berada di voice channel!');
|
return interaction.editReply('Kamu harus berada di voice channel!');
|
||||||
}
|
}
|
||||||
@ -181,4 +177,4 @@ process.on('uncaughtException', error => {
|
|||||||
console.error('Uncaught exception:', error);
|
console.error('Uncaught exception:', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.login(process.env.DISCORD_TOKEN);
|
client.login('MTQ3Mjc2ODQ4NTQ0NzY5NjY1MA.Gx78sk.NGDrdd51zwcDbqyVrupL78RlUZdUSgmGvzn3pw');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user