Skip to content

Commit

Permalink
revert all code to normal pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Moschkin committed Oct 10, 2023
1 parent d36e7d2 commit 6897470
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/utils/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,10 @@ export async function sendAndCache(message: Message | CommandInteraction, conten
if (message instanceof CommandInteraction) {

let flags = options?.ephemeral ? MessageFlags.Ephemeral : 0; // { ephemeral: options?.ephemeral, embeds: options?.embeds?.splice(0,10) };
if (options?.isFollowUp) {
let result = await message.followUp({ content, flags, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) })
if (result instanceof Message) {
result.edit({ content, flags, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) })
}
}

else {
let result = await message.reply({ content, flags, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) })
if (result instanceof Message) {
result.edit({ content, flags, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) })
}
}

if (options?.isFollowUp)
message.followUp({ content, flags, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) })
else
message.reply({ content, flags, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) })
while ((options?.embeds?.length ?? 0) > 0){
let msg = { ephemeral: options?.ephemeral, embeds: options?.embeds?.splice(0,10)?.map((e) => e.toJSON()) };
message.followUp(msg);
Expand Down

0 comments on commit 6897470

Please sign in to comment.