Skip to content

Commit 1ce2f03

Browse files
committed
Add .paper and .trace
1 parent b26cfea commit 1ce2f03

File tree

13 files changed

+236
-12
lines changed

13 files changed

+236
-12
lines changed

src/api/endpoints.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ export const Api = Object.freeze({
123123
'/image/manipulation/mirror-right',
124124
IMAGE_MANIPULATION_MIRROR_TOP:
125125
'/image/manipulation/mirror-top',
126+
IMAGE_MANIPULATION_PAPER:
127+
'/image/manipulation/paper',
126128
IMAGE_MANIPULATION_PIXELATE:
127129
'/image/manipulation/pixelate',
128130
IMAGE_MANIPULATION_RAIN:
@@ -133,6 +135,8 @@ export const Api = Object.freeze({
133135
'/image/manipulation/sharpen',
134136
IMAGE_MANIPULATION_SPIN:
135137
'/image/manipulation/spin',
138+
IMAGE_MANIPULATION_TRACE:
139+
'/image/manipulation/trace',
136140
IMAGE_MANIPULATION_WALL:
137141
'/image/manipulation/wall',
138142

src/api/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,14 @@ export async function imageManipulationMirrorTop(
632632
}
633633

634634

635+
export async function imageManipulationPaper(
636+
context: RequestContext,
637+
options: RestOptions.ImageBaseOptions,
638+
) {
639+
return raw.imageManipulationPaper(context, options);
640+
}
641+
642+
635643
export async function imageManipulationPixelate(
636644
context: RequestContext,
637645
options: RestOptions.ImageManipulationPixelate,
@@ -672,6 +680,14 @@ export async function imageManipulationSpin(
672680
}
673681

674682

683+
export async function imageManipulationTrace(
684+
context: RequestContext,
685+
options: RestOptions.ImageBaseOptions,
686+
) {
687+
return raw.imageManipulationTrace(context, options);
688+
}
689+
690+
675691
export async function imageManipulationWall(
676692
context: RequestContext,
677693
options: RestOptions.ImageBaseOptions,

src/api/raw.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,24 @@ export async function imageManipulationMirrorTop(
12621262
}
12631263

12641264

1265+
export async function imageManipulationPaper(
1266+
context: RequestContext,
1267+
options: RestOptions.ImageBaseOptions,
1268+
): Promise<Response> {
1269+
const query = {
1270+
url: options.url,
1271+
};
1272+
return request(context, {
1273+
dataOnly: false,
1274+
query,
1275+
route: {
1276+
method: HTTPMethods.POST,
1277+
path: Api.IMAGE_MANIPULATION_PAPER,
1278+
},
1279+
});
1280+
}
1281+
1282+
12651283
export async function imageManipulationPixelate(
12661284
context: RequestContext,
12671285
options: RestOptions.ImageManipulationPixelate,
@@ -1354,6 +1372,24 @@ export async function imageManipulationSpin(
13541372
}
13551373

13561374

1375+
export async function imageManipulationTrace(
1376+
context: RequestContext,
1377+
options: RestOptions.ImageBaseOptions,
1378+
): Promise<Response> {
1379+
const query = {
1380+
url: options.url,
1381+
};
1382+
return request(context, {
1383+
dataOnly: false,
1384+
query,
1385+
route: {
1386+
method: HTTPMethods.POST,
1387+
path: Api.IMAGE_MANIPULATION_TRACE,
1388+
},
1389+
});
1390+
}
1391+
1392+
13571393
export async function imageManipulationWall(
13581394
context: RequestContext,
13591395
options: RestOptions.ImageBaseOptions,

src/commands/interactions/slash/image/fun/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import { ImageGlitchCommand } from './glitch';
88
import { ImageImplodeCommand } from './implode';
99
import { ImageLegofyCommand } from './legofy';
1010
import { ImageMagikCommand } from './magik';
11+
import { ImagePaperCommand } from './paper';
1112
import { ImagePixelateCommand } from './pixelate';
13+
import { ImageTraceCommand } from './trace';
1214
import { ImageWallCommand } from './wall';
1315

1416

@@ -27,7 +29,9 @@ export class ImageFunGroupCommand extends BaseInteractionCommandOptionGroup {
2729
new ImageImplodeCommand(),
2830
new ImageLegofyCommand(),
2931
new ImageMagikCommand(),
32+
new ImagePaperCommand(),
3033
new ImagePixelateCommand(),
34+
new ImageTraceCommand(),
3135
new ImageWallCommand(),
3236
],
3337
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Interaction } from 'detritus-client';
2+
3+
import { Formatter } from '../../../../../utils';
4+
5+
import { BaseInteractionImageCommandOption } from '../../../basecommand';
6+
7+
8+
export const COMMAND_NAME = 'paper';
9+
10+
export class ImagePaperCommand extends BaseInteractionImageCommandOption {
11+
description = 'Create a Paper out of an Image/Gif';
12+
metadata = {
13+
id: Formatter.Commands.ImageManipulationPaper.COMMAND_ID,
14+
};
15+
name = COMMAND_NAME;
16+
17+
async run(context: Interaction.InteractionContext, args: Formatter.Commands.ImageManipulationPaper.CommandArgs) {
18+
return Formatter.Commands.ImageManipulationPaper.createMessage(context, args);
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Interaction } from 'detritus-client';
2+
3+
import { Formatter } from '../../../../../utils';
4+
5+
import { BaseInteractionImageCommandOption } from '../../../basecommand';
6+
7+
8+
export const COMMAND_NAME = 'trace';
9+
10+
export class ImageTraceCommand extends BaseInteractionImageCommandOption {
11+
description = 'Trace an Image/Gif';
12+
metadata = {
13+
id: Formatter.Commands.ImageManipulationTrace.COMMAND_ID,
14+
};
15+
name = COMMAND_NAME;
16+
17+
async run(context: Interaction.InteractionContext, args: Formatter.Commands.ImageManipulationTrace.CommandArgs) {
18+
return Formatter.Commands.ImageManipulationTrace.createMessage(context, args);
19+
}
20+
}

src/commands/interactions/slash/image/spin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { BaseInteractionImageCommandOption } from '../../basecommand';
88
export const COMMAND_NAME = 'spin';
99

1010
export class ImageSpinCommand extends BaseInteractionImageCommandOption {
11-
description = 'Create a Spinning Disk from an Image';
11+
description = 'Create a Spinning Disk from an Image/Gif';
1212
metadata = {
1313
id: Formatter.Commands.ImageSpin.COMMAND_ID,
1414
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Command, CommandClient } from 'detritus-client';
2+
3+
import { CommandCategories } from '../../../constants';
4+
import { Formatter } from '../../../utils';
5+
6+
import { BaseImageCommand } from '../basecommand';
7+
8+
9+
export const COMMAND_NAME = 'paper';
10+
11+
export default class PaperCommand extends BaseImageCommand {
12+
constructor(client: CommandClient) {
13+
super(client, {
14+
name: COMMAND_NAME,
15+
16+
metadata: {
17+
category: CommandCategories.IMAGE,
18+
description: 'Create a paper out of an Image/Gif',
19+
examples: [
20+
COMMAND_NAME,
21+
`${COMMAND_NAME} notsobot`,
22+
],
23+
id: Formatter.Commands.ImageManipulationPaper.COMMAND_ID,
24+
usage: '?<emoji,user:id|mention|name,url>',
25+
},
26+
});
27+
}
28+
29+
async run(context: Command.Context, args: Formatter.Commands.ImageManipulationPaper.CommandArgs) {
30+
return Formatter.Commands.ImageManipulationPaper.createMessage(context, args);
31+
}
32+
}

src/commands/prefixed/image/spin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class SpinCommand extends BaseImageCommand {
1515

1616
metadata: {
1717
category: CommandCategories.IMAGE,
18-
description: 'Create a spinning disk from an image',
18+
description: 'Create a spinning disk from an Image/Gif',
1919
examples: [
2020
COMMAND_NAME,
2121
`${COMMAND_NAME} notsobot`,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Command, CommandClient } from 'detritus-client';
2+
3+
import { CommandCategories } from '../../../constants';
4+
import { Formatter } from '../../../utils';
5+
6+
import { BaseImageCommand } from '../basecommand';
7+
8+
9+
export const COMMAND_NAME = 'trace';
10+
11+
export default class TraceCommand extends BaseImageCommand {
12+
constructor(client: CommandClient) {
13+
super(client, {
14+
name: COMMAND_NAME,
15+
16+
metadata: {
17+
category: CommandCategories.IMAGE,
18+
description: 'Trace an Image/Gif',
19+
examples: [
20+
COMMAND_NAME,
21+
`${COMMAND_NAME} notsobot`,
22+
],
23+
id: Formatter.Commands.ImageManipulationTrace.COMMAND_ID,
24+
usage: '?<emoji,user:id|mention|name,url>',
25+
},
26+
});
27+
}
28+
29+
async run(context: Command.Context, args: Formatter.Commands.ImageManipulationTrace.CommandArgs) {
30+
return Formatter.Commands.ImageManipulationTrace.createMessage(context, args);
31+
}
32+
}

0 commit comments

Comments
 (0)