Transcribe everything

Untranscribed sections are marked TODO
This commit is contained in:
tacheometry committed 2023-12-16 00:15:49 +02:00
1 parent 5398831944
commit 694767fc03
32 files changed
+1034 -392

No files matched your search

+11 -2
View File
@@ -13,6 +13,7 @@ import { InteractionValidationError } from '../../classes/interactions';
import loggerModule from '../../services/logger';
import { EmbedOptions } from '../../types/configTypes';
import { ValidatorParams } from '../../types/utilTypes';
import { useServerTranslator } from '../../common/localeUtil';
const embedOptions: EmbedOptions = config.get('embedOptions');
export const checkVoicePermissionJoinAndTalk = async ({ interaction, executionId }: ValidatorParams) => {
@@ -23,6 +24,7 @@ export const checkVoicePermissionJoinAndTalk = async ({ interaction, executionId
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const channel: VoiceBasedChannel | null =
interaction.member instanceof GuildMember ? interaction.member.voice.channel : null;
@@ -34,7 +36,10 @@ export const checkVoicePermissionJoinAndTalk = async ({ interaction, executionId
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nI do not have permission to play audio in the voice channel <#${channel.id}>.\n\nPlease make sure I have the **\`Connect\`** and **\`Speak\`** permissions in this voice channel.`
translator('validation.cannotJoinVoiceOrTalk', {
icon: embedOptions.icons.warning,
channel: `<#${channel.id}>`
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
@@ -64,6 +69,7 @@ export const checkChannelPermissionViewable = async ({ interaction, executionId
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const channel: TextBasedChannel | null = interaction.channel;
@@ -89,7 +95,10 @@ export const checkChannelPermissionViewable = async ({ interaction, executionId
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nI do not have permission to send message replies in the channel <#${channel.id}>.\n\nPlease make sure I have the **\`View Channel\`** permission in this text channel.`
translator('validation.cannotSendMessageInChannel', {
icon: embedOptions.icons.warning,
channel: `<#${channel.id}>`
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
+22 -4
View File
@@ -5,6 +5,8 @@ import { InteractionValidationError } from '../../classes/interactions';
import loggerModule from '../../services/logger';
import { EmbedOptions } from '../../types/configTypes';
import { ValidatorParams } from '../../types/utilTypes';
import { useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../common/formattingUtils';
const embedOptions: EmbedOptions = config.get('embedOptions');
export const checkQueueExists = async ({ interaction, queue, executionId }: ValidatorParams) => {
@@ -15,6 +17,7 @@ export const checkQueueExists = async ({ interaction, queue, executionId }: Vali
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -24,7 +27,10 @@ export const checkQueueExists = async ({ interaction, queue, executionId }: Vali
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nThere are no tracks in the queue and nothing currently playing. First add some tracks with **\`/play\`**!`
translator('validation.queueDoesNotExist', {
icon: embedOptions.icons.warning,
playCommand: formatSlashCommand('play', translator)
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
@@ -52,6 +58,7 @@ export const checkHistoryExists = async ({ interaction, history, executionId }:
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -61,7 +68,10 @@ export const checkHistoryExists = async ({ interaction, history, executionId }:
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nThere are no tracks in the history and nothing currently playing. First add some tracks with **\`/play\`**!`
translator('validation.historyDoesNotExist', {
icon: embedOptions.icons.warning,
playCommand: formatSlashCommand('play', translator)
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
@@ -89,6 +99,7 @@ export const checkQueueCurrentTrack = async ({ interaction, queue, executionId }
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -98,7 +109,10 @@ export const checkQueueCurrentTrack = async ({ interaction, queue, executionId }
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nThere is nothing currently playing. First add some tracks with **\`/play\`**!`
translator('validation.queueNoCurrentTrack', {
icon: embedOptions.icons.warning,
playCommand: formatSlashCommand('play', translator)
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
@@ -126,6 +140,7 @@ export const checkQueueEmpty = async ({ interaction, queue, executionId }: Valid
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -135,7 +150,10 @@ export const checkQueueEmpty = async ({ interaction, queue, executionId }: Valid
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nThere are no tracks added to the queue. First add some tracks with **\`/play\`**!`
translator('validation.queueIsEmpty', {
icon: embedOptions.icons.warning,
playCommand: formatSlashCommand('play', translator)
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
@@ -5,6 +5,8 @@ import { InteractionValidationError } from '../../classes/interactions';
import loggerModule from '../../services/logger';
import { EmbedOptions, SystemOptions } from '../../types/configTypes';
import { ValidatorParams } from '../../types/utilTypes';
import { useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../common/formattingUtils';
const embedOptions: EmbedOptions = config.get('embedOptions');
const systemOptions: SystemOptions = config.get('systemOptions');
@@ -16,6 +18,7 @@ export const checkValidGuildId = async ({ interaction, executionId }: ValidatorP
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -25,7 +28,10 @@ export const checkValidGuildId = async ({ interaction, executionId }: ValidatorP
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nNo permission to perform this action.\n\nThe command **\`/${interactionIdentifier}\`** cannot be executed in this server.`
translator('validation.notValidGuildId', {
icon: embedOptions.icons.warning,
command: formatSlashCommand(interactionIdentifier, translator)
})
)
.setColor(embedOptions.colors.warning)
]
+10 -2
View File
@@ -5,6 +5,7 @@ import { InteractionValidationError } from '../../classes/interactions';
import loggerModule from '../../services/logger';
import { EmbedOptions } from '../../types/configTypes';
import { ValidatorParams } from '../../types/utilTypes';
import { useServerTranslator } from '../../common/localeUtil';
const embedOptions: EmbedOptions = config.get('embedOptions');
export const checkInVoiceChannel = async ({ interaction, executionId }: ValidatorParams) => {
@@ -15,6 +16,7 @@ export const checkInVoiceChannel = async ({ interaction, executionId }: Validato
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -24,7 +26,9 @@ export const checkInVoiceChannel = async ({ interaction, executionId }: Validato
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Not in a voice channel**\nYou need to be in a voice channel to perform this action.`
translator('validation.notInVoiceChannel', {
icon: embedOptions.icons.warning
})
)
.setColor(embedOptions.colors.warning)
.setFooter({
@@ -49,6 +53,7 @@ export const checkSameVoiceChannel = async ({ interaction, queue, executionId }:
shardId: interaction.guild?.shardId,
guildId: interaction.guild?.id
});
const translator = useServerTranslator(interaction);
const interactionIdentifier =
interaction.type === InteractionType.ApplicationCommand ? interaction.commandName : interaction.customId;
@@ -66,7 +71,10 @@ export const checkSameVoiceChannel = async ({ interaction, queue, executionId }:
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Not in same voice channel**\nYou need to be in the same voice channel as me to perform this action.\n\n**Voice channel:** <#${queue.dispatcher.channel.id}>`
translator('validation.notInSameVoiceChannel', {
icon: embedOptions.icons.warning,
channel: `<#${queue.dispatcher.channel.id}>`
})
)
.setColor(embedOptions.colors.warning)
.setFooter({