Skip to content

Commit a86c393

Browse files
committed
Add globe command
1 parent b391998 commit a86c393

File tree

15 files changed

+90
-8
lines changed

15 files changed

+90
-8
lines changed

src/api/endpoints.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export const Api = Object.freeze({
9393
'/image/manipulation/flop',
9494
IMAGE_MANIPULATION_GLITCH:
9595
'/image/manipulation/glitch',
96+
IMAGE_MANIPULATION_GLOBE:
97+
'/image/manipulation/globe',
9698
IMAGE_MANIPULATION_GOLD:
9799
'/image/manipulation/gold',
98100
IMAGE_MANIPULATION_GRAYSCALE:

src/api/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,14 @@ export async function imageManipulationGlitch(
512512
}
513513

514514

515+
export async function imageManipulationGlobe(
516+
context: RequestContext,
517+
options: RestOptions.ImageBaseOptions,
518+
) {
519+
return raw.imageManipulationGlobe(context, options);
520+
}
521+
522+
515523
export async function imageManipulationGold(
516524
context: RequestContext,
517525
options: RestOptions.ImageBaseOptions,

src/api/raw.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,24 @@ export async function imageManipulationGlitch(
978978
}
979979

980980

981+
export async function imageManipulationGlobe(
982+
context: RequestContext,
983+
options: RestOptions.ImageBaseOptions,
984+
): Promise<Response> {
985+
const query = {
986+
url: options.url,
987+
};
988+
return request(context, {
989+
dataOnly: false,
990+
query,
991+
route: {
992+
method: HTTPMethods.POST,
993+
path: Api.IMAGE_MANIPULATION_GLOBE,
994+
},
995+
});
996+
}
997+
998+
981999
export async function imageManipulationGold(
9821000
context: RequestContext,
9831001
options: RestOptions.ImageBaseOptions,
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 = 'globe';
10+
11+
export default class GlobeCommand extends BaseImageCommand {
12+
constructor(client: CommandClient) {
13+
super(client, {
14+
name: COMMAND_NAME,
15+
16+
metadata: {
17+
category: CommandCategories.IMAGE,
18+
description: 'Create a globe out of an Image',
19+
examples: [
20+
COMMAND_NAME,
21+
`${COMMAND_NAME} notsobot`,
22+
],
23+
id: Formatter.Commands.ImageManipulationGlobe.COMMAND_ID,
24+
usage: '?<emoji,user:id|mention|name,url>',
25+
},
26+
});
27+
}
28+
29+
async run(context: Command.Context, args: Formatter.Commands.ImageManipulationGlobe.CommandArgs) {
30+
return Formatter.Commands.ImageManipulationGlobe.createMessage(context, args);
31+
}
32+
}

src/commands/prefixed/image/retro.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default class RetroCommand extends BaseCommand {
1919
label: 'text',
2020
metadata: {
2121
category: CommandCategories.IMAGE,
22+
description: 'Create a Retro Image overlayed with text',
2223
examples: [
2324
COMMAND_NAME,
2425
`${COMMAND_NAME} notsobot`,

src/commands/prefixed/owner/upload-commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class UploadCommandsCommand extends BaseCommand {
2121
COMMAND_NAME,
2222
],
2323
category: CommandCategories.OWNER,
24-
usage: `${COMMAND_NAME}`,
24+
usage: '',
2525
},
2626
});
2727
}

src/commands/prefixed/settings/prefixes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class PrefixesCommand extends BaseCommand {
2323
COMMAND_NAME,
2424
],
2525
id: Formatter.Commands.PrefixesList.COMMAND_ID,
26-
usage: `${COMMAND_NAME}`,
26+
usage: '',
2727
},
2828
permissionsClient: [Permissions.EMBED_LINKS],
2929
priority: -1,

src/commands/prefixed/utils/help.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class HelpCommand extends BaseCommand {
3333
`${COMMAND_NAME} loggers`,
3434
],
3535
category: CommandCategories.UTILS,
36-
usage: '?<command:name>',
36+
usage: '',
3737
},
3838
permissionsClient: [Permissions.EMBED_LINKS],
3939
type: (content: string, context: Command.Context) => {

src/commands/prefixed/utils/invite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class InviteCommand extends BaseCommand {
1616
metadata: {
1717
description: 'Invite to Guild Link',
1818
category: CommandCategories.UTILS,
19-
usage: `${COMMAND_NAME}`,
19+
usage: '',
2020
},
2121
});
2222
}

src/commands/prefixed/utils/memoryusage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class MemoryUsageCommand extends BaseCommand {
2323
COMMAND_NAME,
2424
],
2525
category: CommandCategories.UTILS,
26-
usage: `${COMMAND_NAME}`,
26+
usage: '',
2727
},
2828
permissionsClient: [Permissions.EMBED_LINKS],
2929
});

0 commit comments

Comments
 (0)