diff --git a/README.md b/README.md index f0fef2f..0ad5d70 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ Clone the repository, `cd` into it and run `npm install`. - [x] Random Gifs - [x] Role Assignment - [x] Table of Contents generation -- [x] TextGears - [x] Timetable - [x] Timetable Reminders - [x] User info @@ -40,7 +39,6 @@ The only required value is `botToken`, which you can get from the [Discord Devel ```json { - "textgears_api_key": "", "tenor": { "Key": "", "Filter": "off", diff --git a/events/messageCreate.ts b/events/messageCreate.ts index f281cb8..8aeda78 100644 --- a/events/messageCreate.ts +++ b/events/messageCreate.ts @@ -1,5 +1,4 @@ import { EmbedBuilder, MessageCreateOptions, MessagePayload, TextChannel } from 'discord.js' -import textgears from 'textgears-api' import tx2 from 'tx2' import { DiscordClient, DiscordMessage } from '../types/customTypes' @@ -91,14 +90,6 @@ exports.run = (client: DiscordClient, message: DiscordMessage) => { } } - /** - * Annoy people :) - */ - const channel = message.channel as TextChannel - if (channel.parentId === '773683524833902632' && message.author.id === client.config.ids.userID.david) { - check_spelling(client, message) - } - /** * DM handling and forwarding. */ @@ -143,69 +134,6 @@ exports.run = (client: DiscordClient, message: DiscordMessage) => { } } -/** - * Just a small function to annoy a friend ;) - * @param {Discordlient} client Discord-Client - * @param {DiscordMessage} message Message to scan - */ -function check_spelling(client: DiscordClient, message: DiscordMessage) { - if (!client.config.sensitive.textgears_api_key) { - console.error('client.config.sensitive.textgears_api_key is undefined') - return - } - const test_query = message.toString() - - const textgearsApi = textgears(client.config.sensitive.textgears_api_key, { language: 'de-DE', ai: false }) - textgearsApi - .checkGrammar(test_query) - .then(async return_data => { - if (return_data.response.errors.length > 0) { - /** - * Message to do better next time - */ - await message.reply({ - embeds: [ - new EmbedBuilder() - .setTitle('⚠FEHLER ENTDECKT!!⚠') - .setThumbnail('https://www.duden.de/modules/custom/duden_og_image/images/Duden_FB_Profilbild.jpg') - .setDescription('Das nächste Mal bitte vorher auf Rechtschreibung überprüfen'), - ], - }) - /** - * Loop over all suggestions - */ - for (const error of return_data.response.errors) { - /** - * Nicely formatted list of links to duden.de entries - */ - let suggestion_links = `__Verbesserungen__:\n` - for (const suggestion of error.better) { - suggestion_links += `- **__[${suggestion}](https://duden.de/rechtschreibung/${suggestion})__**\n` - } - /** - * Send embed with all the suggestions for one error - */ - const embed = new EmbedBuilder() - .setTitle(`Fehler: ${error.bad}`) - .setAuthor({ - name: '⚠Fehler Verbesserung⚠', - iconURL: 'https://www.duden.de/modules/custom/duden_og_image/images/Duden_FB_Profilbild.jpg', - }) - .setThumbnail('https://www.duden.de/modules/custom/duden_og_image/images/Duden_FB_Profilbild.jpg') - .setDescription(suggestion_links) - .setFooter({ - text: 'Du hast einen physischen Duden, also nutze ihn ;)', - }) - .setTimestamp() - // eslint-disable-next-line no-await-in-loop - await message.reply({ embeds: [embed] }) - } - } - }) - .catch(err => { - throw new Error(err) - }) -} /** * A function for splitting a string into fixed-length parts. Designed as a diff --git a/package.json b/package.json index 89c4e3c..b62ed45 100644 --- a/package.json +++ b/package.json @@ -11,34 +11,33 @@ "homepage": "https://github.com/Chr1s70ph/ETIT-Master-JS#readme", "author": "Christoph Bluem", "dependencies": { - "@discordjs/rest": "^2.2.0", - "discord-api-types": "^0.37.70", - "discord.js": "^14.14.1", + "@discordjs/rest": "^2.0.0", + "discord-api-types": "^0.37.79", + "discord.js": "^14.12.1", "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.8.2", + "i18next": "^23.11.2", "i18next-fs-backend": "^2.3.1", "luxon": "^3.4.4", "moment": "^2.30.1", "moment-timezone": "^0.5.45", - "node-ical": "^0.17.2", + "node-ical": "^0.18.0", "node-schedule": "^2.1.1", - "openai": "^4.28.0", + "openai": "^4.36.0", "os": "^0.1.2", "pm2": "^5.3.1", "tenorjs": "^1.0.10", - "textgears-api": "^1.1.11", "tx2": "^1.0.5", "valid-url": "^1.0.9" }, "devDependencies": { - "@types/node-schedule": "^2.1.6", + "@types/node-schedule": "^2.1.7", "@types/tx2": "^1.0.3", - "@typescript-eslint/eslint-plugin": "^7.0.1", - "@typescript-eslint/parser": "^7.0.1", - "eslint": "^8.56.0" + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", + "eslint": "^9.0.0" } } diff --git a/types/customTypes.ts b/types/customTypes.ts index 1bfadd1..aaed5f1 100644 --- a/types/customTypes.ts +++ b/types/customTypes.ts @@ -385,7 +385,6 @@ interface config_settings_typing { } interface config_sensitive_typing { - textgears_api_key?: string tenor?: { Key: string Filter: string