Skip to content

Commit

Permalink
bump dependencies
Browse files Browse the repository at this point in the history
fix minor bugs
  • Loading branch information
Chr1s70ph committed Jun 28, 2024
1 parent 8faff0a commit f4da672
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 39 deletions.
12 changes: 6 additions & 6 deletions interactions/global/mensa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { DiscordClient, DiscordChatInputCommandInteraction, DiscordSlashCommandB
const { DateTime } = require('luxon')

export const data = new DiscordSlashCommandBuilder()
.setName('mensa')
.setDescription('Was es wohl heute zum Essen geben wird?')
.setName('mensa')
.setDescription('Was es wohl heute zum Essen geben wird?')
.setLocalizations('mensa')
.addStringOption(option =>
option
.setName('wochentag')
Expand All @@ -31,7 +32,6 @@ export const data = new DiscordSlashCommandBuilder()
{ name: 'caféteria moltkestraße 30', value: 'x1moltkestrasse' },
),
)
.setLocalizations('mensa')

exports.Command = async (client: DiscordClient, interaction: DiscordChatInputCommandInteraction): Promise<void> => {
const today = new Date()
Expand Down Expand Up @@ -158,12 +158,12 @@ export function _updateJson(client: DiscordClient): Promise<string> {
* Fancy API stuff and user credential hashing
*/
const options = {
host: client.config.sensitive.mensa.base_url,
host: client.config.sensitive.mensa?.base_url,
port: 443,
path: client.config.sensitive.mensa.api,
path: client.config.sensitive.mensa?.api,
headers: {
Authorization: `Basic ${Buffer.from(
`${client.config.sensitive.mensa.user}:${client.config.sensitive.mensa.password}`,
`${client.config.sensitive.mensa?.user}:${client.config.sensitive.mensa?.password}`,
).toString('base64')}`,
},
}
Expand Down
2 changes: 1 addition & 1 deletion interactions/global/quicklink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ choices.shift()
export const data = new DiscordSlashCommandBuilder()
.setName('quicklink')
.setDescription('Links quick')
.setLocalizations('quicklink')
.addStringOption(option =>
// eslint-disable-next-line newline-per-chained-call
option
Expand All @@ -90,7 +91,6 @@ export const data = new DiscordSlashCommandBuilder()
.setRequired(true),
)
.addUserOption(option => option.setName('userping').setDescription('Who do you want to annoy?'))
.setLocalizations('quicklink')

/**
* Reply to interactiopn
Expand Down
6 changes: 3 additions & 3 deletions interactions/private/wochenplan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ exports.usage = `wochenplan {TAG}`
let startOfWeek = new Date()

export const data = new DiscordSlashCommandBuilder()
.setName('wochenplan')
.setDescription('Zeigt deinen Wochenplan an.')
.setName('wochenplan')
.setDescription('Zeigt deinen Wochenplan an.')
.setLocalizations('wochenplan')
.addStringOption(option =>
option.setName('datum').setDescription('Das Datum, das angezeigt werden soll. Format: DD.MM.YYYY'),
)
.setLocalizations('wochenplan')

function wochenplan(
client: DiscordClient,
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@
"homepage": "https://github.com/Chr1s70ph/ETIT-Master-JS#readme",
"author": "Christoph Bluem",
"dependencies": {
"@discordjs/rest": "^2.0.0",
"discord-api-types": "^0.37.79",
"discord.js": "^14.12.1",
"@discordjs/rest": "^2.3.0",
"discord-api-types": "^0.37.91",
"discord.js": "^14.15.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"fs": "^0.0.1-security",
"https": "^1.0.0",
"i18next": "^23.11.2",
"i18next": "^23.11.5",
"i18next-fs-backend": "^2.3.1",
"luxon": "^3.4.4",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"node-ical": "^0.18.0",
"node-schedule": "^2.1.1",
"openai": "^4.36.0",
"openai": "^4.52.1",
"os": "^0.1.2",
"pm2": "^5.3.1",
"pm2": "^5.4.1",
"tenorjs": "^1.0.10",
"tx2": "^1.0.5",
"valid-url": "^1.0.9"
},
"devDependencies": {
"@types/node-schedule": "^2.1.7",
"@types/tx2": "^1.0.3",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"eslint": "^9.0.0"
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint": "^9.5.0"
}
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"compilerOptions": {
"outDir": "./built",
"allowJs": true,
"allowJs": false,
"target": "ESNext",
"resolveJsonModule": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipLibCheck": true
},
"exclude": ["node_modules", "./built"]
"exclude": ["node_modules", "./built"],
}
28 changes: 10 additions & 18 deletions types/customTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import {
ModalSubmitInteraction,
PresenceData,
PresenceStatusData,
SlashCommandBuilder,
StringSelectMenuInteraction,
TextChannel,
User,
UserContextMenuCommandInteraction,
SlashCommandBuilder
} from 'discord.js'
import i18next, { TOptions } from 'i18next'
import { CalendarResponse } from 'node-ical'
Expand Down Expand Up @@ -230,28 +230,20 @@ export class DiscordSlashCommandBuilder extends SlashCommandBuilder {
/**
* Adds all available localizations of name and description
* @param {string} name name of command
* @returns {SlashCommandBuilder}
* @returns {this}
*/
public setLocalizations(name: string): SlashCommandBuilder {
/**
* Array of all available localizations
*/
const localizations: any = getLocalizations(name)
// If (localizations === []) return this
public setLocalizations(name: string): this {
const localizations: any = getLocalizations(name);
for (const entry in localizations) {
/**
* Object containing {@link LocaleString}, localized name and description
*/
const item: LocalizationTypes = localizations[entry]
/**
* Only set localization if a localized name or description can be found
*/
if (item.localized_name !== null) this.setNameLocalization(item.localized_language, item.localized_name)
const item: LocalizationTypes = localizations[entry];
if (item.localized_name !== null) {
this.setNameLocalization(item.localized_language, item.localized_name);
}
if (item.localized_description !== null) {
this.setDescriptionLocalization(item.localized_language, item.localized_description)
this.setDescriptionLocalization(item.localized_language, item.localized_description);
}
}
return this
return this;
}
}

Expand Down

0 comments on commit f4da672

Please sign in to comment.