Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Feiryn committed Mar 14, 2024
1 parent b643447 commit 9d60dde
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Discord/src/commands/player/ReportCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ export async function chooseDestinationCollector(packet: ReactionCollectorCreati
time: packet.endTime - Date.now()
});

buttonCollector.on("collect", async (i: ButtonInteraction) => {
if (i.user.id !== context.discord?.user) {
await sendInteractionNotForYou(i.user, i, interaction.userLanguage);
buttonCollector.on("collect", async (buttonInteraction: ButtonInteraction) => {
if (buttonInteraction.user.id !== context.discord?.user) {
await sendInteractionNotForYou(buttonInteraction.user, buttonInteraction, interaction.userLanguage);
return;
}

Expand Down
3 changes: 2 additions & 1 deletion Discord/src/packetHandlers/handlers/NotificationsHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {CommandReportChooseDestinationRes} from "../../../../Lib/src/packets/com
import {KeycloakUtils} from "../../../../Lib/src/keycloak/KeycloakUtils";
import {keycloakConfig} from "../../bot/DraftBotShard";
import {DraftBotIcons} from "../../../../Lib/src/DraftBotIcons";
import {minutesToHours} from "../../../../Lib/src/utils/TimeUtils";

export default class NotificationsHandlers {
@packetHandler(CommandReportChooseDestinationRes)
Expand All @@ -28,7 +29,7 @@ export default class NotificationsHandlers {
i18nTr = time === 1 ? "commands:report.choseMapMinutes_one" : "commands:report.choseMapMinutes_other";
}
else {
time = Math.round(packet.tripDuration / 60);
time = Math.round(minutesToHours(packet.tripDuration));
i18nTr = time === 1 ? "commands:report.choseMap_one" : "commands:report.choseMap_other";
}
embed.setDescription(i18n.t(i18nTr, {
Expand Down
33 changes: 33 additions & 0 deletions Lang/en/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,39 @@
"main": "Join the community! Use this link: https://discord.gg/acGNvzEY92 :smiley:"
}
},
"language": {
"description": "Use the menu below to change the language used by the bot on this discord server. This command can only be used by server administrators.",
"languages": {
"de": {
"emoji": "🇩🇪",
"name": "German"
},
"en": {
"emoji": "🇬🇧",
"name": "English"
},
"es": {
"emoji": "🇪🇸",
"name": "spanish"
},
"fr": {
"emoji": "🇫🇷",
"name": "French"
},
"it": {
"emoji": "🇮🇹",
"name": "Italian"
},
"pt": {
"emoji": "🇵🇹",
"name": "Portuguese"
}
},
"newLanguageSetDescription": "DraftBot will now speak in english with you! 🇬🇧",
"newLanguageSetTitle": "Language changed",
"selectLanguage": "Select a new language",
"title": ":earth_africa: Language selection"
},
"ping": {
"discord": {
"create": ":ping_pong: Pong",
Expand Down
33 changes: 33 additions & 0 deletions Lang/fr/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,39 @@
"main": "Rejoignez la communauté ! Utilisez ce lien : https://discord.gg/acGNvzEY92 :smiley:"
}
},
"language": {
"description": "Utilisez le menu ci-dessous pour changer la langue utilisée par le bot sur ce serveur. Cette commande est réservée aux administrateurs du serveur.",
"languages": {
"de": {
"emoji": "🇩🇪",
"name": "Allemand"
},
"en": {
"emoji": "🇬🇧",
"name": "Anglais"
},
"es": {
"emoji": "🇪🇸",
"name": "Espagnol"
},
"fr": {
"emoji": "🇫🇷",
"name": "Français"
},
"it": {
"emoji": "🇮🇹",
"name": "Italien"
},
"pt": {
"emoji": "🇵🇹",
"name": "Portugais"
}
},
"newLanguageSetDescription": "DraftBot vous parlera désormais en français ! 🥖",
"newLanguageSetTitle": "Langue changée",
"selectLanguage": "Sélectionnez une langue",
"title": ":earth_africa: Sélection de la langue"
},
"ping": {
"discord": {
"create": ":ping_pong: Pong",
Expand Down

0 comments on commit 9d60dde

Please sign in to comment.