Skip to content

Commit f948004

Browse files
committed
Fully functional variant mode
1 parent 184aa7c commit f948004

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/embeds/imageSelectPrompt.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ export default function(queueItem: QueueItem): BotEmbed {
1919
.setPlaceholder('Select an image')
2020
.addOptions(
2121
{
22-
label: 'Top Left',
22+
label: '↖️ Top Left',
2323
description: 'The top left image.',
24-
value: 'topLeft',
24+
value: '0',
2525
},
2626
{
27-
label: 'Top Right',
27+
label: '↗️ Top Right',
2828
description: 'The top right image.',
29-
value: 'topRight',
29+
value: '1',
3030
},
3131
{
32-
label: 'Bottom Left',
32+
label: '↙️ Bottom Left',
3333
description: 'The bottom left image.',
34-
value: 'bottomLeft',
34+
value: '2',
3535
},
3636
{
37-
label: 'Bottom Right',
37+
label: '↘️ Bottom Right',
3838
description: 'The bottom right image.',
39-
value: 'bottomRight',
39+
value: '3',
4040
},
4141
)
4242
])

src/events/buttonImagineVariantOf.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Interaction } from "discord.js"
2-
import { isEmpty, isNil } from "ramda"
2+
import { compose, isEmpty, isNil } from "ramda"
33
import { Bot } from '../bot'
44
import { BotEvent, QueueItem, QueueItemType } from '../types'
55
import imageSelectPrompt from '../embeds/imageSelectPrompt'
@@ -24,8 +24,10 @@ const botEvent: BotEvent = {
2424
return
2525
}
2626

27+
const [selectedImage] = interaction.values
28+
2729
// Ensure PNG
28-
const selectedImageB64 = `data:image/png;base64,${referenceQueueItem.imageData[0].toString('base64')}`
30+
const selectedImageB64 = `data:image/png;base64,${referenceQueueItem.imageData[+selectedImage].toString('base64')}`
2931
const queueItem: QueueItem = {
3032
...referenceQueueItem,
3133
type: QueueItemType.Variant,

0 commit comments

Comments
 (0)