Skip to content

Commit

Permalink
Merge pull request #9 from olliecheng/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
olliecheng authored Jul 14, 2024
2 parents 62ac4ee + aa00388 commit 28088e3
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 5 deletions.
6 changes: 4 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"ROLES": {
"932479809328652338": "💊",
"932480072407982110": "🦷",
"930996401800884256": "📋"
"930996401800884256": "📋",
"1009473756944683079": "🩺"
}
}
},
"extra": ["829957443958210562"]
}
5 changes: 4 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function getServers(): string[] {
if (process.env.TEST_SERVER) {
return [process.env.TEST_SERVER];
}
let servers = Object.keys(config).filter((x) => x != "default");
let servers = [
...Object.keys(config).filter((x) => !["default", "extra"].includes(x)),
config.extra,
];
console.log("Loaded servers:", servers);
return servers;
}
4 changes: 2 additions & 2 deletions src/modules/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ const interactionChangedEvent: Event = {
].map((x) => parseInt(x));

await interaction.reply({
content: `Your score is: \`${calc(
content: `**Your score is: \`${calc(
VR,
DMsyl,
DMmcq,
QR,
AR
)}\`, for the following results:
)}\`, for the following results:**
VR: ${VR}/44,
DM:
Expand Down
65 changes: 65 additions & 0 deletions src/modules/moderation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import {
Client,
Interaction,
MessageActionRow,
MessageSelectMenu,
Message,
MessageComponentInteraction,
SelectMenuInteraction,
MessageButton,
GuildInviteManager,
GuildMember,
Permissions,
TextChannel,
} from "discord.js";
import { Module, Command, Event } from "../interfaces";
import emojiRegex from "emoji-regex";
import { loadConfig } from "../config";

const checkForWords: Event = {
name: "messageSentEvent",
eventType: "messageCreate",
handler: async (client: any, msg: Message) => {
const harassment = ["cunt", "hoe", "rape", "bitch"];
console.log("client");

for (let word in harassment) {
if (msg.content.includes(word)) {
await client.channels.get("1014766065181536287").send({
content: "",
embeds: [
{
type: "rich",
title: `Warning`,
description: "",
color: 0xff0000,
fields: [
{
name: `Message contents`,
value: msg.content,
inline: true,
},
{
name: `Message author`,
value: `<@!${msg.author.id}>`,
},
{
name: "\u200B",
value: `_[Navigate to message](${msg.url})_`,
},
],
},
],
});
return;
}
}
},
};

const module: Module = {
name: "moderation",
events: [checkForWords],
};

export default module;

0 comments on commit 28088e3

Please sign in to comment.