Skip to content

Commit

Permalink
Add bank image spoiler option & apply at solo nex (#6177)
Browse files Browse the repository at this point in the history
  • Loading branch information
DayV-git authored Nov 7, 2024
1 parent ffb52a1 commit f884ab3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/lib/util/handleTripFinish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ export async function handleTripFinish(
user: MUser,
channelID: string,
_message: string | ({ content: string } & MessageCreateOptions),
attachment: AttachmentBuilder | Buffer | undefined,
attachment:
| AttachmentBuilder
| Buffer
| undefined
| {
name: string;
attachment: Buffer;
},
data: ActivityTaskData,
loot: Bank | null,
_messages?: string[],
Expand Down
4 changes: 3 additions & 1 deletion src/lib/util/makeBankImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface MakeBankImageOptions {
content?: string;
title?: string;
background?: number;
spoiler?: boolean;
flags?: Record<string, string | number>;
user?: MUser;
previousCL?: Bank;
Expand All @@ -21,6 +22,7 @@ export async function makeBankImage({
background,
user,
previousCL,
spoiler,
showNewCL = false,
flags = {},
mahojiFlags = []
Expand All @@ -40,7 +42,7 @@ export async function makeBankImage({

return {
file: {
name: isTransparent ? 'bank.png' : 'bank.jpg',
name: `${spoiler ? 'SPOILER_' : ''}${isTransparent ? 'bank.png' : 'bank.jpg'}`,
attachment: image!
}
};
Expand Down
5 changes: 3 additions & 2 deletions src/tasks/minions/nexActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ ${loot.formatLoot()}`
bank: loot.totalLoot(),
title: `Loot From ${survivedQuantity}x Nex`,
user: allMUsers[0],
previousCL: undefined
previousCL: undefined,
spoiler: loot.purpleItems.some(i => loot.totalLoot().has(i))
})
).file.attachment
).file
: undefined,
data,
loot.totalLoot()
Expand Down

0 comments on commit f884ab3

Please sign in to comment.