Skip to content

Commit 754855b

Browse files
authored
Merge pull request #60 from Chiissu/dev
no more blocklist
2 parents a390c37 + 24bbd2f commit 754855b

File tree

6 files changed

+0
-103
lines changed

6 files changed

+0
-103
lines changed

src/bot.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { ActivityType, Client, Partials } from "discord.js";
55
import { registerGuildCommands } from "handlers/commands";
66
import { loadAuditEvents, loadEasterEggs, loadEvents } from "handlers/events";
77
import ms from "ms";
8-
import { leavePlease } from "utils/leavePlease";
98
import { rescheduleUnbans } from "utils/unbanScheduler";
109

1110
export const client = new Client({
@@ -30,10 +29,6 @@ export const subscribedUsers = new Set(
3029
);
3130

3231
client.once("ready", async () => {
33-
const guilds = client.guilds.cache;
34-
for (const id of guilds.keys())
35-
await leavePlease(guilds.get(id)!, await guilds.get(id)!.fetchOwner()!, "Not like that.");
36-
3732
if (process.env.TOPGG_TOKEN) {
3833
const topgg = new Api(process.env.TOPGG_TOKEN!);
3934
try {

src/events/guildCreate.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
import { check } from "database/blocklist";
21
import { EmbedBuilder } from "discord.js";
32
import { errorEmbed } from "embeds/errorEmbed";
43
import { commands } from "handlers/commands";
54
import { genColor } from "utils/colorGen";
65
import { dotCheck } from "utils/dotCheck";
7-
import { leavePlease } from "utils/leavePlease";
86
import { replace } from "utils/replace";
97
import type { Event } from "utils/types";
108

119
export default (async function run(guild) {
12-
const owner = await guild.fetchOwner();
13-
if (!check(owner.id)) return await leavePlease(guild, owner, "No.");
14-
1510
const client = guild.client;
1611
const avatar = client.user.displayAvatarURL();
1712
const embed = new EmbedBuilder()

src/events/interactionCreate.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { check } from "database/blocklist";
21
import { getUserSetting } from "database/userSettings";
32
import { SlashCommandSubcommandBuilder } from "discord.js";
4-
import { errorEmbed } from "embeds/errorEmbed";
53
import { commands, subCommands } from "handlers/commands";
64
import { subscribedUsers } from "src/bot";
75
import { noErrorsPlease } from "utils/noErrorsPlease";
@@ -25,13 +23,6 @@ export default (async function run(interaction) {
2523

2624
if (!command) return;
2725
if (interaction.isChatInputCommand()) {
28-
if (!interaction.member || !check(interaction.member.user.id!))
29-
return await errorEmbed({
30-
interaction,
31-
title: "The bot has experienced an internal error.",
32-
reason: "Please try again later.",
33-
});
34-
3526
await noErrorsPlease(interaction);
3627
command.run(interaction);
3728
}

src/events/messageCreate.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { add, check, remove } from "database/blocklist";
21
import { getLevel, setLevel } from "database/leveling";
32
import { getSetting } from "database/settings";
43
import { EmbedBuilder, type TextChannel } from "discord.js";
@@ -8,56 +7,14 @@ import { channelCheck } from "utils/channelCheck";
87
import { genColor } from "utils/colorGen";
98
import { dotCheck } from "utils/dotCheck";
109
import { kominator } from "utils/kominator";
11-
import { leavePlease } from "utils/leavePlease";
1210
import { mention } from "utils/mention";
1311
import { Event } from "utils/types";
1412

1513
const cooldowns = new Map<string, number>();
1614
export default (async function run(message) {
1715
const client = message.client;
18-
if (message.content.startsWith("!SYSTEM")) {
19-
if (message.author.id != process.env.OWNER) return;
20-
const args = message.content.split(" ");
21-
if (!args[2]) return message.reply("ERROR: Expected three arguments.");
22-
const username = (await client.users.fetch(args[2])).username;
23-
24-
switch (args[1]) {
25-
case "add": {
26-
add(args[2]);
27-
await message.reply(`${username} has been blocklisted from Sokora.`);
28-
29-
const guilds = client.guilds.cache;
30-
for (const id of guilds.keys()) {
31-
const guild = guilds.get(id);
32-
if (!guild) {
33-
await errorEmbed({
34-
client,
35-
title: "Failed to blocklist guild.",
36-
reason: `Guild ${id} not found`,
37-
});
38-
continue;
39-
}
40-
await leavePlease(guild, await guild.fetchOwner(), "No.");
41-
}
42-
break;
43-
}
44-
case "remove":
45-
remove(args[2]);
46-
await message.reply(`${username} has been removed from the Sokora blocklist.`);
47-
break;
48-
case "check":
49-
await message.reply(`${!check(args[2])}`);
50-
break;
51-
default:
52-
await message.reply(
53-
"Hello, this is the system interface to control top level Sokora moderation utilities.",
54-
);
55-
}
56-
}
57-
5816
const author = message.author;
5917
if (author.bot) return;
60-
if (!check(author.id)) return;
6118
const guild = message.guild!;
6219
const avatar = author.displayAvatarURL();
6320

src/utils/database/blocklist.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/utils/leavePlease.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)