From 840cca672d681c36f980a06fb79a4e2c01bd69ac Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 25 Jan 2022 23:47:40 -0500 Subject: I love breaking changes!!!! --- src/lib/extensions/discord-akairo/BushClient.ts | 1 + .../extensions/discord-akairo/BushClientUtil.ts | 25 +--------------------- .../extensions/discord.js/BushButtonInteraction.ts | 2 +- .../discord.js/BushChatInputCommandInteraction.ts | 2 +- src/lib/extensions/discord.js/BushGuild.ts | 4 ++-- .../discord.js/BushSelectMenuInteraction.ts | 2 +- 6 files changed, 7 insertions(+), 29 deletions(-) (limited to 'src/lib/extensions') diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 01620a8..712d610 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -190,6 +190,7 @@ export class BushClient extends AkairoClient acc | p, 0), + partials: ['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION', 'GUILD_SCHEDULED_EVENT'], presence: { activities: [ { diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 79aa4c1..968a805 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -16,21 +16,19 @@ import { type Pronoun, type PronounCode } from '#lib'; -import type { APIMessage } from '@discordjs/builders/node_modules/discord-api-types'; import { humanizeDuration } from '@notenoughupdates/humanize-duration'; import { exec } from 'child_process'; import deepLock from 'deep-lock'; import { ClientUtil, Util as AkairoUtil } from 'discord-akairo'; +import type { APIMessage } from 'discord-api-types'; import { Constants as DiscordConstants, GuildMember, Message, - MessageEmbed, Permissions, ThreadMember, User, Util as DiscordUtil, - type ColorResolvable, type CommandInteraction, type InteractionReplyOptions, type Snowflake, @@ -196,27 +194,6 @@ export class BushClientUtil extends ClientUtil { return client.consts.emojis; } - /** - * A simple utility to create and embed with the needed style for the bot. - * @param color The color to set the embed to. - * @param author The author to set the embed to. - * @returns The generated embed. - */ - public createEmbed(color?: ColorResolvable, author?: User | GuildMember): MessageEmbed { - if (author instanceof GuildMember) { - author = author.user; // Convert to User if GuildMember - } - let embed = new MessageEmbed().setTimestamp(); - if (author) - embed = embed.setAuthor({ - name: author.username, - iconURL: author.displayAvatarURL(), - url: `https://discord.com/users/${author.id}` - }); - if (color) embed = embed.setColor(color); - return embed; - } - /** * Fetches a user's uuid from the mojang api. * @param username The username to get the uuid of. diff --git a/src/lib/extensions/discord.js/BushButtonInteraction.ts b/src/lib/extensions/discord.js/BushButtonInteraction.ts index 191ad5c..b7ad77c 100644 --- a/src/lib/extensions/discord.js/BushButtonInteraction.ts +++ b/src/lib/extensions/discord.js/BushButtonInteraction.ts @@ -1,5 +1,5 @@ import type { BushClient, BushGuild, BushGuildMember, BushGuildTextBasedChannel, BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember } from '@discordjs/builders/node_modules/discord-api-types/payloads/v9/_interactions/base'; +import type { APIInteractionGuildMember } from 'discord-api-types'; import { ButtonInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; import type { RawMessageButtonInteractionData } from 'discord.js/typings/rawDataTypes'; diff --git a/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts b/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts index 56bef21..4d68f79 100644 --- a/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts +++ b/src/lib/extensions/discord.js/BushChatInputCommandInteraction.ts @@ -10,7 +10,7 @@ import type { BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember } from '@discordjs/builders/node_modules/discord-api-types'; +import type { APIInteractionGuildMember } from 'discord-api-types'; import { ChatInputCommandInteraction, type CacheType, type CacheTypeReducer, type Invite, type Snowflake } from 'discord.js'; import type { RawCommandInteractionData } from 'discord.js/typings/rawDataTypes'; diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 9f114b6..bbef953 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -367,11 +367,11 @@ export class BushGuild extends Guild { await channel.send({ embeds: [ { - author: { name: moderator.user.tag, iconURL: moderator.displayAvatarURL() }, + author: { name: moderator.user.tag, icon_url: moderator.displayAvatarURL() }, title: `This channel has been ${options.unlock ? 'un' : ''}locked`, description: options.reason ?? 'No reason provided', color: options.unlock ? util.colors.discord.GREEN : util.colors.discord.RED, - timestamp: Date.now() + timestamp: new Date().toISOString() } ] }); diff --git a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts index 23e2453..2c7c329 100644 --- a/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts +++ b/src/lib/extensions/discord.js/BushSelectMenuInteraction.ts @@ -1,5 +1,5 @@ import type { BushClient, BushGuild, BushGuildMember, BushGuildTextBasedChannel, BushTextBasedChannel, BushUser } from '#lib'; -import type { APIInteractionGuildMember } from '@discordjs/builders/node_modules/discord-api-types'; +import type { APIInteractionGuildMember } from 'discord-api-types'; import { SelectMenuInteraction, type CacheType, type CacheTypeReducer } from 'discord.js'; import type { RawMessageSelectMenuInteractionData } from 'discord.js/typings/rawDataTypes'; -- cgit