Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Nov 3, 2024
1 parent 292425d commit 517d24b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
6 changes: 3 additions & 3 deletions locales/Turkish.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"content": "Merhaba! Ben {bot}, [Lavamusic](https://github.com/appujet/lavamusic) ve Discord.js ile yapılmış bir müzik botuyum. {prefix}help <command> yazarak bir komut hakkında daha fazla bilgi alabilirsiniz.",
"title": "Yardım Menüsü",
"not_found": "Bu {cmdName} komutu mevcut değil.",
"help_cmd": "**Açıklama**: {description}\n**Kullanım**: {usage}\n**Örnekler**: {examples}\n**Alternatifler**: {aliases}\n**Kategori**: {category}\n**Bekleme Süresi**: {cooldown} saniye\n**İzinler**: {premUser}\n**Bot İzinleri**: {premBot}\n**Sadece Geliştirici**: {dev}\n**Slash Komut**: {slash}\n**Argümanlar**: {args}\n**Oynatıcı**: {player}\n**DJ**: {dj}\n**DJ İzinleri**: {djPerm}\n**Ses**: {voice}",
"help_cmd": "**Açıklama**: {description}\n**Kullanım**: {usage}\n**Örnekler**: {examples}\n**Alternatifler**: {aliases}\n**Kategori**: {category}\n**Bekleme Süresi**: {cooldown} saniye\n**İzinler**: {premUser}\n**Bot İzinleri**: {premBot}\n**Sadece Geliştirici**: {dev}\n**Slash Komut**: {slash}\n**Argümanlar**: {args}\n**Oynatıcı**: {player}\n**DJ**: {dj}\n**DJ İzinleri**: {djPerm}\n**Ses**: {voice}",
"footer": "Bir komut hakkında daha fazla bilgi almak için {prefix}help <command> kullanın."
},
"botinfo": {
Expand Down Expand Up @@ -247,7 +247,7 @@
"grab": {
"description": "Çalan şarkıyı özel mesaj yoluyla gönderir.",
"loading": "Yükleniyor...",
"content":"**Süre**: {length}\n**Talep Eden**: <@{requester}>\n**Bağlantı**: [Buraya tıklayın]({uri})",
"content": "**Süre**: {length}\n**Talep Eden**: <@{requester}>\n**Bağlantı**: [Buraya tıklayın]({uri})",
"check_dm": "Lütfen özel mesajlarınızı kontrol edin.",
"dm_failed": "Özel mesaj gönderemedim. Lütfen doğrudan mesajların açık olduğundan emin olun."
},
Expand Down Expand Up @@ -644,4 +644,4 @@
"Leave a guild": "Bir sunucudan çık.",
"List all guilds the bot is in": "Botun bulunduğu tüm sunucuları listele.",
"Restart the bot": "Botu yeniden başlat."
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@types/i18n": "^0.13.12",
"@types/node": "^22.8.1",
"@types/node": "^22.8.7",
"@types/signale": "^1.4.7",
"prisma": "^5.21.1",
"tslib": "^2.8.0",
"tslib": "^2.8.1",
"typescript": "^5.6.3"
},
"dependencies": {
Expand Down
12 changes: 4 additions & 8 deletions src/commands/music/Play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,11 @@ export default class Play extends Command {
public async autocomplete(interaction: AutocompleteInteraction): Promise<void> {
const focusedValue = interaction.options.getFocused(true);

if (!focusedValue) {
return interaction.respond([]).catch(() => {
null;
});
if (!focusedValue || !focusedValue.value.trim()) {
return interaction.respond([]).catch(() => {});
}

const res = await this.client.manager.search(focusedValue.value, interaction.user);
const res = await this.client.manager.search(focusedValue.value.trim(), interaction.user);
const songs: ApplicationCommandOptionChoiceData[] = [];

if (res.loadType === 'search') {
Expand All @@ -120,9 +118,7 @@ export default class Play extends Command {
});
}

return await interaction.respond(songs).catch(() => {
null;
});
return await interaction.respond(songs).catch(() => {});
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/commands/music/PlayNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ export default class PlayNext extends Command {
if (!player.playing && player.queue.tracks.length > 0) await player.play({ paused: false });
}
public async autocomplete(interaction: AutocompleteInteraction): Promise<void> {
const focusedValue = interaction.options.getFocused();
const focusedValue = interaction.options.getFocused(true);

if (!focusedValue) {
return;
if (!focusedValue || !focusedValue.value.trim()) {
return interaction.respond([]).catch(() => {});
}

const res = await this.client.manager.search(focusedValue, interaction.user);
const res = await this.client.manager.search(focusedValue.value.trim(), interaction.user);
const songs: ApplicationCommandOptionChoiceData[] = [];

if (res.loadType === 'search') {
Expand All @@ -118,7 +118,7 @@ export default class PlayNext extends Command {
});
}

return await interaction.respond(songs).catch(console.error);
return await interaction.respond(songs).catch(() => {});
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export enum Language {
SpanishES = 'SpanishES',
// Swedish = "Swedish",
// Thai = "Thai",
Turkish = "Turkish",
Turkish = 'Turkish',
// Ukrainian = "Ukrainian",
Vietnamese = 'Vietnamese',
}
Expand Down Expand Up @@ -71,7 +71,7 @@ export const LocaleFlags = {
[Language.SpanishES]: '🇪🇸',
// [Language.Swedish]: "🇸🇪",
// [Language.Thai]: "🇹🇭",
[Language.Turkish]: "🇹🇷",
[Language.Turkish]: '🇹🇷',
// [Language.Ukrainian]: "🇺🇦",
[Language.Vietnamese]: '🇻🇳',
};
Expand Down

0 comments on commit 517d24b

Please sign in to comment.