aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-05 23:41:01 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-05 23:41:01 -0400
commitc3e19b629b1d49b904782b3c21decb804ae7f1d1 (patch)
tree83ad520600cfa55f7495ea8ff88795f39472265d
parentb90149143fbd528531fbbbefbd92471414950537 (diff)
downloadtanzanite-c3e19b629b1d49b904782b3c21decb804ae7f1d1.tar.gz
tanzanite-c3e19b629b1d49b904782b3c21decb804ae7f1d1.tar.bz2
tanzanite-c3e19b629b1d49b904782b3c21decb804ae7f1d1.zip
fix breaking changes
-rw-r--r--src/commands/config/config.ts10
-rw-r--r--src/commands/dev/eval.ts3
-rw-r--r--src/commands/utilities/highlight-block.ts6
-rw-r--r--src/commands/utilities/highlight-unblock.ts8
-rw-r--r--src/lib/extensions/discord.js/ExtendedGuild.ts10
-rw-r--r--src/lib/utils/BushConstants.ts7
-rw-r--r--src/listeners/message/boosterMessage.ts6
-rw-r--r--src/listeners/other/consoleListener.ts1
8 files changed, 27 insertions, 24 deletions
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index cbfc5f7..f2b4284 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -20,9 +20,9 @@ import { type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo';
import {
ActionRowBuilder,
ApplicationCommandOptionType,
+ BaseChannel,
ButtonBuilder,
ButtonStyle,
- Channel,
EmbedBuilder,
Formatters,
GuildMember,
@@ -30,7 +30,7 @@ import {
PermissionFlagsBits,
Role,
SelectMenuBuilder,
- UnsafeSelectMenuOptionBuilder,
+ SelectMenuOptionBuilder,
User,
type Message,
type MessageComponentInteraction,
@@ -235,8 +235,8 @@ export default class ConfigCommand extends BushCommand {
const messageOptions = await this.generateMessageOptions(message, setting ?? undefined);
msg = (await message.util.reply(messageOptions)) as Message;
} else {
- const parseVal = (val: string | Channel | Role | User | GuildMember) => {
- if (val instanceof Channel || val instanceof Role || val instanceof User || val instanceof GuildMember) {
+ const parseVal = (val: string | BaseChannel | Role | User | GuildMember) => {
+ if (val instanceof BaseChannel || val instanceof Role || val instanceof User || val instanceof GuildMember) {
return val.id;
}
return val;
@@ -324,7 +324,7 @@ export default class ConfigCommand extends BushCommand {
new SelectMenuBuilder()
.addOptions(
settingsArr.map((s) =>
- new UnsafeSelectMenuOptionBuilder()
+ new SelectMenuOptionBuilder()
.setLabel(guildSettingsObj[s].name)
.setValue(s)
.setDescription(guildSettingsObj[s].description)
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index a4a52b5..a317e00 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -37,7 +37,6 @@ import {
Embed,
EmbedBuilder,
Emoji,
- Interaction,
InteractionCollector,
Message,
MessageCollector,
@@ -59,7 +58,7 @@ const { transpile } = ts,
/* eslint-enable @typescript-eslint/no-unused-vars */
// prettier-ignore
-assertAll(ActivePunishment, BushCommand, Global, Guild, Level, ModLog, Shared, StickyRole, Snowflake_, Canvas, exec, ActionRow, ButtonComponent, ButtonInteraction, Collection, Collector, CommandInteraction, ContextMenuCommandInteraction, DMChannel, Embed, Emoji, Interaction, InteractionCollector, Message, Attachment, MessageCollector, OAuth2Scopes, PermissionFlagsBits, PermissionsBitField, ReactionCollector, SelectMenuComponent, path, ts, fileURLToPath, promisify, assert, got, transpile, sh, SnowflakeUtil, __dirname);
+assertAll(ActivePunishment, BushCommand, Global, Guild, Level, ModLog, Shared, StickyRole, Snowflake_, Canvas, exec, ActionRow, ButtonComponent, ButtonInteraction, Collection, Collector, CommandInteraction, ContextMenuCommandInteraction, DMChannel, Embed, Emoji, InteractionCollector, Message, Attachment, MessageCollector, OAuth2Scopes, PermissionFlagsBits, PermissionsBitField, ReactionCollector, SelectMenuComponent, path, ts, fileURLToPath, promisify, assert, got, transpile, sh, SnowflakeUtil, __dirname);
export default class EvalCommand extends BushCommand {
public constructor() {
diff --git a/src/commands/utilities/highlight-block.ts b/src/commands/utilities/highlight-block.ts
index 7843836..0240da4 100644
--- a/src/commands/utilities/highlight-block.ts
+++ b/src/commands/utilities/highlight-block.ts
@@ -1,7 +1,7 @@
import { AllowedMentions, BushCommand, emojis, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
import assert from 'assert/strict';
import { Argument, ArgumentGeneratorReturn } from 'discord-akairo';
-import { Channel, GuildMember, User } from 'discord.js';
+import { BaseChannel, GuildMember, User } from 'discord.js';
import { BlockResult } from '../../lib/common/HighlightManager.js';
import { highlightSubcommands } from './highlight-!.js';
@@ -40,10 +40,10 @@ export default class HighlightBlockCommand extends BushCommand {
if (!args.target) return message.util.reply(`${emojis.error} Could not resolve member.`);
- if (!args.target || !(args.target instanceof GuildMember || args.target instanceof Channel))
+ if (!args.target || !(args.target instanceof GuildMember || args.target instanceof BaseChannel))
return await message.util.reply(`${emojis.error} You can only block users or channels.`);
- if (args.target instanceof Channel && !args.target.isTextBased())
+ if (args.target instanceof BaseChannel && !args.target.isTextBased())
return await message.util.reply(`${emojis.error} You can only block text-based channels.`);
const res = await this.client.highlightManager.addBlock(message.guildId, message.author.id, args.target);
diff --git a/src/commands/utilities/highlight-unblock.ts b/src/commands/utilities/highlight-unblock.ts
index d731205..2e9dd73 100644
--- a/src/commands/utilities/highlight-unblock.ts
+++ b/src/commands/utilities/highlight-unblock.ts
@@ -1,7 +1,7 @@
import { AllowedMentions, BushCommand, emojis, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
-import assert from 'assert/strict';
+import assert from 'assert';
import { Argument, ArgumentGeneratorReturn } from 'discord-akairo';
-import { Channel, GuildMember, User } from 'discord.js';
+import { BaseChannel, GuildMember, User } from 'discord.js';
import { UnblockResult } from '../../lib/common/HighlightManager.js';
import { highlightSubcommands } from './highlight-!.js';
@@ -40,10 +40,10 @@ export default class HighlightUnblockCommand extends BushCommand {
if (!args.target) return message.util.reply(`${emojis.error} Could not resolve member.`);
- if (!(args.target instanceof GuildMember || args.target instanceof Channel))
+ if (!(args.target instanceof GuildMember || args.target instanceof BaseChannel))
return await message.util.reply(`${emojis.error} You can only unblock users or channels.`);
- if (args.target instanceof Channel && !args.target.isTextBased())
+ if (args.target instanceof BaseChannel && !args.target.isTextBased())
return await message.util.reply(`${emojis.error} You can only unblock text-based channels.`);
const res = await this.client.highlightManager.removeBlock(message.guildId, message.author.id, args.target);
diff --git a/src/lib/extensions/discord.js/ExtendedGuild.ts b/src/lib/extensions/discord.js/ExtendedGuild.ts
index 88bf5f1..e55851b 100644
--- a/src/lib/extensions/discord.js/ExtendedGuild.ts
+++ b/src/lib/extensions/discord.js/ExtendedGuild.ts
@@ -661,7 +661,7 @@ export class ExtendedGuild extends Guild {
case MessageType.ChannelPinnedMessage:
throw new Error('Not implemented yet: MessageType.ChannelPinnedMessage case');
- case MessageType.GuildMemberJoin: {
+ case MessageType.UserJoin: {
const messages = [
'{username} joined the party.',
'{username} is here.',
@@ -686,15 +686,15 @@ export class ExtendedGuild extends Guild {
sendOptions.content = `${emojis.join} ${message}`;
break;
}
- case MessageType.UserPremiumGuildSubscription:
+ case MessageType.GuildBoost:
sendOptions.content = `<:NitroBoost:585558042309820447> ${displayName} just boosted the server${
quote.content ? ` **${quote.content}** times` : ''
}!`;
break;
- case MessageType.UserPremiumGuildSubscriptionTier1:
- case MessageType.UserPremiumGuildSubscriptionTier2:
- case MessageType.UserPremiumGuildSubscriptionTier3:
+ case MessageType.GuildBoostTier1:
+ case MessageType.GuildBoostTier2:
+ case MessageType.GuildBoostTier3:
sendOptions.content = `<:NitroBoost:585558042309820447> ${displayName} just boosted the server${
quote.content ? ` **${quote.content}** times` : ''
}! ${quote.guild?.name} has achieved **Level ${quote.type - 8}!**`;
diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts
index 8a7bf03..0fd9113 100644
--- a/src/lib/utils/BushConstants.ts
+++ b/src/lib/utils/BushConstants.ts
@@ -268,7 +268,7 @@ export const mappings = deepLock({
[GuildFeature.Verified]: { name: 'Verified', important: true, emoji: '<:verified:850795049817473066>', weight: 0 },
[GuildFeature.Partnered]: { name: 'Partnered', important: true, emoji: '<:partneredServer:850794851955507240>', weight: 1 },
[GuildFeature.MoreStickers]: { name: 'More Stickers', important: true, emoji: null, weight: 2 },
- 'MORE_EMOJIS': { name: 'More Emoji', important: true, emoji: '<:moreEmoji:850786853497602080>', weight: 3 },
+ MORE_EMOJIS: { name: 'More Emoji', important: true, emoji: '<:moreEmoji:850786853497602080>', weight: 3 },
[GuildFeature.Featurable]: { name: 'Featurable', important: true, emoji: '<:featurable:850786776372084756>', weight: 4 },
[GuildFeature.RelayEnabled]: { name: 'Relay Enabled', important: true, emoji: '<:relayEnabled:850790531441229834>', weight: 5 },
[GuildFeature.Discoverable]: { name: 'Discoverable', important: true, emoji: '<:discoverable:850786735360966656>', weight: 6 },
@@ -276,7 +276,7 @@ export const mappings = deepLock({
[GuildFeature.MonetizationEnabled]: { name: 'Monetization Enabled', important: true, emoji: null, weight: 8 },
[GuildFeature.TicketedEventsEnabled]: { name: 'Ticketed Events Enabled', important: true, emoji: null, weight: 9 },
[GuildFeature.PreviewEnabled]: { name: 'Preview Enabled', important: true, emoji: '<:previewEnabled:850790508266913823>', weight: 10 },
- [GuildFeature.Commerce]: { name: 'Store Channels', important: true, emoji: '<:storeChannels:850786692432396338>', weight: 11 },
+ COMMERCE: { name: 'Store Channels', important: true, emoji: '<:storeChannels:850786692432396338>', weight: 11 },
[GuildFeature.VanityURL]: { name: 'Vanity URL', important: false, emoji: '<:vanityURL:850790553079644160>', weight: 12 },
[GuildFeature.VIPRegions]: { name: 'VIP Regions', important: false, emoji: '<:VIPRegions:850794697496854538>', weight: 13 },
[GuildFeature.AnimatedIcon]: { name: 'Animated Icon', important: false, emoji: '<:animatedIcon:850774498071412746>', weight: 14 },
@@ -359,7 +359,8 @@ export const mappings = deepLock({
VerifiedDeveloper: '<:earlyVerifiedBotDeveloper:848741079875846174>',
CertifiedModerator: '<:discordCertifiedModerator:877224285901582366>',
BotHTTPInteractions: 'BotHTTPInteractions',
- Spammer: 'Spammer'
+ Spammer: 'Spammer',
+ Quarantined: 'Quarantined'
},
status: {
diff --git a/src/listeners/message/boosterMessage.ts b/src/listeners/message/boosterMessage.ts
index 1a4d3c3..0879ced 100644
--- a/src/listeners/message/boosterMessage.ts
+++ b/src/listeners/message/boosterMessage.ts
@@ -12,7 +12,11 @@ export default class BoosterMessageListener extends BushListener {
public async exec(...[message]: BushClientEvents['messageCreate']) {
if (!message.guild || !(await message.guild?.hasFeature('boosterMessageReact'))) return;
- if (message.type === MessageType.UserPremiumGuildSubscription) {
+ if (
+ [MessageType.GuildBoost, MessageType.GuildBoostTier1, MessageType.GuildBoostTier2, MessageType.GuildBoostTier3].includes(
+ message.type
+ )
+ ) {
return await message.react('<:nitroboost:785160348885975062>').catch(() => {
void this.client.console.warn('boosterMessage', `Failed to react to <<${message.id}>>.`);
});
diff --git a/src/listeners/other/consoleListener.ts b/src/listeners/other/consoleListener.ts
index 3e72e9e..b9da46e 100644
--- a/src/listeners/other/consoleListener.ts
+++ b/src/listeners/other/consoleListener.ts
@@ -23,7 +23,6 @@ import { promisify } from 'util';
ButtonInteraction,
Collector,
CommandInteraction,
- Interaction,
Message,
ActionRow,
Attachment,