Skip to content

Commit

Permalink
3.6.0-dev-2
Browse files Browse the repository at this point in the history
Added localization for /history command.
Fixed linters errors.
  • Loading branch information
AlexInCube committed Aug 11, 2024
1 parent 8de317b commit 8183b69
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/commands/audio/history.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ async function generateSongHistoryEmbed(guild: Guild): Promise<EmbedBuilder> {

if (!history) throw Error(`Can't find guild songs history: ${guild.id}`);

const historyEmbed = new EmbedBuilder().setTitle(`История песен для сервера ${guild.name}`);
const historyEmbed = new EmbedBuilder().setTitle(
`${i18next.t('commands:history_embed_title')} ${guild.name}`
);

if (history.songsHistory.length === 0) {
historyEmbed.setTitle('На этом сервере ещё не было отыграно ни одной песни, станьте первым!');
historyEmbed.setTitle(i18next.t('commands:history_embed_no_songs'));
return historyEmbed;
}

Expand Down
5 changes: 4 additions & 1 deletion src/locales/en/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@
"lyrics_embed_lyrics_not_found": "Lyrics not found",
"247_desc": "Toggle 24/7 mode. If enabled, bot will stay in a channel when no remain songs to play.",
"247_enabled": "Mode 24/7 is activated",
"247_disabled": "Mode 24/7 is disabled"
"247_disabled": "Mode 24/7 is disabled",
"history_desc": "View the history of last played songs/playlists",
"history_embed_no_songs": "No songs have been played on this server yet, be the first who play the song",
"history_embed_title": "Songs history for server"
}
5 changes: 4 additions & 1 deletion src/locales/ru/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@
"lyrics_embed_lyrics_not_found": "Текст песни не найден",
"247_desc": "Переключает 24/7 режим. Если включено, бот остаётся в канале, даже когда закончились песни.",
"247_enabled": "Режим 24/7 включён",
"247_disabled": "Режим 24/7 отключён"
"247_disabled": "Режим 24/7 отключён",
"history_desc": "Просмотр истории последних сыгранных песен и плейлистов",
"history_embed_no_songs": "На этом сервере ещё не было отыграно ещё ни одной песни, станьте первым!",
"history_embed_title": "История песен для сервера"
}
5 changes: 1 addition & 4 deletions src/schemas/SchemaGuild.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import mongoose, { Document, model, Schema } from 'mongoose';
import { ENV } from '../EnvironmentVariables.js';
import {
deleteGuildSongsHistory,
SongsHistoryListModelClass
} from './SchemaSongsHistory.js';
import { deleteGuildSongsHistory, SongsHistoryListModelClass } from './SchemaSongsHistory.js';

interface GuildOptions {
prefix: string;
Expand Down

0 comments on commit 8183b69

Please sign in to comment.