Fix: Replace deprecated ephemeral with MessageFlags.Ephemeral
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 6s
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 6s
Fixes Discord.js v14 deprecation warning by replacing all ephemeral: true usages with flags: [MessageFlags.Ephemeral]. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, GuildMember } from 'discord.js';
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, GuildMember, MessageFlags } from 'discord.js';
|
||||
import { Command } from '../../structures/Command.js';
|
||||
|
||||
const command: Command = {
|
||||
@@ -136,12 +136,12 @@ const command: Command = {
|
||||
const reason = interaction.options.getString('reason') ?? 'Kein Grund';
|
||||
|
||||
if (!target) {
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
if (!target.kickable) {
|
||||
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht kicken.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht kicken.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ const command: Command = {
|
||||
await interaction.reply(`✅ Gekickt: ${target.user.tag}\nGrund: ${reason}`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply({ content: '❌ Fehler beim Kicken.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Fehler beim Kicken.', flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ const command: Command = {
|
||||
const reason = interaction.options.getString('reason')!;
|
||||
|
||||
if (!target) {
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ const command: Command = {
|
||||
const target = interaction.options.getMember('target') as GuildMember;
|
||||
|
||||
if (!target) {
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ const command: Command = {
|
||||
);
|
||||
|
||||
if (!latestWarn) {
|
||||
await interaction.reply({ content: 'Keine Warnung für diesen Nutzer gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Keine Warnung für diesen Nutzer gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ const command: Command = {
|
||||
const reason = interaction.options.getString('reason') ?? 'Kein Grund';
|
||||
|
||||
if (!target) {
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ const command: Command = {
|
||||
|
||||
const multiplier = unitSeconds[unit!];
|
||||
if (!multiplier) {
|
||||
await interaction.reply({ content: '❌ Ungültige Zeiteinheit.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Ungültige Zeiteinheit.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ const command: Command = {
|
||||
};
|
||||
durationText = `${duration} ${unitNames[unit!]}`;
|
||||
} else {
|
||||
await interaction.reply({ content: '❌ Dauer oder Zeiteinheit angeben.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Dauer oder Zeiteinheit angeben.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ const command: Command = {
|
||||
await interaction.reply(`✅ Gemuted: ${target.user.tag}\nDauer: ${durationText}\nGrund: ${reason}`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply({ content: '❌ Fehler beim Muten.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Fehler beim Muten.', flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -305,7 +305,7 @@ const command: Command = {
|
||||
const target = interaction.options.getMember('target') as GuildMember;
|
||||
|
||||
if (!target) {
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ const command: Command = {
|
||||
await interaction.reply(`✅ Entmutet: ${target.user.tag}`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply({ content: '❌ Fehler beim Entmuten.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Fehler beim Entmuten.', flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -325,12 +325,12 @@ const command: Command = {
|
||||
const deleteDays = interaction.options.getInteger('delete_days') ?? 0;
|
||||
|
||||
if (!target) {
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
if (!target.bannable) {
|
||||
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht bannen.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht bannen.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ const command: Command = {
|
||||
await interaction.reply(`✅ Gebannt: ${target.user.tag}\nGrund: ${reason}`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply({ content: '❌ Fehler beim Bannen.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Fehler beim Bannen.', flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ const command: Command = {
|
||||
await interaction.reply(`✅ Entbannt: ${targetId}`);
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
await interaction.reply({ content: `❌ Fehler beim Entbannen: ${error.message}`, ephemeral: true });
|
||||
await interaction.reply({ content: `❌ Fehler beim Entbannen: ${error.message}`, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -376,14 +376,14 @@ const command: Command = {
|
||||
{ name: 'Mute-Dauer', value: `${(settings?.warn_mute_duration ?? 1800) / 60} Min`, inline: true }
|
||||
);
|
||||
|
||||
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
if (setting === 'warn_threshold') {
|
||||
const threshold = parseInt(value!);
|
||||
if (isNaN(threshold) || threshold < 1) {
|
||||
await interaction.reply({ content: '❌ Ungültiger Wert. Mindestens 1.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Ungültiger Wert. Mindestens 1.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
DB.run('UPDATE guild_settings SET warn_threshold = ? WHERE guild_id = ?', threshold, guildId);
|
||||
@@ -394,7 +394,7 @@ const command: Command = {
|
||||
if (setting === 'warn_action') {
|
||||
const validActions = ['none', 'kick', 'mute', 'ban'];
|
||||
if (!validActions.includes(value!)) {
|
||||
await interaction.reply({ content: `❌ Ungültige Aktion. Möglich: ${validActions.join(', ')}`, ephemeral: true });
|
||||
await interaction.reply({ content: `❌ Ungültige Aktion. Möglich: ${validActions.join(', ')}`, flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
DB.run('UPDATE guild_settings SET warn_action = ? WHERE guild_id = ?', value, guildId);
|
||||
@@ -405,7 +405,7 @@ const command: Command = {
|
||||
if (setting === 'warn_mute_duration') {
|
||||
const duration = durationValue ?? 1800;
|
||||
if (duration < 0) {
|
||||
await interaction.reply({ content: '❌ Ungültige Dauer.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Ungültige Dauer.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
DB.run('UPDATE guild_settings SET warn_mute_duration = ? WHERE guild_id = ?', duration, guildId);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
|
||||
import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits, MessageFlags } from 'discord.js';
|
||||
import { Command } from '../../structures/Command.js';
|
||||
|
||||
const command: Command = {
|
||||
@@ -52,7 +52,7 @@ const command: Command = {
|
||||
}
|
||||
}
|
||||
|
||||
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
|
||||
import { SlashCommandBuilder, EmbedBuilder, MessageFlags } from 'discord.js';
|
||||
import { Command } from '../../structures/Command.js';
|
||||
import { Deployer } from '../../structures/Deployer.js';
|
||||
|
||||
@@ -24,14 +24,14 @@ const command: Command = {
|
||||
if (!client.application?.owner) await client.application?.fetch();
|
||||
|
||||
if (interaction.user.id !== client.application?.owner?.id) {
|
||||
await interaction.reply({ content: 'Keine Berechtigung.', ephemeral: true });
|
||||
await interaction.reply({ content: 'Keine Berechtigung.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
|
||||
if (subcommand === 'deploy') {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
||||
|
||||
try {
|
||||
const count = await Deployer.deploy(client.user!.id, client.token!);
|
||||
@@ -44,7 +44,7 @@ const command: Command = {
|
||||
}
|
||||
|
||||
if (subcommand === 'stats') {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
||||
|
||||
const uptime = process.uptime();
|
||||
const days = Math.floor(uptime / 86400);
|
||||
@@ -69,7 +69,7 @@ const command: Command = {
|
||||
}
|
||||
|
||||
if (subcommand === 'servers') {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
||||
|
||||
const guilds = client.guilds.cache.map((guild: any) =>
|
||||
`• **${guild.name}** \`(${guild.id})\` - ${guild.memberCount} Mitglieder`
|
||||
@@ -97,7 +97,7 @@ const command: Command = {
|
||||
const nextEmbed = new EmbedBuilder()
|
||||
.setColor(0xf1c40f)
|
||||
.setDescription(chunks[i].substring(0, 4000));
|
||||
await interaction.followUp({ embeds: [nextEmbed], ephemeral: true });
|
||||
await interaction.followUp({ embeds: [nextEmbed], flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } from 'discord.js';
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from 'discord.js';
|
||||
import { Command } from '../../structures/Command.js';
|
||||
import { TwitchManager } from '../../structures/TwitchManager.js';
|
||||
|
||||
@@ -94,7 +94,7 @@ const command: Command = {
|
||||
|
||||
// Admin only
|
||||
if (!isAdmin) {
|
||||
await interaction.reply({ content: '❌ Keine Berechtigung.', ephemeral: true });
|
||||
await interaction.reply({ content: '❌ Keine Berechtigung.', flags: [MessageFlags.Ephemeral] });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user