From 564216ee8a3649aaddae1e88145142201cbed964 Mon Sep 17 00:00:00 2001 From: admin_rb Date: Mon, 6 Apr 2026 16:21:57 +0200 Subject: [PATCH] Fixed Deprecation of Ephemeral --- buttons/honor/honor_menu_dishonor.js | 4 ++-- buttons/honor/honor_menu_history.js | 4 ++-- buttons/honor/honor_menu_honor.js | 4 ++-- buttons/honor/honor_multi_confirm.js | 4 ++-- buttons/quotes/quotes_list_left.js | 8 ++++---- buttons/quotes/quotes_list_right.js | 10 +++++----- commands/config/config.js | 6 +++--- commands/honors/honors.js | 8 ++++---- commands/nuts/nuts.js | 6 +++--- commands/quotes/quotes.js | 16 ++++++++-------- commands/social/birthday.js | 20 ++++++++++---------- events/GuildMemberAdd.js | 3 ++- events/InteractionCreate.js | 14 +++++++------- legacyCommands/nuts/nutsGive.js | 4 ++-- 14 files changed, 56 insertions(+), 55 deletions(-) diff --git a/buttons/honor/honor_menu_dishonor.js b/buttons/honor/honor_menu_dishonor.js index ed16d85..4adc90c 100644 --- a/buttons/honor/honor_menu_dishonor.js +++ b/buttons/honor/honor_menu_dishonor.js @@ -1,4 +1,4 @@ -const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js") +const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require("discord.js") const { mClient } = require("../..") require('dotenv').config() @@ -36,7 +36,7 @@ module.exports = { await interaction.reply({ embeds: [embed], components: [row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } } \ No newline at end of file diff --git a/buttons/honor/honor_menu_history.js b/buttons/honor/honor_menu_history.js index 73fd99b..3aa6611 100644 --- a/buttons/honor/honor_menu_history.js +++ b/buttons/honor/honor_menu_history.js @@ -1,4 +1,4 @@ -const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js") +const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require("discord.js") const { mClient } = require("../..") require('dotenv').config() @@ -30,7 +30,7 @@ module.exports = { await interaction.reply({ embeds: [embed], components: [select, row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } } \ No newline at end of file diff --git a/buttons/honor/honor_menu_honor.js b/buttons/honor/honor_menu_honor.js index 9fd5c19..6567005 100644 --- a/buttons/honor/honor_menu_honor.js +++ b/buttons/honor/honor_menu_honor.js @@ -1,4 +1,4 @@ -const { EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle } = require("discord.js") +const { EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle, MessageFlags } = require("discord.js") const { mClient } = require("../..") require('dotenv').config() @@ -37,7 +37,7 @@ module.exports = { await interaction.reply({ embeds: [embed], components: [row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } } \ No newline at end of file diff --git a/buttons/honor/honor_multi_confirm.js b/buttons/honor/honor_multi_confirm.js index d6199c1..4cf4734 100644 --- a/buttons/honor/honor_multi_confirm.js +++ b/buttons/honor/honor_multi_confirm.js @@ -1,4 +1,4 @@ -const { EmbedBuilder } = require("discord.js") +const { EmbedBuilder, MessageFlags } = require("discord.js") const { mClient } = require("../..") require('dotenv').config() @@ -13,7 +13,7 @@ module.exports = { } else if (temp[5] === '**Dishonor**'){ honor = -1 } else { - return await interaction.reply({content: "ERROR", ephemeral: true}) + return await interaction.reply({content: "ERROR", flags: MessageFlags.Ephemeral}) } const target = await interaction.message.guild.members.fetch(temp[3].slice(2, -1)) temp = interaction.message.embeds[0].description.split('\r\n') diff --git a/buttons/quotes/quotes_list_left.js b/buttons/quotes/quotes_list_left.js index 16c7dae..4d156fb 100644 --- a/buttons/quotes/quotes_list_left.js +++ b/buttons/quotes/quotes_list_left.js @@ -1,4 +1,4 @@ -const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder } = require("discord.js") +const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder, MessageFlags } = require("discord.js") const { mClient } = require("../..") require('dotenv').config() module.exports = { @@ -6,12 +6,12 @@ module.exports = { description: 'navigate left', async execute(interaction) { let oldEmbed = interaction.message.embeds[0].data - if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) } - if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', ephemeral: true }) } + if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) } + if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', flags: MessageFlags.Ephemeral }) } let userID = interaction.message.embeds[0].data.footer.text.split(' ')[5].slice(2, -1) const target = await interaction.guild.members.fetch(userID) - if (!target) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) } + if (!target) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) } const db = mClient.db(process.env.M_DB) const quotesColl = db.collection('items_quotes') diff --git a/buttons/quotes/quotes_list_right.js b/buttons/quotes/quotes_list_right.js index 432b28f..89b18e6 100644 --- a/buttons/quotes/quotes_list_right.js +++ b/buttons/quotes/quotes_list_right.js @@ -1,4 +1,4 @@ -const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder } = require("discord.js") +const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder, MessageFlags } = require("discord.js") const { mClient } = require("../..") require('dotenv').config() module.exports = { @@ -6,12 +6,12 @@ module.exports = { description: 'navigate right', async execute(interaction) { let oldEmbed = interaction.message.embeds[0].data - if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) } - if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', ephemeral: true }) } + if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) } + if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', flags: MessageFlags.Ephemeral }) } let userID = interaction.message.embeds[0].data.footer.text.split(' ')[5].slice(2, -1) const target = await interaction.guild.members.fetch(userID) - if (!target) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) } + if (!target) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) } const db = mClient.db(process.env.M_DB) const quotesColl = db.collection('items_quotes') @@ -19,7 +19,7 @@ module.exports = { var index = Number((await interaction.message.embeds[0].data.title).split(' ')[2].slice(1)) if (!index) { index = 0 } - //if (index >= quotes.length){ return interaction.reply({content: 'Max Quotes Reached', ephemeral: true})} + //if (index >= quotes.length){ return interaction.reply({content: 'Max Quotes Reached', flags: MessageFlags.Ephemeral})} if (index >= quotes.length) { index-- } // will automatically reflect the next index due to how arrays think diff --git a/commands/config/config.js b/commands/config/config.js index 0c521d8..3b72d92 100644 --- a/commands/config/config.js +++ b/commands/config/config.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, Events } = require('discord.js') +const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js') const { mClient } = require('../..') require('dotenv').config() @@ -21,7 +21,7 @@ async function channelSet(interaction) { }) return await interaction.editReply({ - content: `Set <#${channel.id}> as ${purpose} channel!`, ephemeral: true + content: `Set <#${channel.id}> as ${purpose} channel!`, flags: MessageFlags.Ephemeral }) } async function channelSimulate(interaction) { @@ -42,7 +42,7 @@ async function channelSimulate(interaction) { default: break; } - return interaction.reply({ content: 'Done.', ephemeral: true }) + return interaction.reply({ content: 'Done.', flags: MessageFlags.Ephemeral }) } async function roleSet(interaction) { const guild = interaction.guild diff --git a/commands/honors/honors.js b/commands/honors/honors.js index 17f5430..7b297db 100644 --- a/commands/honors/honors.js +++ b/commands/honors/honors.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder } = require('discord.js') +const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js') const { mClient } = require('../..') require('dotenv').config() function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -35,7 +35,7 @@ async function honorHoner(interaction) { await interaction.reply({ embeds: [embed], components: [row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } async function honerDishonor(interaction) { @@ -69,7 +69,7 @@ async function honerDishonor(interaction) { await interaction.reply({ embeds: [embed], components: [row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } async function honorLeaderboard(interaction) { @@ -201,7 +201,7 @@ async function honorMenu(interaction) { await interaction.reply({ embeds: [embed], components: [select, row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } module.exports = { diff --git a/commands/nuts/nuts.js b/commands/nuts/nuts.js index 1fb4993..0a49cab 100644 --- a/commands/nuts/nuts.js +++ b/commands/nuts/nuts.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js') +const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require('discord.js') const { mClient } = require('../..') require('dotenv').config() function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -31,7 +31,7 @@ async function nutsGive(interaction) { await interaction.reply({ embeds: [embed], components: [row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } const from = interaction.user @@ -49,7 +49,7 @@ async function nutsGive(interaction) { if (yourBalance.nuts < amount) { return await interaction.reply({ content: 'Du kannst nicht mehr geben als du hast!', - ephemeral: true + flags: MessageFlags.Ephemeral }) } return tradeWindow('nuts_give_confirm', 'abort') diff --git a/commands/quotes/quotes.js b/commands/quotes/quotes.js index c5327e9..26ff88c 100644 --- a/commands/quotes/quotes.js +++ b/commands/quotes/quotes.js @@ -2,7 +2,7 @@ Random By Year? Counter (Leaderboard) */ -const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder } = require('discord.js') +const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js') const { mClient } = require('../..') require('dotenv').config() function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -15,7 +15,7 @@ async function quotesAdd(interaction) { if (!messageLink.match(regex)) { return await interaction.editReply({ content: `Invalid URL`, - ephemeral: true + flags: MessageFlags.Ephemeral }) } @@ -50,7 +50,7 @@ async function quotesAdd(interaction) { const db = mClient.db(process.env.M_DB) const quotesColl = db.collection('items_quotes') const found = await quotesColl.findOne({ messageID: messageID }) - if (found) { return await interaction.editReply({ content: 'Quote Already in Database', ephemeral: true }) } + if (found) { return await interaction.editReply({ content: 'Quote Already in Database', flags: MessageFlags.Ephemeral }) } await quotesColl.findOneAndUpdate({ messageID: messageID }, { $set: { messageID: messageID, @@ -89,18 +89,18 @@ async function quotesRemove(interaction) { const db = mClient.db(process.env.M_DB) const quotesColl = db.collection('items_quotes') const found = await quotesColl.findOne({ messageID: id }) - if (!found) { return await interaction.reply({ content: 'ID not found!', ephemeral: true }) } + if (!found) { return await interaction.reply({ content: 'ID not found!', flags: MessageFlags.Ephemeral }) } await quotesColl.deleteOne({ messageID: id }) - return interaction.reply({ content: 'Quote successfully removed!', ephemeral: true }) + return interaction.reply({ content: 'Quote successfully removed!', flags: MessageFlags.Ephemeral }) } async function quotesSearch(interaction) { const id = interaction.options.getString("id") const db = mClient.db(process.env.M_DB) const quotesColl = db.collection('items_quotes') const found = await quotesColl.findOne({ messageID: id }) - if (!found) { return await interaction.reply({ content: 'ID not found!', ephemeral: true }) } + if (!found) { return await interaction.reply({ content: 'ID not found!', flags: MessageFlags.Ephemeral }) } const guild = await interaction.client.guilds.fetch(found.guildID) @@ -176,7 +176,7 @@ async function quotesRandom(interaction) { ]).toArray() } const found = rdm[0] - if (!found) { return await interaction.reply({ content: 'Database Empty', ephemeral: true }) } + if (!found) { return await interaction.reply({ content: 'Database Empty', flags: MessageFlags.Ephemeral }) } const guild = await interaction.client.guilds.fetch(found.guildID) const channel = await guild.channels.fetch(found.channelID) const message = await channel.messages.fetch(found.messageID) @@ -263,7 +263,7 @@ async function quotesList(interaction) { await interaction.reply({ embeds: [embed], components: [select, row], - ephemeral: true + flags: MessageFlags.Ephemeral }) } diff --git a/commands/social/birthday.js b/commands/social/birthday.js index f9b9997..1ea7e90 100644 --- a/commands/social/birthday.js +++ b/commands/social/birthday.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, EmbedBuilder } = require('discord.js') +const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js') const { mClient } = require('../..') const { configDotenv } = require('dotenv') configDotenv() @@ -40,7 +40,7 @@ async function birthdayAdd(interaction) { if (!isValidDate(day, month)) { - return interaction.reply({ content: "Invalid Date", ephemeral: true }) + return interaction.reply({ content: "Invalid Date", flags: MessageFlags.Ephemeral }) } const db = mClient.db(process.env.M_DB) @@ -48,7 +48,7 @@ async function birthdayAdd(interaction) { const found = await bdayColl.findOne({ userID: target.id }) if (found) { - return interaction.reply({ content: "Already in Database", ephemeral: true }) + return interaction.reply({ content: "Already in Database", flags: MessageFlags.Ephemeral }) } const data = { @@ -81,7 +81,7 @@ async function birthdayDelete(interaction) { const found = await bdayColl.findOne({ userID: target.id }) if (!found) { - return interaction.reply({ content: "Not yet in Database", ephemeral: true }) + return interaction.reply({ content: "Not yet in Database", flags: MessageFlags.Ephemeral }) } const res = await bdayColl.deleteOne({ userID: target.id }) @@ -98,7 +98,7 @@ async function birthdayEdit(interaction) { if (!isValidDate(day, month)) { - return interaction.reply({ content: "Invalid Date", ephemeral: true }) + return interaction.reply({ content: "Invalid Date", flags: MessageFlags.Ephemeral }) } const db = mClient.db(process.env.M_DB) @@ -106,7 +106,7 @@ async function birthdayEdit(interaction) { const found = await bdayColl.findOne({ userID: target.id }) if (!found) { - return interaction.reply({ content: "Not yet in Database", ephemeral: true }) + return interaction.reply({ content: "Not yet in Database", flags: MessageFlags.Ephemeral }) } const data = { @@ -147,7 +147,7 @@ async function birthdayGet(interaction) { const found = await bdayColl.findOne({ userID: target.id }) if (!found) { - return interaction.reply({ content: "Not in Database!", ephemeral: true }) + return interaction.reply({ content: "Not in Database!", flags: MessageFlags.Ephemeral }) } let unix if(isDateInPast(found.day,found.month)){ @@ -226,7 +226,7 @@ module.exports = { if (!interaction.member.permissions.has("ADMINISTRATOR")) { return await interaction.reply({ content: "Unprivileged Access!", - ephemeral: true + flags: MessageFlags.Ephemeral }) } birthdayAdd(interaction) @@ -235,7 +235,7 @@ module.exports = { if (!interaction.member.permissions.has("ADMINISTRATOR")) { return await interaction.reply({ content: "Unprivileged Access!", - ephemeral: true + flags: MessageFlags.Ephemeral }) } birthdayDelete(interaction) @@ -244,7 +244,7 @@ module.exports = { if (!interaction.member.permissions.has("ADMINISTRATOR")) { return await interaction.reply({ content: "Unprivileged Access!", - ephemeral: true + flags: MessageFlags.Ephemeral }) } birthdayEdit(interaction) diff --git a/events/GuildMemberAdd.js b/events/GuildMemberAdd.js index 271b6b2..d19b089 100644 --- a/events/GuildMemberAdd.js +++ b/events/GuildMemberAdd.js @@ -79,7 +79,8 @@ module.exports = { // Draw the second line of text with black outline ctx.strokeText(text, textX, 100 + pfp.height); ctx.fillText(text, textX, 100 + pfp.height); - + const banner = canvas.toBuffer(); + channel.send({ content: `Bitte guck einmal in die <#455023824791011338> ${member}`, files: [{ diff --git a/events/InteractionCreate.js b/events/InteractionCreate.js index 3dc8e34..df209c8 100644 --- a/events/InteractionCreate.js +++ b/events/InteractionCreate.js @@ -1,4 +1,4 @@ -const { Events } = require('discord.js') +const { Events, MessageFlags } = require('discord.js') module.exports = { name: Events.InteractionCreate, @@ -22,9 +22,9 @@ async function commandHandler(interaction) { } catch (error) { console.error(error); if (interaction.replied || interaction.deferred) { - await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.followUp({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral }); } else { - await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.reply({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral }); } } } @@ -36,9 +36,9 @@ async function buttonHandler(interaction) { } catch (error) { console.error(error); if (interaction.replied || interaction.deferred) { - await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.followUp({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral }); } else { - await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.reply({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral }); } } } @@ -50,9 +50,9 @@ async function selectMenuHandler(interaction) { } catch (error) { console.error(error); if (interaction.replied || interaction.deferred) { - await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.followUp({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral }); } else { - await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.reply({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral }); } } } \ No newline at end of file diff --git a/legacyCommands/nuts/nutsGive.js b/legacyCommands/nuts/nutsGive.js index 7bd94e3..aef3d50 100644 --- a/legacyCommands/nuts/nutsGive.js +++ b/legacyCommands/nuts/nutsGive.js @@ -1,4 +1,4 @@ -const { EmbedBuilder } = require('discord.js') +const { EmbedBuilder, MessageFlags } = require('discord.js') const { mClient } = require('../../index') function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } require('dotenv').config() @@ -58,7 +58,7 @@ module.exports = { if (yourBalance.nuts < amount) { return await message.reply({ content: 'Du kannst nicht mehr geben als du hast!', - ephemeral: true + flags: MessageFlags.Ephemeral }) } var content = `Du sendest **${amount}** NĂ¼sse an <@${target.id}>`