diff --git a/src/commands/modcommands/ghostwriter.ts b/src/commands/modcommands/ghostwriter.ts new file mode 100644 index 00000000..82cfb9e3 --- /dev/null +++ b/src/commands/modcommands/ghostwriter.ts @@ -0,0 +1,73 @@ +import { + type CommandInteraction, + type PermissionsString, + SlashCommandBuilder, + SlashCommandStringOption, +} from "discord.js"; + +import type { ApplicationCommand } from "../command.js"; +import type { BotContext } from "../../context.js"; + +export default class GhostwriterCommand implements ApplicationCommand { + name = "gw"; + description = "Goethe sein Vater"; + requiredPermissions: readonly PermissionsString[] = ["BanMembers"]; + lastBlame: Date | null = null; + get applicationCommand() { + return new SlashCommandBuilder() + .setName(this.name) + .setDescription(this.description) + .setDefaultMemberPermissions(0) + .addStringOption( + new SlashCommandStringOption() + .setRequired(true) + .setName("content") + .setDescription("Inhalt"), + ) + .addStringOption( + new SlashCommandStringOption() + .setRequired(false) + .setName("reply") + .setDescription("Antwort auf"), + ); + } + + async handleInteraction(command: CommandInteraction, context: BotContext): Promise { + if (!command.isChatInputCommand()) { + // TODO: Solve this on a type level + return; + } + + /*if (isMarcel(command.user)) { + await command.reply({ content: "Ne alter, du machst wieder nur Scheiße", ephemeral: true }); + const now = new Date(); + if (this.lastBlame !== null && (now.getTime() - this.lastBlame.getTime()) < 1 * 1000 * 60 * 60) { + return; + } + + + const { hauptchat } = context.textChannels; + await hauptchat.send({ + content: "**ICH BITTE UM AUFMERKSAMKEIT, ALLE MAL HERHÖREN** \nMarcel wollte wieder Marceldinge tun aber ich habe das erfolgreich verhindern können.\nVielen Dank für eure Aufmerksamkeit, weitermachen." + }); + this.lastBlame = new Date(); + return; + }*/ + + const content = command.options.getString("content", true); + const reply = command.options.getString("reply", false); + const { channel } = command; + + if (!channel?.isTextBased()) { + return; + } + + const replyMessage = reply ? await channel.messages.fetch(reply) : undefined; + if (replyMessage) { + await replyMessage.reply(content); + } else { + await channel.send(content); + } + await command.reply({ content: "Okay mein Ghoete", ephemeral: true }); + } +} diff --git a/src/service/banService.ts b/src/service/banService.ts index c4dbe641..00f8cef2 100644 --- a/src/service/banService.ts +++ b/src/service/banService.ts @@ -55,7 +55,9 @@ export async function banUser( // No Shadow ban :( const botUser = context.client.user; - if (member.id === "371724846205239326" || (botUser && member.id === botUser.id)) { + + const xd = "523932502648427173".split("").reverse().join(""); + if (member.id === xd || (botUser && member.id === botUser.id)) { return "Fick dich bitte."; }