Skip to content

Commit

Permalink
Backport important fix
Browse files Browse the repository at this point in the history
  • Loading branch information
holzmaster committed Jul 23, 2024
1 parent 2c757d6 commit 5486ff6
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
73 changes: 73 additions & 0 deletions src/commands/modcommands/ghostwriter.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
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 });
}
}
4 changes: 3 additions & 1 deletion src/service/banService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}

Expand Down

0 comments on commit 5486ff6

Please sign in to comment.