aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/message
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-25 23:47:40 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-25 23:47:40 -0500
commit840cca672d681c36f980a06fb79a4e2c01bd69ac (patch)
tree82c40a7fe3e1a2bc6367fed6e3d26b6c7dceb256 /src/listeners/message
parent6ca99336a416389dd2b0b8c4c6a7b2ef87bc9fef (diff)
downloadtanzanite-840cca672d681c36f980a06fb79a4e2c01bd69ac.tar.gz
tanzanite-840cca672d681c36f980a06fb79a4e2c01bd69ac.tar.bz2
tanzanite-840cca672d681c36f980a06fb79a4e2c01bd69ac.zip
I love breaking changes!!!!
Diffstat (limited to 'src/listeners/message')
-rw-r--r--src/listeners/message/autoThread.ts6
-rw-r--r--src/listeners/message/blacklistedFile.ts8
-rw-r--r--src/listeners/message/directMessage.ts6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/listeners/message/autoThread.ts b/src/listeners/message/autoThread.ts
index 77ff33c..b753dc3 100644
--- a/src/listeners/message/autoThread.ts
+++ b/src/listeners/message/autoThread.ts
@@ -1,5 +1,5 @@
import { BushListener, type BushClientEvents, type BushTextChannel } from '#lib';
-import { GuildTextBasedChannel, MessageEmbed, MessageType, Permissions } from 'discord.js';
+import { Embed, GuildTextBasedChannel, MessageType, Permissions } from 'discord.js';
export default class autoThreadListener extends BushListener {
public constructor() {
@@ -45,12 +45,12 @@ export default class autoThreadListener extends BushListener {
})
.catch(() => null);
if (!thread) return;
- const embed = new MessageEmbed()
+ const embed = new Embed()
.setTitle('NotEnoughUpdates Support')
.setDescription(
`Welcome to Moulberry Bush Support:tm:\n\nPlease make sure you have the latest version found in <#693586404256645231>.\nAdditionally if you need help installing the mod be sure to read <#737444942724726915> for a guide on how to do so.`
)
- .setColor('BLURPLE');
+ .setColor(client.consts.colors.discord.BLURPLE);
void thread
.send({ embeds: [embed] })
.then(() =>
diff --git a/src/listeners/message/blacklistedFile.ts b/src/listeners/message/blacklistedFile.ts
index 9d52ab0..38803f5 100644
--- a/src/listeners/message/blacklistedFile.ts
+++ b/src/listeners/message/blacklistedFile.ts
@@ -68,9 +68,9 @@ export default class BlacklistedFileListener extends BushListener {
public override async exec(...[message]: BushClientEvents['messageCreate']) {
if (!message.guild || !(await message.guild.hasFeature('blacklistedFile'))) return;
// eslint-disable-next-line deprecation/deprecation
- const embedAttachments = message.embeds.filter((e) => ['image', 'video', 'gifv'].includes(e.type));
+ // const embedAttachments = message.embeds.filter((e) => ['image', 'video', 'gifv'].includes(e.type));
const foundEmojis = [...message.content.matchAll(/<(?<animated>a?):\w+:(?<id>\d+)>/g)];
- if (message.attachments.size + embedAttachments.length + foundEmojis.length < 1) return;
+ if (message.attachments.size + /* embedAttachments.length + */ foundEmojis.length < 1) return;
const foundFiles = [] as {
name: string;
hash: string[];
@@ -90,7 +90,7 @@ export default class BlacklistedFileListener extends BushListener {
continue;
}
}
- for (const attachment of embedAttachments) {
+ /* for (const attachment of embedAttachments) {
try {
const req = await got.get(attachment.url!);
const rawHash = crypto.createHash('md5');
@@ -103,7 +103,7 @@ export default class BlacklistedFileListener extends BushListener {
} catch {
continue;
}
- }
+ } */
for (const attachment of foundEmojis) {
try {
const req = await got.get(
diff --git a/src/listeners/message/directMessage.ts b/src/listeners/message/directMessage.ts
index dfc9222..c333e22 100644
--- a/src/listeners/message/directMessage.ts
+++ b/src/listeners/message/directMessage.ts
@@ -1,5 +1,5 @@
import { BushListener, type BushClientEvents } from '#lib';
-import { ChannelType, MessageEmbed } from 'discord.js';
+import { ChannelType, Embed } from 'discord.js';
export default class DirectMessageListener extends BushListener {
public constructor() {
@@ -14,7 +14,7 @@ export default class DirectMessageListener extends BushListener {
if (message.channel.type === ChannelType.DM) {
if (!(message.author.id == client.user!.id) && message.author.bot) return;
if (client.cache.global.blacklistedUsers.includes(message.author.id)) return;
- const dmLogEmbed = new MessageEmbed().setTimestamp().setFooter({ text: `User ID • ${message.channel.recipient.id}` });
+ const dmLogEmbed = new Embed().setTimestamp().setFooter({ text: `User ID • ${message.channel.recipient.id}` });
if (message.author.id != client.user!.id) {
dmLogEmbed
@@ -37,7 +37,7 @@ export default class DirectMessageListener extends BushListener {
if (message.attachments.filter((a) => typeof a.size == 'number').size == 1) {
dmLogEmbed.setImage(message.attachments.filter((a) => typeof a.size == 'number').first()!.proxyURL);
} else if (message.attachments.size > 0) {
- dmLogEmbed.addField('Attachments', message.attachments.map((a) => a.proxyURL).join('\n'));
+ dmLogEmbed.addField({ name: 'Attachments', value: message.attachments.map((a) => a.proxyURL).join('\n') });
}
const dmChannel = await util.getConfigChannel('dm');
await dmChannel.send({ embeds: [dmLogEmbed] });