Type fix and clean up

This commit is contained in:
2022-06-06 21:43:27 +07:00
parent 9532b053b4
commit d0a33d53c3
+11 -13
View File
@@ -11,8 +11,7 @@ import {
Message, Message,
ColorResolvable, ColorResolvable,
Interaction, Interaction,
InteractionReplyOptions, InteractionReplyOptions
CommandInteraction
} from 'discord.js'; } from 'discord.js';
import App from '..'; import App from '..';
@@ -29,7 +28,7 @@ interface EmbedData {
description?: any; description?: any;
color?: ColorResolvable; color?: ColorResolvable;
fields?: any; fields?: any;
user?: User; user?: User | null;
setTimestamp: boolean; setTimestamp: boolean;
} }
@@ -39,7 +38,7 @@ interface EmbedDataPresets {
description?: any; description?: any;
color?: ColorResolvable; color?: ColorResolvable;
fields?: any; fields?: any;
user?: User; user?: User | null;
setTimestamp?: boolean; setTimestamp?: boolean;
} }
@@ -81,15 +80,15 @@ export function makeInfoEmbed(data: EmbedDataPresets) {
}); });
} }
export function makeSuccessEmbed(options: EmbedDataPresets) { export function makeSuccessEmbed(data: EmbedDataPresets) {
return makeEmbed({ return makeEmbed({
icon: !options.icon ? '✅' : options.icon, icon: !data.icon ? '✅' : data.icon,
title: options.title, title: data.title,
description: options.description, description: data.description,
color: '#B5EAD7', color: '#B5EAD7',
fields: options.fields, fields: data.fields,
user: options.user, user: data.user,
setTimestamp: options.setTimestamp || true setTimestamp: data.setTimestamp || true
}); });
} }
@@ -208,7 +207,6 @@ export function getEmotes() {
return emotes; return emotes;
} }
async function sendReply(rMessage: Message, options: string | MessagePayload | MessageOptions) { async function sendReply(rMessage: Message, options: string | MessagePayload | MessageOptions) {
let message; let message;
@@ -226,4 +224,4 @@ async function sendReply(rMessage: Message, options: string | MessagePayload | M
} finally { } finally {
return message; return message;
} }
} }