Fix TypeScript errors and refactor MessageFlags to use ephemeral flag
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 7s
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 7s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, GuildMember, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, GuildMember } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
import { ExtendedClient } from '../../structures/ExtendedClient.js';
|
import { ExtendedClient } from '../../structures/ExtendedClient.js';
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,12 +238,12 @@ const command: Command = {
|
|||||||
const reason = interaction.options.getString('reason') ?? 'Kein Grund';
|
const reason = interaction.options.getString('reason') ?? 'Kein Grund';
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.kickable) {
|
if (!target.kickable) {
|
||||||
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht kicken.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht kicken.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ const command: Command = {
|
|||||||
await sendModerationLog(interaction.client, guildId, 'kicks', embed);
|
await sendModerationLog(interaction.client, guildId, 'kicks', embed);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.reply({ content: '❌ Fehler beim Kicken.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Fehler beim Kicken.', ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ const command: Command = {
|
|||||||
const reason = interaction.options.getString('reason')!;
|
const reason = interaction.options.getString('reason')!;
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ const command: Command = {
|
|||||||
const target = interaction.options.getMember('target') as GuildMember;
|
const target = interaction.options.getMember('target') as GuildMember;
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!latestWarn) {
|
if (!latestWarn) {
|
||||||
await interaction.reply({ content: 'Keine Warnung für diesen Nutzer gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Warnung für diesen Nutzer gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ const command: Command = {
|
|||||||
const reason = interaction.options.getString('reason') ?? 'Kein Grund';
|
const reason = interaction.options.getString('reason') ?? 'Kein Grund';
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +394,7 @@ const command: Command = {
|
|||||||
|
|
||||||
const multiplier = unitSeconds[unit!];
|
const multiplier = unitSeconds[unit!];
|
||||||
if (!multiplier) {
|
if (!multiplier) {
|
||||||
await interaction.reply({ content: '❌ Ungültige Zeiteinheit.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Ungültige Zeiteinheit.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ const command: Command = {
|
|||||||
};
|
};
|
||||||
durationText = `${duration} ${unitNames[unit!]}`;
|
durationText = `${duration} ${unitNames[unit!]}`;
|
||||||
} else {
|
} else {
|
||||||
await interaction.reply({ content: '❌ Dauer oder Zeiteinheit angeben.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Dauer oder Zeiteinheit angeben.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,7 +433,7 @@ const command: Command = {
|
|||||||
await sendModerationLog(interaction.client, guildId, 'mutes', embed);
|
await sendModerationLog(interaction.client, guildId, 'mutes', embed);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.reply({ content: '❌ Fehler beim Muten.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Fehler beim Muten.', ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -442,7 +442,7 @@ const command: Command = {
|
|||||||
const target = interaction.options.getMember('target') as GuildMember;
|
const target = interaction.options.getMember('target') as GuildMember;
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ const command: Command = {
|
|||||||
await interaction.reply(`✅ Entmutet: ${target.user.tag}`);
|
await interaction.reply(`✅ Entmutet: ${target.user.tag}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.reply({ content: '❌ Fehler beim Entmuten.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Fehler beim Entmuten.', ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -462,12 +462,12 @@ const command: Command = {
|
|||||||
const deleteDays = interaction.options.getInteger('delete_days') ?? 0;
|
const deleteDays = interaction.options.getInteger('delete_days') ?? 0;
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
await interaction.reply({ content: 'Nutzer nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Nutzer nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!target.bannable) {
|
if (!target.bannable) {
|
||||||
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht bannen.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Ich kann diesen Nutzer nicht bannen.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,7 +488,7 @@ const command: Command = {
|
|||||||
await sendModerationLog(interaction.client, guildId, 'bans', embed);
|
await sendModerationLog(interaction.client, guildId, 'bans', embed);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.reply({ content: '❌ Fehler beim Bannen.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Fehler beim Bannen.', ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -505,7 +505,7 @@ const command: Command = {
|
|||||||
await interaction.reply(`✅ Entbannt: ${targetId}`);
|
await interaction.reply(`✅ Entbannt: ${targetId}`);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.reply({ content: `❌ Fehler beim Entbannen: ${error.message}`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `❌ Fehler beim Entbannen: ${error.message}`, ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -525,14 +525,14 @@ const command: Command = {
|
|||||||
{ name: 'Mute-Dauer', value: `${(settings?.warn_mute_duration ?? 1800) / 60} Min`, inline: true }
|
{ name: 'Mute-Dauer', value: `${(settings?.warn_mute_duration ?? 1800) / 60} Min`, inline: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting === 'warn_threshold') {
|
if (setting === 'warn_threshold') {
|
||||||
const threshold = parseInt(value!);
|
const threshold = parseInt(value!);
|
||||||
if (isNaN(threshold) || threshold < 1) {
|
if (isNaN(threshold) || threshold < 1) {
|
||||||
await interaction.reply({ content: '❌ Ungültiger Wert. Mindestens 1.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Ungültiger Wert. Mindestens 1.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DB.run('UPDATE guild_settings SET warn_threshold = ? WHERE guild_id = ?', threshold, guildId);
|
DB.run('UPDATE guild_settings SET warn_threshold = ? WHERE guild_id = ?', threshold, guildId);
|
||||||
@@ -543,7 +543,7 @@ const command: Command = {
|
|||||||
if (setting === 'warn_action') {
|
if (setting === 'warn_action') {
|
||||||
const validActions = ['none', 'kick', 'mute', 'ban'];
|
const validActions = ['none', 'kick', 'mute', 'ban'];
|
||||||
if (!validActions.includes(value!)) {
|
if (!validActions.includes(value!)) {
|
||||||
await interaction.reply({ content: `❌ Ungültige Aktion. Möglich: ${validActions.join(', ')}`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `❌ Ungültige Aktion. Möglich: ${validActions.join(', ')}`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DB.run('UPDATE guild_settings SET warn_action = ? WHERE guild_id = ?', value, guildId);
|
DB.run('UPDATE guild_settings SET warn_action = ? WHERE guild_id = ?', value, guildId);
|
||||||
@@ -554,7 +554,7 @@ const command: Command = {
|
|||||||
if (setting === 'warn_mute_duration') {
|
if (setting === 'warn_mute_duration') {
|
||||||
const duration = durationValue ?? 1800;
|
const duration = durationValue ?? 1800;
|
||||||
if (duration < 0) {
|
if (duration < 0) {
|
||||||
await interaction.reply({ content: '❌ Ungültige Dauer.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Ungültige Dauer.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DB.run('UPDATE guild_settings SET warn_mute_duration = ? WHERE guild_id = ?', duration, guildId);
|
DB.run('UPDATE guild_settings SET warn_mute_duration = ? WHERE guild_id = ?', duration, guildId);
|
||||||
@@ -570,12 +570,12 @@ const command: Command = {
|
|||||||
const channel = interaction.channel;
|
const channel = interaction.channel;
|
||||||
|
|
||||||
if (!channel || !channel.isTextBased()) {
|
if (!channel || !channel.isTextBased()) {
|
||||||
await interaction.reply({ content: '❌ Dieser Befehl kann nur in Text-Channels verwendet werden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Dieser Befehl kann nur in Text-Channels verwendet werden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defer reply since bulk delete can take time
|
// Defer reply since bulk delete can take time
|
||||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
|
|
||||||
let deletedCount = 0;
|
let deletedCount = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
@@ -52,7 +52,7 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
|
|
||||||
const AVAILABLE_EVENTS = [
|
const AVAILABLE_EVENTS = [
|
||||||
@@ -75,13 +75,13 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Admin only for all commands
|
// Admin only for all commands
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ const command: Command = {
|
|||||||
guildId
|
guildId
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Log-Kanal auf ${channel} gesetzt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Log-Kanal auf ${channel} gesetzt.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ const command: Command = {
|
|||||||
const currentEvents = (settings?.log_events || '').split(',').filter(Boolean);
|
const currentEvents = (settings?.log_events || '').split(',').filter(Boolean);
|
||||||
|
|
||||||
if (currentEvents.includes(event)) {
|
if (currentEvents.includes(event)) {
|
||||||
await interaction.reply({ content: `ℹ️ Event **${event}** ist bereits aktiviert.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `ℹ️ Event **${event}** ist bereits aktiviert.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ const command: Command = {
|
|||||||
guildId
|
guildId
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Event **${event}** aktiviert.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Event **${event}** aktiviert.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ const command: Command = {
|
|||||||
const currentEvents = (settings?.log_events || '').split(',').filter(Boolean);
|
const currentEvents = (settings?.log_events || '').split(',').filter(Boolean);
|
||||||
|
|
||||||
if (!currentEvents.includes(event)) {
|
if (!currentEvents.includes(event)) {
|
||||||
await interaction.reply({ content: `ℹ️ Event **${event}** ist nicht aktiviert.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `ℹ️ Event **${event}** ist nicht aktiviert.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ const command: Command = {
|
|||||||
guildId
|
guildId
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Event **${event}** deaktiviert.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Event **${event}** deaktiviert.`, ephemeral: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, EmbedBuilder, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
import { Deployer } from '../../structures/Deployer.js';
|
import { Deployer } from '../../structures/Deployer.js';
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ const command: Command = {
|
|||||||
if (!client.application?.owner) await client.application?.fetch();
|
if (!client.application?.owner) await client.application?.fetch();
|
||||||
|
|
||||||
if (interaction.user.id !== client.application?.owner?.id) {
|
if (interaction.user.id !== client.application?.owner?.id) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,12 +46,12 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'deploy') {
|
if (subcommand === 'deploy') {
|
||||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const count = await Deployer.deploy(client.user!.id, client.token!);
|
const count = await Deployer.deploy(client.user!.id, client.token!);
|
||||||
@@ -64,7 +64,7 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'stats') {
|
if (subcommand === 'stats') {
|
||||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
|
|
||||||
const uptime = process.uptime();
|
const uptime = process.uptime();
|
||||||
const days = Math.floor(uptime / 86400);
|
const days = Math.floor(uptime / 86400);
|
||||||
@@ -89,7 +89,7 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'servers') {
|
if (subcommand === 'servers') {
|
||||||
await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
|
|
||||||
const guilds = client.guilds.cache.map((guild: any) =>
|
const guilds = client.guilds.cache.map((guild: any) =>
|
||||||
`• **${guild.name}** \`(${guild.id})\` - ${guild.memberCount} Mitglieder`
|
`• **${guild.name}** \`(${guild.id})\` - ${guild.memberCount} Mitglieder`
|
||||||
@@ -117,7 +117,7 @@ const command: Command = {
|
|||||||
const nextEmbed = new EmbedBuilder()
|
const nextEmbed = new EmbedBuilder()
|
||||||
.setColor(0xf1c40f)
|
.setColor(0xf1c40f)
|
||||||
.setDescription(chunks[i].substring(0, 4000));
|
.setDescription(chunks[i].substring(0, 4000));
|
||||||
await interaction.followUp({ embeds: [nextEmbed], flags: [MessageFlags.Ephemeral] });
|
await interaction.followUp({ embeds: [nextEmbed], ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags, ChannelType, ComponentType, StringSelectMenuBuilder, StringSelectMenuOptionBuilder } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, ChannelType, ComponentType, StringSelectMenuBuilder, StringSelectMenuOptionBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
|
|
||||||
async function updateRoleMessage(client: any, category: any) {
|
async function updateRoleMessage(client: any, category: any) {
|
||||||
@@ -156,7 +156,7 @@ const command: Command = {
|
|||||||
const categories: any[] = DB.all('SELECT * FROM role_categories WHERE guild_id = ? ORDER BY category_name ASC', guildId);
|
const categories: any[] = DB.all('SELECT * FROM role_categories WHERE guild_id = ? ORDER BY category_name ASC', guildId);
|
||||||
|
|
||||||
if (categories.length === 0) {
|
if (categories.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Rollen-Kategorien konfiguriert.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Rollen-Kategorien konfiguriert.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,13 +180,13 @@ const command: Command = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'create') {
|
if (subcommand === 'create') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ const command: Command = {
|
|||||||
|
|
||||||
const existing = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, categoryName);
|
const existing = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, categoryName);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
await interaction.reply({ content: `Kategorie "${categoryName}" existiert bereits.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${categoryName}" existiert bereits.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,13 +211,13 @@ const command: Command = {
|
|||||||
categoryName
|
categoryName
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ content: `Kategorie "${categoryName}" erstellt in ${channel}.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${categoryName}" erstellt in ${channel}.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'add') {
|
if (subcommand === 'add') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,13 +227,13 @@ const command: Command = {
|
|||||||
|
|
||||||
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
||||||
if (!category) {
|
if (!category) {
|
||||||
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const existing = DB.get('SELECT * FROM role_options WHERE category_id = ? AND role_id = ?', category.id, role.id);
|
const existing = DB.get('SELECT * FROM role_options WHERE category_id = ? AND role_id = ?', category.id, role.id);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
await interaction.reply({ content: `Rolle ${role.name} ist bereits in "${kategorie}".`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Rolle ${role.name} ist bereits in "${kategorie}".`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,13 +248,13 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await updateRoleMessage(interaction.client, category);
|
await updateRoleMessage(interaction.client, category);
|
||||||
await interaction.reply({ content: `${role.name} zu "${kategorie}" hinzugefügt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `${role.name} zu "${kategorie}" hinzugefügt.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'edit') {
|
if (subcommand === 'edit') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,13 +265,13 @@ const command: Command = {
|
|||||||
|
|
||||||
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
||||||
if (!category) {
|
if (!category) {
|
||||||
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const option: any = DB.get('SELECT * FROM role_options WHERE category_id = ? AND role_id = ?', category.id, oldRole.id);
|
const option: any = DB.get('SELECT * FROM role_options WHERE category_id = ? AND role_id = ?', category.id, oldRole.id);
|
||||||
if (!option) {
|
if (!option) {
|
||||||
await interaction.reply({ content: `Rolle ${oldRole.name} ist nicht in "${kategorie}".`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Rolle ${oldRole.name} ist nicht in "${kategorie}".`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,13 +288,13 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await updateRoleMessage(interaction.client, category);
|
await updateRoleMessage(interaction.client, category);
|
||||||
await interaction.reply({ content: `Option in "${kategorie}" aktualisiert.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Option in "${kategorie}" aktualisiert.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'remove') {
|
if (subcommand === 'remove') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,13 +303,13 @@ const command: Command = {
|
|||||||
|
|
||||||
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
||||||
if (!category) {
|
if (!category) {
|
||||||
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const option: any = DB.get('SELECT * FROM role_options WHERE category_id = ? AND role_id = ?', category.id, role.id);
|
const option: any = DB.get('SELECT * FROM role_options WHERE category_id = ? AND role_id = ?', category.id, role.id);
|
||||||
if (!option) {
|
if (!option) {
|
||||||
await interaction.reply({ content: `Rolle ${role.name} ist nicht in "${kategorie}".`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Rolle ${role.name} ist nicht in "${kategorie}".`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,13 +326,13 @@ const command: Command = {
|
|||||||
|
|
||||||
DB.run('DELETE FROM role_options WHERE id = ?', option.id);
|
DB.run('DELETE FROM role_options WHERE id = ?', option.id);
|
||||||
await updateRoleMessage(interaction.client, category);
|
await updateRoleMessage(interaction.client, category);
|
||||||
await interaction.reply({ content: `${role.name} aus "${kategorie}" entfernt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `${role.name} aus "${kategorie}" entfernt.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'delete') {
|
if (subcommand === 'delete') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ const command: Command = {
|
|||||||
|
|
||||||
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
||||||
if (!category) {
|
if (!category) {
|
||||||
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,13 +368,13 @@ const command: Command = {
|
|||||||
|
|
||||||
DB.run('DELETE FROM role_categories WHERE id = ?', category.id);
|
DB.run('DELETE FROM role_categories WHERE id = ?', category.id);
|
||||||
|
|
||||||
await interaction.reply({ content: `Kategorie "${kategorie}" geloescht.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${kategorie}" geloescht.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'config') {
|
if (subcommand === 'config') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ const command: Command = {
|
|||||||
|
|
||||||
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
const category: any = DB.get('SELECT * FROM role_categories WHERE guild_id = ? AND category_name = ?', guildId, kategorie);
|
||||||
if (!category) {
|
if (!category) {
|
||||||
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Kategorie "${kategorie}" nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,11 +404,11 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (updates.length === 0) {
|
if (updates.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Aenderungen angegeben.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Aenderungen angegeben.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({ content: `Konfiguration aktualisiert: ${updates.join(', ')}`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `Konfiguration aktualisiert: ${updates.join(', ')}`, ephemeral: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
|
|
||||||
// Parse time duration strings like "30s", "2h", "1d30m"
|
// Parse time duration strings like "30s", "2h", "1d30m"
|
||||||
@@ -159,7 +159,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ const command: Command = {
|
|||||||
if (!targetTime || targetTime <= now) {
|
if (!targetTime || targetTime <= now) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: '❌ Ungültige Zeitangabe. Verwende z.B.: "30min", "2h30m", "25.12.2024 14:30" oder "morgen 15:00"',
|
content: '❌ Ungültige Zeitangabe. Verwende z.B.: "30min", "2h30m", "25.12.2024 14:30" oder "morgen 15:00"',
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -209,14 +209,14 @@ const command: Command = {
|
|||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `✅ Erinnerung gesetzt (ID: ${result.lastInsertRowid}) für **${timeStr.trim()}**`,
|
content: `✅ Erinnerung gesetzt (ID: ${result.lastInsertRowid}) für **${timeStr.trim()}**`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'remove') {
|
if (subcommand === 'remove') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,11 +225,11 @@ const command: Command = {
|
|||||||
const result = DB.run('DELETE FROM reminders WHERE id = ? AND guild_id = ?', timerId, guildId);
|
const result = DB.run('DELETE FROM reminders WHERE id = ? AND guild_id = ?', timerId, guildId);
|
||||||
|
|
||||||
if (result.changes === 0) {
|
if (result.changes === 0) {
|
||||||
await interaction.reply({ content: `❌ Timer mit ID ${timerId} nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `❌ Timer mit ID ${timerId} nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Timer mit ID ${timerId} entfernt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Timer mit ID ${timerId} entfernt.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (reminders.length === 0) {
|
if (reminders.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Timer in diesem Kanal.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Timer in diesem Kanal.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,20 +275,20 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
embed.setDescription(chunks[0]);
|
embed.setDescription(chunks[0]);
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
|
|
||||||
for (let i = 1; i < chunks.length; i++) {
|
for (let i = 1; i < chunks.length; i++) {
|
||||||
const nextEmbed = new EmbedBuilder()
|
const nextEmbed = new EmbedBuilder()
|
||||||
.setColor(0x3498db)
|
.setColor(0x3498db)
|
||||||
.setDescription(chunks[i]);
|
.setDescription(chunks[i]);
|
||||||
await interaction.followUp({ embeds: [nextEmbed], flags: [MessageFlags.Ephemeral] });
|
await interaction.followUp({ embeds: [nextEmbed], ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'listall') {
|
if (subcommand === 'listall') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (reminders.length === 0) {
|
if (reminders.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Timer auf dem Server.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Timer auf dem Server.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,13 +332,13 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
embed.setDescription(chunks[0]);
|
embed.setDescription(chunks[0]);
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
|
|
||||||
for (let i = 1; i < chunks.length; i++) {
|
for (let i = 1; i < chunks.length; i++) {
|
||||||
const nextEmbed = new EmbedBuilder()
|
const nextEmbed = new EmbedBuilder()
|
||||||
.setColor(0xe74c3c)
|
.setColor(0xe74c3c)
|
||||||
.setDescription(chunks[i]);
|
.setDescription(chunks[i]);
|
||||||
await interaction.followUp({ embeds: [nextEmbed], flags: [MessageFlags.Ephemeral] });
|
await interaction.followUp({ embeds: [nextEmbed], ephemeral: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
@@ -53,7 +53,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ const command: Command = {
|
|||||||
const triggers: any[] = DB.all('SELECT * FROM auto_responses WHERE guild_id = ? ORDER BY trigger_word ASC', guildId);
|
const triggers: any[] = DB.all('SELECT * FROM auto_responses WHERE guild_id = ? ORDER BY trigger_word ASC', guildId);
|
||||||
|
|
||||||
if (triggers.length === 0) {
|
if (triggers.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Trigger konfiguriert.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Trigger konfiguriert.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,20 +80,20 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
embed.setDescription(chunks[0]);
|
embed.setDescription(chunks[0]);
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
|
|
||||||
for (let i = 1; i < chunks.length; i++) {
|
for (let i = 1; i < chunks.length; i++) {
|
||||||
const nextEmbed = new EmbedBuilder()
|
const nextEmbed = new EmbedBuilder()
|
||||||
.setColor(0x3498db)
|
.setColor(0x3498db)
|
||||||
.setDescription(chunks[i]);
|
.setDescription(chunks[i]);
|
||||||
await interaction.followUp({ embeds: [nextEmbed], flags: [MessageFlags.Ephemeral] });
|
await interaction.followUp({ embeds: [nextEmbed], ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Admin only for add/remove
|
// Admin only for add/remove
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ const command: Command = {
|
|||||||
responseText
|
responseText
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Trigger **${triggerWord}** hinzugefügt/aktualisiert.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Trigger **${triggerWord}** hinzugefügt/aktualisiert.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,11 +119,11 @@ const command: Command = {
|
|||||||
const result = DB.run('DELETE FROM auto_responses WHERE guild_id = ? AND trigger_word = ?', guildId, triggerWord);
|
const result = DB.run('DELETE FROM auto_responses WHERE guild_id = ? AND trigger_word = ?', guildId, triggerWord);
|
||||||
|
|
||||||
if (result.changes === 0) {
|
if (result.changes === 0) {
|
||||||
await interaction.reply({ content: `❌ Trigger **${triggerWord}** nicht gefunden.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `❌ Trigger **${triggerWord}** nicht gefunden.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Trigger **${triggerWord}** entfernt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Trigger **${triggerWord}** entfernt.`, ephemeral: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
import { TwitchManager } from '../../structures/TwitchManager.js';
|
import { TwitchManager } from '../../structures/TwitchManager.js';
|
||||||
import { ExtendedClient } from '../../structures/ExtendedClient.js';
|
import { ExtendedClient } from '../../structures/ExtendedClient.js';
|
||||||
@@ -69,7 +69,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ const command: Command = {
|
|||||||
if (subcommand === 'list') {
|
if (subcommand === 'list') {
|
||||||
const monitors: any[] = DB.all('SELECT * FROM twitch_monitors WHERE guild_id = ? AND discord_channel_id = ?', guildId, interaction.channelId);
|
const monitors: any[] = DB.all('SELECT * FROM twitch_monitors WHERE guild_id = ? AND discord_channel_id = ?', guildId, interaction.channelId);
|
||||||
if (monitors.length === 0) {
|
if (monitors.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Twitch-Kanäle überwacht.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Twitch-Kanäle überwacht.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,19 +117,19 @@ const command: Command = {
|
|||||||
.setColor(0x6441a5)
|
.setColor(0x6441a5)
|
||||||
.setDescription(list);
|
.setDescription(list);
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'listall') {
|
if (subcommand === 'listall') {
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const monitors: any[] = DB.all('SELECT * FROM twitch_monitors WHERE guild_id = ? ORDER BY channel_name ASC', guildId);
|
const monitors: any[] = DB.all('SELECT * FROM twitch_monitors WHERE guild_id = ? ORDER BY channel_name ASC', guildId);
|
||||||
if (monitors.length === 0) {
|
if (monitors.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Twitch-Kanäle überwacht.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Twitch-Kanäle überwacht.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,25 +151,24 @@ const command: Command = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
embed.setDescription(chunks[0]);
|
embed.setDescription(chunks[0]);
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
|
|
||||||
for (let i = 1; i < chunks.length; i++) {
|
for (let i = 1; i < chunks.length; i++) {
|
||||||
const nextEmbed = new EmbedBuilder()
|
const nextEmbed = new EmbedBuilder()
|
||||||
.setColor(0x6441a5)
|
.setColor(0x6441a5)
|
||||||
.setDescription(chunks[i]);
|
.setDescription(chunks[i]);
|
||||||
await interaction.followUp({ embeds: [nextEmbed], flags: [MessageFlags.Ephemeral] });
|
await interaction.followUp({ embeds: [nextEmbed], ephemeral: true });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Admin only for add/remove
|
// Admin only for add/remove
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subcommand === 'add') {
|
if (subcommand === 'add') {
|
||||||
const discordChannel = interaction.options.getChannel('channel');
|
|
||||||
const streamersInput = interaction.options.getString('streamers')!;
|
const streamersInput = interaction.options.getString('streamers')!;
|
||||||
const message = interaction.options.getString('message');
|
const message = interaction.options.getString('message');
|
||||||
const discordChannelId = interaction.channelId;
|
const discordChannelId = interaction.channelId;
|
||||||
@@ -181,7 +180,7 @@ const command: Command = {
|
|||||||
.filter((s: string) => s.length > 0);
|
.filter((s: string) => s.length > 0);
|
||||||
|
|
||||||
if (streamers.length === 0) {
|
if (streamers.length === 0) {
|
||||||
await interaction.reply({ content: '❌ Keine gültigen Streamer angegeben.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine gültigen Streamer angegeben.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,10 +190,7 @@ const command: Command = {
|
|||||||
for (const streamer of streamers) {
|
for (const streamer of streamers) {
|
||||||
try {
|
try {
|
||||||
// Check if stream exists
|
// Check if stream exists
|
||||||
const stream = await TwitchManager.fetchStreamData(streamer);
|
await TwitchManager.fetchStreamData(streamer);
|
||||||
if (!stream) {
|
|
||||||
// Streamer might be valid but offline - still add them
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if already exists
|
// Check if already exists
|
||||||
const existing = DB.get('SELECT id FROM twitch_monitors WHERE guild_id = ? AND channel_name = ?', guildId, streamer);
|
const existing = DB.get('SELECT id FROM twitch_monitors WHERE guild_id = ? AND channel_name = ?', guildId, streamer);
|
||||||
@@ -220,7 +216,7 @@ const command: Command = {
|
|||||||
if (results.updated > 0) reply += `\n🔄 Aktualisiert: ${results.updated}`;
|
if (results.updated > 0) reply += `\n🔄 Aktualisiert: ${results.updated}`;
|
||||||
if (results.errors > 0) reply += `\n❌ Fehler: ${results.errors} (${errors.join(', ')})`;
|
if (results.errors > 0) reply += `\n❌ Fehler: ${results.errors} (${errors.join(', ')})`;
|
||||||
|
|
||||||
await interaction.reply({ content: reply, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: reply, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +228,7 @@ const command: Command = {
|
|||||||
.filter((s: string) => s.length > 0);
|
.filter((s: string) => s.length > 0);
|
||||||
|
|
||||||
if (streamers.length === 0) {
|
if (streamers.length === 0) {
|
||||||
await interaction.reply({ content: '❌ Keine gültigen Streamer angegeben.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine gültigen Streamer angegeben.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +249,7 @@ const command: Command = {
|
|||||||
if (results.removed > 0) reply += `✅ ${results.removed} Streamer entfernt.`;
|
if (results.removed > 0) reply += `✅ ${results.removed} Streamer entfernt.`;
|
||||||
if (results.notFound > 0) reply += `\n❌ Nicht gefunden: ${notFound.join(', ')}`;
|
if (results.notFound > 0) reply += `\n❌ Nicht gefunden: ${notFound.join(', ')}`;
|
||||||
|
|
||||||
await interaction.reply({ content: reply, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: reply, ephemeral: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags, ChannelType } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, ChannelType } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
import { TwitchMonitor } from '../../structures/TwitchMonitor.js';
|
import { TwitchMonitor } from '../../structures/TwitchMonitor.js';
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ const command: Command = {
|
|||||||
const monitors: any[] = DB.all('SELECT * FROM twitch_monitor_channels WHERE guild_id = ? ORDER BY twitch_channel ASC', guildId);
|
const monitors: any[] = DB.all('SELECT * FROM twitch_monitor_channels WHERE guild_id = ? ORDER BY twitch_channel ASC', guildId);
|
||||||
|
|
||||||
if (monitors.length === 0) {
|
if (monitors.length === 0) {
|
||||||
await interaction.reply({ content: 'Keine Twitch-Kanäle überwacht.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Twitch-Kanäle überwacht.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,12 +74,12 @@ const command: Command = {
|
|||||||
).join('\n'))
|
).join('\n'))
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ const command: Command = {
|
|||||||
|
|
||||||
const existing = DB.get('SELECT * FROM twitch_monitor_channels WHERE guild_id = ? AND twitch_channel = ?', guildId, twitchChannel);
|
const existing = DB.get('SELECT * FROM twitch_monitor_channels WHERE guild_id = ? AND twitch_channel = ?', guildId, twitchChannel);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
await interaction.reply({ content: `${twitchChannel} wird bereits überwacht.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `${twitchChannel} wird bereits überwacht.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ const command: Command = {
|
|||||||
const monitor = TwitchMonitor.getInstance();
|
const monitor = TwitchMonitor.getInstance();
|
||||||
await monitor.addMonitor(guildId, twitchChannel, discordChannel.id, webhook.url);
|
await monitor.addMonitor(guildId, twitchChannel, discordChannel.id, webhook.url);
|
||||||
|
|
||||||
await interaction.reply({ content: `${twitchChannel} wird jetzt überwacht.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `${twitchChannel} wird jetzt überwacht.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ const command: Command = {
|
|||||||
|
|
||||||
const monitor: any = DB.get('SELECT * FROM twitch_monitor_channels WHERE guild_id = ? AND twitch_channel = ?', guildId, twitchChannel);
|
const monitor: any = DB.get('SELECT * FROM twitch_monitor_channels WHERE guild_id = ? AND twitch_channel = ?', guildId, twitchChannel);
|
||||||
if (!monitor) {
|
if (!monitor) {
|
||||||
await interaction.reply({ content: `${twitchChannel} wird nicht überwacht.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `${twitchChannel} wird nicht überwacht.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ const command: Command = {
|
|||||||
const twitchMonitor = TwitchMonitor.getInstance();
|
const twitchMonitor = TwitchMonitor.getInstance();
|
||||||
await twitchMonitor.removeMonitor(guildId, twitchChannel);
|
await twitchMonitor.removeMonitor(guildId, twitchChannel);
|
||||||
|
|
||||||
await interaction.reply({ content: `${twitchChannel} wurde entfernt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `${twitchChannel} wurde entfernt.`, ephemeral: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from 'discord.js';
|
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder } from 'discord.js';
|
||||||
import { Command } from '../../structures/Command.js';
|
import { Command } from '../../structures/Command.js';
|
||||||
|
|
||||||
const command: Command = {
|
const command: Command = {
|
||||||
@@ -75,7 +75,7 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,13 +100,13 @@ const command: Command = {
|
|||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|
||||||
await interaction.reply({ embeds: [embed], flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Admin only for modify commands
|
// Admin only for modify commands
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: '❌ Keine Berechtigung. Moderatoren erforderlich.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ const command: Command = {
|
|||||||
guildId
|
guildId
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.reply({ content: `✅ Kanal für Willkommen/Abschied auf ${channel} gesetzt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ Kanal für Willkommen/Abschied auf ${channel} gesetzt.`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const label = type === 'welcome' ? 'Willkommensnachricht' : 'Abschiedsnachricht';
|
const label = type === 'welcome' ? 'Willkommensnachricht' : 'Abschiedsnachricht';
|
||||||
await interaction.reply({ content: `✅ ${label} gesetzt:\n\`\`\`\n${message}\n\`\`\``, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ ${label} gesetzt:\n\`\`\`\n${message}\n\`\`\``, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ const command: Command = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const label = type === 'welcome' ? 'Willkommensnachricht' : 'Abschiedsnachricht';
|
const label = type === 'welcome' ? 'Willkommensnachricht' : 'Abschiedsnachricht';
|
||||||
await interaction.reply({ content: `✅ ${label} entfernt.`, flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: `✅ ${label} entfernt.`, ephemeral: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Events, MessageFlags, Interaction } from 'discord.js';
|
import { Events, Interaction, GuildMember } from 'discord.js';
|
||||||
import { ExtendedClient } from '../structures/ExtendedClient.js';
|
import { ExtendedClient } from '../structures/ExtendedClient.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -10,11 +10,11 @@ export default {
|
|||||||
if (customId.startsWith('role_select_')) {
|
if (customId.startsWith('role_select_')) {
|
||||||
const categoryName = customId.replace('role_select_', '');
|
const categoryName = customId.replace('role_select_', '');
|
||||||
const selectedValue = interaction.values[0];
|
const selectedValue = interaction.values[0];
|
||||||
const member = interaction.member;
|
|
||||||
const guild = interaction.guild;
|
const guild = interaction.guild;
|
||||||
|
const member = interaction.member as GuildMember;
|
||||||
|
|
||||||
if (!guild || !member || !('roles' in member)) {
|
if (!guild || !member || !member.roles) {
|
||||||
await interaction.reply({ content: 'Dieser Befehl kann nur auf Servern verwendet werden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Dieser Befehl kann nur auf Servern verwendet werden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!category) {
|
if (!category) {
|
||||||
await interaction.reply({ content: 'Kategorie nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Kategorie nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,12 +41,12 @@ export default {
|
|||||||
if (removedCount > 0) {
|
if (removedCount > 0) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Alle Rollen aus "${categoryName}" wurden entfernt.`,
|
content: `Alle Rollen aus "${categoryName}" wurden entfernt.`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Du hast keine Rollen aus "${categoryName}".`,
|
content: `Du hast keine Rollen aus "${categoryName}".`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -59,13 +59,13 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!option) {
|
if (!option) {
|
||||||
await interaction.reply({ content: 'Rolle nicht gefunden.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Rolle nicht gefunden.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const discordRole = guild.roles.cache.get(selectedValue);
|
const discordRole = guild.roles.cache.get(selectedValue);
|
||||||
if (!discordRole) {
|
if (!discordRole) {
|
||||||
await interaction.reply({ content: 'Diese Rolle existiert nicht mehr.', flags: [MessageFlags.Ephemeral] });
|
await interaction.reply({ content: 'Diese Rolle existiert nicht mehr.', ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
await member.roles.remove(selectedValue);
|
await member.roles.remove(selectedValue);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name} wurde entfernt.`,
|
content: `Die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name} wurde entfernt.`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const options: any[] = client.DB.all('SELECT * FROM role_options WHERE category_id = ?', category.id);
|
const options: any[] = client.DB.all('SELECT * FROM role_options WHERE category_id = ?', category.id);
|
||||||
@@ -88,7 +88,7 @@ export default {
|
|||||||
await member.roles.add(selectedValue);
|
await member.roles.add(selectedValue);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Du hast jetzt die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name}!`,
|
content: `Du hast jetzt die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name}!`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -96,21 +96,21 @@ export default {
|
|||||||
await member.roles.remove(selectedValue);
|
await member.roles.remove(selectedValue);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name} wurde entfernt.`,
|
content: `Die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name} wurde entfernt.`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const userRoles = member.roles.cache.filter((r: any) => !r.managed && r.id !== guild.id).size;
|
const userRoles = member.roles.cache.filter((r: any) => !r.managed && r.id !== guild.id).size;
|
||||||
if (category.max_roles > 0 && userRoles >= category.max_roles) {
|
if (category.max_roles > 0 && userRoles >= category.max_roles) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Du kannst maximal ${category.max_roles} Rollen aus dieser Kategorie haben.`,
|
content: `Du kannst maximal ${category.max_roles} Rollen aus dieser Kategorie haben.`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await member.roles.add(selectedValue);
|
await member.roles.add(selectedValue);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `Du hast jetzt die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name}!`,
|
content: `Du hast jetzt die Rolle ${option.emoji ? option.emoji + ' ' : ''}${discordRole.name}!`,
|
||||||
flags: [MessageFlags.Ephemeral]
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ export default {
|
|||||||
`, interaction.commandName);
|
`, interaction.commandName);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
const replyOptions = { content: 'There was an error while executing this command!', flags: [MessageFlags.Ephemeral] };
|
const replyOptions = { content: 'There was an error while executing this command!', ephemeral: true };
|
||||||
if (interaction.replied || interaction.deferred) {
|
if (interaction.replied || interaction.deferred) {
|
||||||
await interaction.followUp(replyOptions);
|
await interaction.followUp(replyOptions);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user