apexify.js 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -210,11 +210,16 @@ module.exports = {
210
210
 
211
211
  - Canvas Background configuration.
212
212
  - Canvas Images/shapes/custom drawing configuration.
213
- - Canvas Text on background or image configuration.
213
+ - Canvas Text: Adding text on background or image configuration.
214
+ - Canvas Custom Drawing: Draw on canvas freely using lines and coordinates.
214
215
  - Canvas Filters: Color/Effects.
215
216
  - Canvas Gif: Creating Gif from set of images.
216
217
  - Canvas Resizing and Extention Converter for images.
217
218
  - Canvas Charts: Creating piechart/barcharts/linecharts using the given set of data.
219
+ - Canvas Background Remover: Removes a background from images.
220
+ - Canvas Colors Detector: Detect colors in an image.
221
+ - Canvas Color Remover: Remove a specifc color from an image using rgb.
222
+ - Canvas Image Croper: Cropping image freely and customizable.
218
223
 
219
224
  <details>
220
225
 
@@ -242,6 +247,8 @@ const canvasBg = {
242
247
  type: 'linear', // Specifies the type of gradient ('radial' or 'linear').
243
248
  startX: 0, // Starting coordinate on the x-axis for the gradient.
244
249
  startY: 0, // Starting coordinate on the y-axis for the gradient.
250
+ startRadius: 0, // Starting radius for the radial gradient
251
+ endRadius: 0, // Ending radius for the radial gradient
245
252
  endX: 800, // Ending coordinate on the x-axis for the gradient.
246
253
  endY: 600, // Ending coordinate on the y-axis for the gradient.
247
254
  colors: [ // Array of objects specifying color stops and corresponding colors for the gradient.
@@ -1 +1 @@
1
- {"version":3,"file":"drawMenu.d.ts","sourceRoot":"","sources":["../../../lib/ai/buttons/drawMenu.ts"],"names":[],"mappings":"AAAA,iBAAe,UAAU,CACrB,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,GAAG,EACjB,gBAAgB,EAAE,GAAG,EACrB,cAAc,EAAE,GAAG,EACnB,gBAAgB,EAAE,GAAG,GACpB,OAAO,CAAC,IAAI,CAAC,CA8Vf;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"drawMenu.d.ts","sourceRoot":"","sources":["../../../lib/ai/buttons/drawMenu.ts"],"names":[],"mappings":"AAAA,iBAAe,UAAU,CACrB,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,GAAG,EACjB,gBAAgB,EAAE,GAAG,EACrB,cAAc,EAAE,GAAG,EACnB,gBAAgB,EAAE,GAAG,GACpB,OAAO,CAAC,IAAI,CAAC,CA+Vf;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -7,264 +7,267 @@ async function imageTools(Apex, ModalBuilder, TextInputBuilder, TextInputStyle,
7
7
  return;
8
8
  const MenuId = a.customId;
9
9
  const selectedOptionId = a.values[0];
10
- if (MenuId === "image_processing_select") {
11
- if (selectedOptionId === "process_1") {
12
- const modal = new ModalBuilder()
13
- .setCustomId("resizing_image_zenithmodal")
14
- .setTitle("Resizing Image");
15
- const imagePos = new TextInputBuilder()
16
- .setCustomId("Image_Postion")
17
- .setLabel("Image Number")
18
- .setMaxLength(1)
19
- .setMinLength(1)
20
- .setPlaceholder("Modal you want to resize (e.g => 1st image/2nd image/3rd image/4th image)")
21
- .setRequired(true)
22
- .setStyle(TextInputStyle.Short);
23
- const imageWidth = new TextInputBuilder()
24
- .setCustomId("modal_resizingImage_width")
25
- .setLabel("Image Width")
26
- .setStyle(TextInputStyle.Short);
27
- const imageHeight = new TextInputBuilder()
28
- .setCustomId("modal_resizingImage_height")
29
- .setLabel("Image Height")
30
- .setStyle(TextInputStyle.Short);
31
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
32
- const secondActionRow = new ActionRowBuilder().addComponents(imageWidth);
33
- const thirddActionRow = new ActionRowBuilder().addComponents(imageHeight);
34
- modal.addComponents(firstActionRow, secondActionRow, thirddActionRow);
35
- await a.showModal(modal);
36
- }
37
- else if (selectedOptionId === "process_2") {
38
- const modal = new ModalBuilder()
39
- .setCustomId("Color_Filters")
40
- .setTitle("Coloring An Image");
41
- const imagePos = new TextInputBuilder()
42
- .setCustomId("Image_Postion")
43
- .setLabel("Image Number")
44
- .setMaxLength(1)
45
- .setMinLength(1)
46
- .setPlaceholder("Modal you want to apply filter on (e.g => 1st image/2nd image/3rd image/4th image)")
47
- .setRequired(true)
48
- .setStyle(TextInputStyle.Short);
49
- const color = new TextInputBuilder()
50
- .setCustomId("color_filter_image")
51
- .setLabel("Color Filter")
52
- .setMaxLength(7)
53
- .setPlaceholder("Color in hex code (e.g => #00ff00 for green)")
54
- .setMinLength(7)
55
- .setRequired(true)
56
- .setStyle(TextInputStyle.Short);
57
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
58
- const secondActionRow = new ActionRowBuilder().addComponents(color);
59
- modal.addComponents(firstActionRow, secondActionRow);
60
- await a.showModal(modal);
61
- }
62
- else if (selectedOptionId === "process_3") {
63
- const modal = new ModalBuilder()
64
- .setCustomId("Convert_Image_Extension")
65
- .setTitle("Convert An Image");
66
- const imagePos = new TextInputBuilder()
67
- .setCustomId("Image_Postion")
68
- .setLabel("Image Number")
69
- .setMaxLength(1)
70
- .setMinLength(1)
71
- .setPlaceholder("Modal you want to convert (e.g => 1st image/2nd image/3rd image/4th image)")
72
- .setRequired(true)
73
- .setStyle(TextInputStyle.Short);
74
- const imageType = new TextInputBuilder()
75
- .setCustomId("image_type")
76
- .setLabel("Image Extension")
77
- .setMaxLength(5)
78
- .setPlaceholder("Type extensions (e.g => (png), (jpg), (webp), (avif) )")
79
- .setRequired(true)
80
- .setStyle(TextInputStyle.Short);
81
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
82
- const secondActionRow = new ActionRowBuilder().addComponents(imageType);
83
- modal.addComponents(firstActionRow, secondActionRow);
84
- await a.showModal(modal);
85
- }
86
- else if (selectedOptionId === "process_4") {
87
- const modal = new ModalBuilder()
88
- .setCustomId("Image_Brightness")
89
- .setTitle("Brightening An Image");
90
- const imagePos = new TextInputBuilder()
91
- .setCustomId("Image_Postion")
92
- .setLabel("Image Number")
93
- .setMaxLength(1)
94
- .setMinLength(1)
95
- .setPlaceholder("Modal you want to brighten (e.g => 1st image/2nd image/3rd image/4th image)")
96
- .setRequired(true)
97
- .setStyle(TextInputStyle.Short);
98
- const brightnessDegree = new TextInputBuilder()
99
- .setCustomId("brightness_degree")
100
- .setLabel("Brightness Degree")
101
- .setMaxLength(5)
102
- .setPlaceholder("Brightness value (e.g => 0 -> 1 (3 decimal places are accepted))")
103
- .setRequired(true)
104
- .setStyle(TextInputStyle.Short);
105
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
106
- const secondActionRow = new ActionRowBuilder().addComponents(brightnessDegree);
107
- modal.addComponents(firstActionRow, secondActionRow);
108
- await a.showModal(modal);
109
- }
110
- else if (selectedOptionId === "process_5") {
111
- const modal = new ModalBuilder()
112
- .setCustomId("Sepia_Filter")
113
- .setTitle("Apply Sepia On Image");
114
- const imagePos = new TextInputBuilder()
115
- .setCustomId("Image_Postion")
116
- .setLabel("Image Number")
117
- .setMaxLength(1)
118
- .setMinLength(1)
119
- .setPlaceholder("Modal you want to apply Sepia on (e.g => 1st image/2nd image/3rd image/4th image)")
120
- .setRequired(true)
121
- .setStyle(TextInputStyle.Short);
122
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
123
- modal.addComponents(firstActionRow);
124
- await a.showModal(modal);
125
- }
126
- else if (selectedOptionId === "process_6") {
127
- const modal = new ModalBuilder()
128
- .setCustomId("Pixelate_Filter")
129
- .setTitle("Apply Pixelate On Image");
130
- const imagePos = new TextInputBuilder()
131
- .setCustomId("Image_Postion")
132
- .setLabel("Image Number")
133
- .setMaxLength(1)
134
- .setMinLength(1)
135
- .setPlaceholder("Modal you want to apply Pixelate on (e.g => 1st image/2nd image/3rd image/4th image)")
136
- .setRequired(true)
137
- .setStyle(TextInputStyle.Short);
138
- const xyInput = new TextInputBuilder()
139
- .setCustomId("Pixelate_XY")
140
- .setLabel("X, Y Positions")
141
- .setPlaceholder("Enter X, Y positions (e.g => (100, 150) )")
142
- .setRequired(true)
143
- .setStyle(TextInputStyle.Short);
144
- const whInput = new TextInputBuilder()
145
- .setCustomId("Pixelate_WH")
146
- .setLabel("Width, Height")
147
- .setPlaceholder("Enter width, height (e.g => (50, 50) )")
148
- .setRequired(true)
149
- .setStyle(TextInputStyle.Short);
150
- const sizeInput = new TextInputBuilder()
151
- .setCustomId("Pixelate_Size")
152
- .setLabel("Pixelate Size")
153
- .setPlaceholder("Enter pixelate size")
154
- .setRequired(true)
155
- .setStyle(TextInputStyle.Short);
156
- const st = new ActionRowBuilder().addComponents(imagePos);
157
- const nd = new ActionRowBuilder().addComponents(xyInput);
158
- const rd = new ActionRowBuilder().addComponents(whInput);
159
- const th = new ActionRowBuilder().addComponents(sizeInput);
160
- modal.addComponents(st, nd, rd, th);
161
- await a.showModal(modal);
162
- }
163
- else if (selectedOptionId === "process_7") {
164
- const modal = new ModalBuilder()
165
- .setCustomId("Image_Blur")
166
- .setTitle("Blurring An Image");
167
- const imagePos = new TextInputBuilder()
168
- .setCustomId("Image_Postion")
169
- .setLabel("Image Number")
170
- .setMaxLength(1)
171
- .setMinLength(1)
172
- .setPlaceholder("Modal you want to blur (e.g => 1st image/2nd image/3rd image/4th image)")
173
- .setRequired(true)
174
- .setStyle(TextInputStyle.Short);
175
- const blurDegree = new TextInputBuilder()
176
- .setCustomId("blur_radius")
177
- .setLabel("Blurring Radius")
178
- .setMaxLength(5)
179
- .setPlaceholder("Blur value (e.g => (value = 1-100 as max) )")
180
- .setRequired(true)
181
- .setStyle(TextInputStyle.Short);
182
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
183
- const secondActionRow = new ActionRowBuilder().addComponents(blurDegree);
184
- modal.addComponents(firstActionRow, secondActionRow);
185
- await a.showModal(modal);
186
- }
187
- else if (selectedOptionId === "process_8") {
188
- const modal = new ModalBuilder()
189
- .setCustomId("Image_Fade")
190
- .setTitle("Fading An Image");
191
- const imagePos = new TextInputBuilder()
192
- .setCustomId("Image_Postion")
193
- .setLabel("Image Number")
194
- .setMaxLength(1)
195
- .setMinLength(1)
196
- .setPlaceholder("Modal you want to fade (e.g => 1st image/2nd image/3rd image/4th image)")
197
- .setRequired(true)
198
- .setStyle(TextInputStyle.Short);
199
- const fadeDegree = new TextInputBuilder()
200
- .setCustomId("fade_factor")
201
- .setLabel("Fade By Factor")
202
- .setMaxLength(5)
203
- .setPlaceholder("Fade value (e.g => (value = 0-1 as max) )")
204
- .setRequired(true)
205
- .setStyle(TextInputStyle.Short);
206
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
207
- const secondActionRow = new ActionRowBuilder().addComponents(fadeDegree);
208
- modal.addComponents(firstActionRow, secondActionRow);
209
- await a.showModal(modal);
210
- }
211
- else if (selectedOptionId === "process_9") {
212
- const modal = new ModalBuilder()
213
- .setCustomId("Image_Opaque")
214
- .setTitle("Opaque An Image");
215
- const imagePos = new TextInputBuilder()
216
- .setCustomId("Image_Postion")
217
- .setLabel("Image Number")
218
- .setMaxLength(1)
219
- .setMinLength(1)
220
- .setPlaceholder("Modal you want to opaque (e.g => 1st image/2nd image/3rd image/4th image)")
221
- .setRequired(true)
222
- .setStyle(TextInputStyle.Short);
223
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
224
- modal.addComponents(firstActionRow);
225
- await a.showModal(modal);
226
- }
227
- else if (selectedOptionId === "process_10") {
228
- const modal = new ModalBuilder()
229
- .setCustomId("Image_GrayScale")
230
- .setTitle("GrayScale An Image");
231
- const imagePos = new TextInputBuilder()
232
- .setCustomId("Image_Postion")
233
- .setLabel("Image Number")
234
- .setMaxLength(1)
235
- .setMinLength(1)
236
- .setPlaceholder("Modal you want to apply grayscale on (e.g => 1st image/2nd image/3rd image/4th image)")
237
- .setRequired(true)
238
- .setStyle(TextInputStyle.Short);
239
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
240
- modal.addComponents(firstActionRow);
241
- await a.showModal(modal);
242
- }
243
- else if (selectedOptionId === "process_11") {
244
- const modal = new ModalBuilder()
245
- .setCustomId("Image_Contrast")
246
- .setTitle("Contrast An Image");
247
- const imagePos = new TextInputBuilder()
248
- .setCustomId("Image_Postion")
249
- .setLabel("Image Number")
250
- .setMaxLength(1)
251
- .setMinLength(1)
252
- .setPlaceholder("Modal you want to apply contrast on (e.g => 1st image/2nd image/3rd image/4th image)")
253
- .setRequired(true)
254
- .setStyle(TextInputStyle.Short);
255
- const contrastValue = new TextInputBuilder()
256
- .setCustomId("Contrast_Value")
257
- .setLabel("Contrast Value")
258
- .setMaxLength(4)
259
- .setPlaceholder("Contrast value (e.g => (value = 0-2 as max) )")
260
- .setRequired(true)
261
- .setStyle(TextInputStyle.Short);
262
- const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
263
- const secondActionRow = new ActionRowBuilder().addComponents(contrastValue);
264
- modal.addComponents(firstActionRow, secondActionRow);
265
- await a.showModal(modal);
10
+ try {
11
+ if (MenuId === "image_processing_select") {
12
+ if (selectedOptionId === "process_1") {
13
+ const modal = new ModalBuilder()
14
+ .setCustomId("resizing_image_zenithmodal")
15
+ .setTitle("Resizing Image");
16
+ const imagePos = new TextInputBuilder()
17
+ .setCustomId("Image_Postion")
18
+ .setLabel("Image Number")
19
+ .setMaxLength(1)
20
+ .setMinLength(1)
21
+ .setPlaceholder("Modal you want to resize (e.g => 1st image/2nd image/3rd image/4th image)")
22
+ .setRequired(true)
23
+ .setStyle(TextInputStyle.Short);
24
+ const imageWidth = new TextInputBuilder()
25
+ .setCustomId("modal_resizingImage_width")
26
+ .setLabel("Image Width")
27
+ .setStyle(TextInputStyle.Short);
28
+ const imageHeight = new TextInputBuilder()
29
+ .setCustomId("modal_resizingImage_height")
30
+ .setLabel("Image Height")
31
+ .setStyle(TextInputStyle.Short);
32
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
33
+ const secondActionRow = new ActionRowBuilder().addComponents(imageWidth);
34
+ const thirddActionRow = new ActionRowBuilder().addComponents(imageHeight);
35
+ modal.addComponents(firstActionRow, secondActionRow, thirddActionRow);
36
+ await a.showModal(modal);
37
+ }
38
+ else if (selectedOptionId === "process_2") {
39
+ const modal = new ModalBuilder()
40
+ .setCustomId("Color_Filters")
41
+ .setTitle("Coloring An Image");
42
+ const imagePos = new TextInputBuilder()
43
+ .setCustomId("Image_Postion")
44
+ .setLabel("Image Number")
45
+ .setMaxLength(1)
46
+ .setMinLength(1)
47
+ .setPlaceholder("Modal you want to apply filter on (e.g => 1st image/2nd image/3rd image/4th image)")
48
+ .setRequired(true)
49
+ .setStyle(TextInputStyle.Short);
50
+ const color = new TextInputBuilder()
51
+ .setCustomId("color_filter_image")
52
+ .setLabel("Color Filter")
53
+ .setMaxLength(7)
54
+ .setPlaceholder("Color in hex code (e.g => #00ff00 for green)")
55
+ .setMinLength(7)
56
+ .setRequired(true)
57
+ .setStyle(TextInputStyle.Short);
58
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
59
+ const secondActionRow = new ActionRowBuilder().addComponents(color);
60
+ modal.addComponents(firstActionRow, secondActionRow);
61
+ await a.showModal(modal);
62
+ }
63
+ else if (selectedOptionId === "process_3") {
64
+ const modal = new ModalBuilder()
65
+ .setCustomId("Convert_Image_Extension")
66
+ .setTitle("Convert An Image");
67
+ const imagePos = new TextInputBuilder()
68
+ .setCustomId("Image_Postion")
69
+ .setLabel("Image Number")
70
+ .setMaxLength(1)
71
+ .setMinLength(1)
72
+ .setPlaceholder("Modal you want to convert (e.g => 1st image/2nd image/3rd image/4th image)")
73
+ .setRequired(true)
74
+ .setStyle(TextInputStyle.Short);
75
+ const imageType = new TextInputBuilder()
76
+ .setCustomId("image_type")
77
+ .setLabel("Image Extension")
78
+ .setMaxLength(5)
79
+ .setPlaceholder("Type extensions (e.g => (png), (jpg), (webp), (avif) )")
80
+ .setRequired(true)
81
+ .setStyle(TextInputStyle.Short);
82
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
83
+ const secondActionRow = new ActionRowBuilder().addComponents(imageType);
84
+ modal.addComponents(firstActionRow, secondActionRow);
85
+ await a.showModal(modal);
86
+ }
87
+ else if (selectedOptionId === "process_4") {
88
+ const modal = new ModalBuilder()
89
+ .setCustomId("Image_Brightness")
90
+ .setTitle("Brightening An Image");
91
+ const imagePos = new TextInputBuilder()
92
+ .setCustomId("Image_Postion")
93
+ .setLabel("Image Number")
94
+ .setMaxLength(1)
95
+ .setMinLength(1)
96
+ .setPlaceholder("Modal you want to brighten (e.g => 1st image/2nd image/3rd image/4th image)")
97
+ .setRequired(true)
98
+ .setStyle(TextInputStyle.Short);
99
+ const brightnessDegree = new TextInputBuilder()
100
+ .setCustomId("brightness_degree")
101
+ .setLabel("Brightness Degree")
102
+ .setMaxLength(5)
103
+ .setPlaceholder("Brightness value (e.g => 0 -> 1 (3 decimal places are accepted))")
104
+ .setRequired(true)
105
+ .setStyle(TextInputStyle.Short);
106
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
107
+ const secondActionRow = new ActionRowBuilder().addComponents(brightnessDegree);
108
+ modal.addComponents(firstActionRow, secondActionRow);
109
+ await a.showModal(modal);
110
+ }
111
+ else if (selectedOptionId === "process_5") {
112
+ const modal = new ModalBuilder()
113
+ .setCustomId("Sepia_Filter")
114
+ .setTitle("Apply Sepia On Image");
115
+ const imagePos = new TextInputBuilder()
116
+ .setCustomId("Image_Postion")
117
+ .setLabel("Image Number")
118
+ .setMaxLength(1)
119
+ .setMinLength(1)
120
+ .setPlaceholder("Modal you want to apply Sepia on (e.g => 1st image/2nd image/3rd image/4th image)")
121
+ .setRequired(true)
122
+ .setStyle(TextInputStyle.Short);
123
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
124
+ modal.addComponents(firstActionRow);
125
+ await a.showModal(modal);
126
+ }
127
+ else if (selectedOptionId === "process_6") {
128
+ const modal = new ModalBuilder()
129
+ .setCustomId("Pixelate_Filter")
130
+ .setTitle("Apply Pixelate On Image");
131
+ const imagePos = new TextInputBuilder()
132
+ .setCustomId("Image_Postion")
133
+ .setLabel("Image Number")
134
+ .setMaxLength(1)
135
+ .setMinLength(1)
136
+ .setPlaceholder("Modal you want to apply Pixelate on (e.g => 1st image/2nd image/3rd image/4th image)")
137
+ .setRequired(true)
138
+ .setStyle(TextInputStyle.Short);
139
+ const xyInput = new TextInputBuilder()
140
+ .setCustomId("Pixelate_XY")
141
+ .setLabel("X, Y Positions")
142
+ .setPlaceholder("Enter X, Y positions (e.g => (100, 150) )")
143
+ .setRequired(true)
144
+ .setStyle(TextInputStyle.Short);
145
+ const whInput = new TextInputBuilder()
146
+ .setCustomId("Pixelate_WH")
147
+ .setLabel("Width, Height")
148
+ .setPlaceholder("Enter width, height (e.g => (50, 50) )")
149
+ .setRequired(true)
150
+ .setStyle(TextInputStyle.Short);
151
+ const sizeInput = new TextInputBuilder()
152
+ .setCustomId("Pixelate_Size")
153
+ .setLabel("Pixelate Size")
154
+ .setPlaceholder("Enter pixelate size")
155
+ .setRequired(true)
156
+ .setStyle(TextInputStyle.Short);
157
+ const st = new ActionRowBuilder().addComponents(imagePos);
158
+ const nd = new ActionRowBuilder().addComponents(xyInput);
159
+ const rd = new ActionRowBuilder().addComponents(whInput);
160
+ const th = new ActionRowBuilder().addComponents(sizeInput);
161
+ modal.addComponents(st, nd, rd, th);
162
+ await a.showModal(modal);
163
+ }
164
+ else if (selectedOptionId === "process_7") {
165
+ const modal = new ModalBuilder()
166
+ .setCustomId("Image_Blur")
167
+ .setTitle("Blurring An Image");
168
+ const imagePos = new TextInputBuilder()
169
+ .setCustomId("Image_Postion")
170
+ .setLabel("Image Number")
171
+ .setMaxLength(1)
172
+ .setMinLength(1)
173
+ .setPlaceholder("Modal you want to blur (e.g => 1st image/2nd image/3rd image/4th image)")
174
+ .setRequired(true)
175
+ .setStyle(TextInputStyle.Short);
176
+ const blurDegree = new TextInputBuilder()
177
+ .setCustomId("blur_radius")
178
+ .setLabel("Blurring Radius")
179
+ .setMaxLength(5)
180
+ .setPlaceholder("Blur value (e.g => (value = 1-100 as max) )")
181
+ .setRequired(true)
182
+ .setStyle(TextInputStyle.Short);
183
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
184
+ const secondActionRow = new ActionRowBuilder().addComponents(blurDegree);
185
+ modal.addComponents(firstActionRow, secondActionRow);
186
+ await a.showModal(modal);
187
+ }
188
+ else if (selectedOptionId === "process_8") {
189
+ const modal = new ModalBuilder()
190
+ .setCustomId("Image_Fade")
191
+ .setTitle("Fading An Image");
192
+ const imagePos = new TextInputBuilder()
193
+ .setCustomId("Image_Postion")
194
+ .setLabel("Image Number")
195
+ .setMaxLength(1)
196
+ .setMinLength(1)
197
+ .setPlaceholder("Modal you want to fade (e.g => 1st image/2nd image/3rd image/4th image)")
198
+ .setRequired(true)
199
+ .setStyle(TextInputStyle.Short);
200
+ const fadeDegree = new TextInputBuilder()
201
+ .setCustomId("fade_factor")
202
+ .setLabel("Fade By Factor")
203
+ .setMaxLength(5)
204
+ .setPlaceholder("Fade value (e.g => (value = 0-1 as max) )")
205
+ .setRequired(true)
206
+ .setStyle(TextInputStyle.Short);
207
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
208
+ const secondActionRow = new ActionRowBuilder().addComponents(fadeDegree);
209
+ modal.addComponents(firstActionRow, secondActionRow);
210
+ await a.showModal(modal);
211
+ }
212
+ else if (selectedOptionId === "process_9") {
213
+ const modal = new ModalBuilder()
214
+ .setCustomId("Image_Opaque")
215
+ .setTitle("Opaque An Image");
216
+ const imagePos = new TextInputBuilder()
217
+ .setCustomId("Image_Postion")
218
+ .setLabel("Image Number")
219
+ .setMaxLength(1)
220
+ .setMinLength(1)
221
+ .setPlaceholder("Modal you want to opaque (e.g => 1st image/2nd image/3rd image/4th image)")
222
+ .setRequired(true)
223
+ .setStyle(TextInputStyle.Short);
224
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
225
+ modal.addComponents(firstActionRow);
226
+ await a.showModal(modal);
227
+ }
228
+ else if (selectedOptionId === "process_10") {
229
+ const modal = new ModalBuilder()
230
+ .setCustomId("Image_GrayScale")
231
+ .setTitle("GrayScale An Image");
232
+ const imagePos = new TextInputBuilder()
233
+ .setCustomId("Image_Postion")
234
+ .setLabel("Image Number")
235
+ .setMaxLength(1)
236
+ .setMinLength(1)
237
+ .setPlaceholder("Modal you want to apply grayscale on (e.g => 1st image/2nd image/3rd image/4th image)")
238
+ .setRequired(true)
239
+ .setStyle(TextInputStyle.Short);
240
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
241
+ modal.addComponents(firstActionRow);
242
+ await a.showModal(modal);
243
+ }
244
+ else if (selectedOptionId === "process_11") {
245
+ const modal = new ModalBuilder()
246
+ .setCustomId("Image_Contrast")
247
+ .setTitle("Contrast An Image");
248
+ const imagePos = new TextInputBuilder()
249
+ .setCustomId("Image_Postion")
250
+ .setLabel("Image Number")
251
+ .setMaxLength(1)
252
+ .setMinLength(1)
253
+ .setPlaceholder("Modal you want to apply contrast on (e.g => 1st image/2nd image/3rd image/4th image)")
254
+ .setRequired(true)
255
+ .setStyle(TextInputStyle.Short);
256
+ const contrastValue = new TextInputBuilder()
257
+ .setCustomId("Contrast_Value")
258
+ .setLabel("Contrast Value")
259
+ .setMaxLength(4)
260
+ .setPlaceholder("Contrast value (e.g => (value = 0-2 as max) )")
261
+ .setRequired(true)
262
+ .setStyle(TextInputStyle.Short);
263
+ const firstActionRow = new ActionRowBuilder().addComponents(imagePos);
264
+ const secondActionRow = new ActionRowBuilder().addComponents(contrastValue);
265
+ modal.addComponents(firstActionRow, secondActionRow);
266
+ await a.showModal(modal);
267
+ }
266
268
  }
267
269
  }
270
+ catch (error) { }
268
271
  });
269
272
  }
270
273
  exports.imageTools = imageTools;