aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/bush
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-14 12:47:57 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-14 12:47:57 -0400
commit661e4c9935aeb8760dafc7ced4bbec6cc356a033 (patch)
treebb4c12bdef067d203f100e13e05ccb705b299834 /src/listeners/bush
parenteaf592b72eb5b1d66aa2bde5151a8947570a506c (diff)
downloadtanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.gz
tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.bz2
tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.zip
remove the war crimes that I previously committed
- Remove custom typings and replace with declaration merging - Fix the typings for args - Replace all discord-api-types imports with discord.js imports - Fix discord.js breaking changes
Diffstat (limited to 'src/listeners/bush')
-rw-r--r--src/listeners/bush/joinAutoBan.ts5
-rw-r--r--src/listeners/bush/supportThread.ts8
-rw-r--r--src/listeners/bush/userUpdateAutoBan.ts7
3 files changed, 11 insertions, 9 deletions
diff --git a/src/listeners/bush/joinAutoBan.ts b/src/listeners/bush/joinAutoBan.ts
index 0b38766..83efa06 100644
--- a/src/listeners/bush/joinAutoBan.ts
+++ b/src/listeners/bush/joinAutoBan.ts
@@ -1,4 +1,5 @@
-import { AllowedMentions, BushListener, type BushClientEvents, type BushTextChannel } from '#lib';
+import { AllowedMentions, BushListener, type BushClientEvents } from '#lib';
+import { TextChannel } from 'discord.js';
export default class JoinAutoBanListener extends BushListener {
public constructor() {
@@ -52,7 +53,7 @@ export default class JoinAutoBanListener extends BushListener {
? `${util.emojis.warn} Banned ${util.format.input(member.user.tag)} however I could not send them a dm.`
: `${util.emojis.success} Successfully banned ${util.format.input(member.user.tag)}.`;
- (<BushTextChannel>guild.channels.cache.find((c) => c.name === 'general'))
+ (<TextChannel>guild.channels.cache.find((c) => c.name === 'general'))
?.send({ content, allowedMentions: AllowedMentions.none() })
.catch(() => {});
}
diff --git a/src/listeners/bush/supportThread.ts b/src/listeners/bush/supportThread.ts
index e809176..46ac96f 100644
--- a/src/listeners/bush/supportThread.ts
+++ b/src/listeners/bush/supportThread.ts
@@ -1,7 +1,7 @@
-import { BushListener, BushTextChannel, type BushClientEvents } from '#lib';
+import { BushListener, type BushClientEvents } from '#lib';
import { stripIndent } from '#tags';
import assert from 'assert';
-import { EmbedBuilder, MessageType, PermissionFlagsBits } from 'discord.js';
+import { EmbedBuilder, MessageType, PermissionFlagsBits, TextChannel } from 'discord.js';
export default class SupportThreadListener extends BushListener {
public constructor() {
@@ -12,7 +12,7 @@ export default class SupportThreadListener extends BushListener {
});
}
- public override async exec(...[message]: BushClientEvents['messageCreate']): Promise<Promise<void> | undefined> {
+ public override async exec(...[message]: BushClientEvents['messageCreate']): Promise<void | undefined> {
if (!client.config.isProduction || !message.inGuild()) return;
if (![MessageType.Default, MessageType.Reply].includes(message.type)) return;
if (message.thread) return;
@@ -30,7 +30,7 @@ export default class SupportThreadListener extends BushListener {
)
return;
- assert(message.channel instanceof BushTextChannel);
+ assert(message.channel instanceof TextChannel);
if (!message.channel.permissionsFor(message.guild.members.me!).has(PermissionFlagsBits.CreatePublicThreads)) return;
const thread = await message
diff --git a/src/listeners/bush/userUpdateAutoBan.ts b/src/listeners/bush/userUpdateAutoBan.ts
index 68dfa38..b9485b3 100644
--- a/src/listeners/bush/userUpdateAutoBan.ts
+++ b/src/listeners/bush/userUpdateAutoBan.ts
@@ -1,4 +1,5 @@
-import { AllowedMentions, BushGuildMember, BushListener, type BushClientEvents, type BushTextChannel } from '#lib';
+import { AllowedMentions, BushListener, type BushClientEvents } from '#lib';
+import { GuildMember, type TextChannel } from 'discord.js';
export default class UserUpdateAutoBanListener extends BushListener {
public constructor() {
@@ -21,7 +22,7 @@ export default class UserUpdateAutoBanListener extends BushListener {
.get(client.consts.mappings.guilds.bush)
?.members.fetch(newUser.id)
.catch(() => undefined);
- if (!member || !(member instanceof BushGuildMember)) return;
+ if (!member || !(member instanceof GuildMember)) return;
const guild = member.guild;
@@ -58,7 +59,7 @@ export default class UserUpdateAutoBanListener extends BushListener {
? `${util.emojis.warn} Banned ${util.format.input(member.user.tag)} however I could not send them a dm.`
: `${util.emojis.success} Successfully banned ${util.format.input(member.user.tag)}.`;
- (<BushTextChannel>guild.channels.cache.find((c) => c.name === 'general'))
+ (<TextChannel>guild.channels.cache.find((c) => c.name === 'general'))
?.send({ content, allowedMentions: AllowedMentions.none() })
.catch(() => {});
}