From d0a33d53c31569c7014e9aa8b244c8848b37bd09 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Mon, 6 Jun 2022 21:43:27 +0700 Subject: [PATCH] Type fix and clean up --- src/utils/DiscordMessage.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/utils/DiscordMessage.ts b/src/utils/DiscordMessage.ts index 04a02f5..75f8358 100644 --- a/src/utils/DiscordMessage.ts +++ b/src/utils/DiscordMessage.ts @@ -11,8 +11,7 @@ import { Message, ColorResolvable, Interaction, - InteractionReplyOptions, - CommandInteraction + InteractionReplyOptions } from 'discord.js'; import App from '..'; @@ -29,7 +28,7 @@ interface EmbedData { description?: any; color?: ColorResolvable; fields?: any; - user?: User; + user?: User | null; setTimestamp: boolean; } @@ -39,7 +38,7 @@ interface EmbedDataPresets { description?: any; color?: ColorResolvable; fields?: any; - user?: User; + user?: User | null; setTimestamp?: boolean; } @@ -81,15 +80,15 @@ export function makeInfoEmbed(data: EmbedDataPresets) { }); } -export function makeSuccessEmbed(options: EmbedDataPresets) { +export function makeSuccessEmbed(data: EmbedDataPresets) { return makeEmbed({ - icon: !options.icon ? '✅' : options.icon, - title: options.title, - description: options.description, + icon: !data.icon ? '✅' : data.icon, + title: data.title, + description: data.description, color: '#B5EAD7', - fields: options.fields, - user: options.user, - setTimestamp: options.setTimestamp || true + fields: data.fields, + user: data.user, + setTimestamp: data.setTimestamp || true }); } @@ -208,7 +207,6 @@ export function getEmotes() { return emotes; } - async function sendReply(rMessage: Message, options: string | MessagePayload | MessageOptions) { let message; @@ -226,4 +224,4 @@ async function sendReply(rMessage: Message, options: string | MessagePayload | M } finally { return message; } -} \ No newline at end of file +}