Skip to content

Commit c8cf002

Browse files
committed
Add a bunch of commands
1 parent acc0010 commit c8cf002

24 files changed

+393
-0
lines changed

src/commands/gen/multiuser/ship.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { CommandOptionType, SlashCreator, CommandContext, User } from 'slash-create';
2+
import { GenerationCommand } from '../../../imgsrv/abstracts';
3+
import { HeartPayload } from '../../../imgsrv/payload';
4+
5+
export default class Ship extends GenerationCommand {
6+
endpoint = 'ship';
7+
constructor(creator: SlashCreator) {
8+
super(creator, {
9+
name: 'ship',
10+
description: 'Awww...',
11+
options: [
12+
{
13+
name: 'first_user',
14+
type: CommandOptionType.USER,
15+
description: 'The first user for the image.',
16+
required: true
17+
},
18+
{
19+
name: 'second_user',
20+
type: CommandOptionType.USER,
21+
description: 'The second user for this image.'
22+
},
23+
{
24+
name: 'heart',
25+
type: CommandOptionType.STRING,
26+
description: 'The heart (or emoji) in between the users.',
27+
choices: [
28+
// TODO: Use emojis in names when discord fixes issue #2537
29+
{ name: 'Red', value: 'red' }, // ❤
30+
{ name: 'Orange', value: 'orange' }, // 🧡
31+
{ name: 'Yellow', value: 'yellow' }, // 💛
32+
{ name: 'Green', value: 'green' }, // 💚
33+
{ name: 'Blue', value: 'blue' }, // 💙
34+
{ name: 'Purple', value: 'purple' }, // 💜
35+
{ name: 'White', value: 'white' }, // 🤍
36+
{ name: 'Brown', value: 'brown' }, // 🤎
37+
{ name: 'Black', value: 'black' }, // 🖤
38+
{ name: 'Broken Heart', value: 'broken' }, // 💔
39+
{ name: 'Heart With Arrow (Cupid)', value: 'arrow' }, // 💘
40+
{ name: 'Beating Heart', value: 'beating' }, // 💓
41+
{ name: 'Growing Heart', value: 'growing' }, // 💗
42+
{ name: 'Ribboned', value: 'ribbon' }, // 💝
43+
{ name: 'Revolving Hearts', value: 'revolving' }, // 💞
44+
{ name: 'Two Hearts', value: 'two' }, // 💕
45+
{ name: 'Heart Decoration', value: 'decoration' } // 💟
46+
]
47+
}
48+
]
49+
});
50+
}
51+
52+
async run(ctx: CommandContext) {
53+
const users: User[] = [ctx.users.get(ctx.options.first_user as string)!];
54+
55+
if (ctx.options.second_user) users.push(ctx.users.get(ctx.options.second_user as string)!);
56+
else users.unshift(ctx.user);
57+
58+
const payload: HeartPayload = {
59+
avatar1: users[0].dynamicAvatarURL(),
60+
avatar2: users[1].dynamicAvatarURL(),
61+
heart: (ctx.options.heart as string) || 'red'
62+
};
63+
64+
return this.generate(ctx, payload);
65+
}
66+
}

src/commands/gen/multiuser/tinder.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { DoubleUserCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class Tinder extends DoubleUserCommand {
5+
endpoint = 'tinder';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'tinder', 'Hot date!');
8+
}
9+
}

src/commands/gen/text/abandon.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { TextCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class Abandon extends TextCommand {
5+
endpoint = 'abandon';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'abandon', 'Oh no.');
8+
}
9+
}

src/commands/gen/text/achievement.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { CommandContext, CommandOptionType, SlashCreator } from 'slash-create';
2+
import { GenerationCommand } from '../../../imgsrv/abstracts';
3+
import { AchievementPayload } from '../../../imgsrv/payload';
4+
5+
export default class Achievement extends GenerationCommand {
6+
endpoint = 'achievement';
7+
constructor(creator: SlashCreator) {
8+
super(creator, {
9+
name: 'achievement',
10+
description: 'Achievement get!',
11+
options: [
12+
{
13+
name: 'text',
14+
type: CommandOptionType.STRING,
15+
description: 'The text to use in this command.',
16+
required: true
17+
},
18+
{
19+
name: 'header',
20+
type: CommandOptionType.STRING,
21+
description: 'The text above the achievement title.'
22+
},
23+
{
24+
name: 'challenge',
25+
type: CommandOptionType.BOOLEAN,
26+
description: 'Whether to use the challenge format of the achievement.'
27+
},
28+
{
29+
name: 'icon',
30+
type: CommandOptionType.STRING,
31+
description: 'The icon to use in the achievement.',
32+
choices: [
33+
// Image coords to the icons (x-y)
34+
{ name: 'Crafting Table', value: '13-6' },
35+
{ name: 'Furnace', value: '31-10' },
36+
{ name: 'Chest', value: '4-5' },
37+
{ name: 'Wooden Sign', value: '11-19' },
38+
{ name: 'Ladder', value: '20-14' },
39+
{ name: 'Cake', value: '19-4' },
40+
{ name: 'Bow', value: '17-3' },
41+
{ name: 'Book', value: '13-3' }
42+
]
43+
}
44+
]
45+
});
46+
}
47+
48+
async run(ctx: CommandContext) {
49+
const payload: AchievementPayload = {
50+
text: ctx.options.text as string
51+
};
52+
53+
if (ctx.options.header) payload.header = ctx.options.header as string;
54+
if (ctx.options.challenge) payload.challenge = true;
55+
if (typeof ctx.options.icon == 'string') {
56+
const [x, y] = ctx.options.icon.split('-');
57+
payload.icon_x = parseInt(x);
58+
payload.icon_y = parseInt(y);
59+
}
60+
61+
return this.generate(ctx, payload);
62+
}
63+
}

src/commands/gen/text/animeprotest.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { TextCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class AnimeProtest extends TextCommand {
5+
endpoint = 'animeprotest';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'animeprotest', '3D women are NOT important!');
8+
}
9+
}

src/commands/gen/text/armor.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { TextCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class Armor extends TextCommand {
5+
endpoint = 'armor';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'armor', 'He had no emotional armor.');
8+
}
9+
}

src/commands/gen/text/bonzibuddy.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { TextCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class BonziBuddy extends TextCommand {
5+
endpoint = 'bonzibuddy';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'bonzibuddy', 'Lets surf the internet together!');
8+
}
9+
}

src/commands/gen/text/changemymind.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { TextCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class CMM extends TextCommand {
5+
endpoint = 'changemymind';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'changemymind', 'Convince me.');
8+
}
9+
}

src/commands/gen/text/citation.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { CommandContext, CommandOptionType, SlashCreator } from 'slash-create';
2+
import { GenerationCommand } from '../../../imgsrv/abstracts';
3+
import { CitationPayload } from '../../../imgsrv/payload';
4+
5+
export default class Citation extends GenerationCommand {
6+
endpoint = 'citation';
7+
constructor(creator: SlashCreator) {
8+
super(creator, {
9+
name: 'citation',
10+
description: 'I love a good Papers Please reference.',
11+
options: [
12+
{
13+
name: 'text',
14+
type: CommandOptionType.STRING,
15+
description: 'The text to use in this command.',
16+
required: true
17+
},
18+
{
19+
name: 'header',
20+
type: CommandOptionType.STRING,
21+
description: 'The text above the citation body.'
22+
},
23+
{
24+
name: 'footer',
25+
type: CommandOptionType.STRING,
26+
description: 'The text below the citation body.'
27+
}
28+
]
29+
});
30+
}
31+
32+
async run(ctx: CommandContext) {
33+
const payload: CitationPayload = {
34+
text: ctx.options.text as string
35+
};
36+
37+
if (ctx.options.header) payload.header = ctx.options.header as string;
38+
if (ctx.options.footer) payload.footer = ctx.options.footer as string;
39+
40+
return this.generate(ctx, payload);
41+
}
42+
}

src/commands/gen/text/clippy.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SlashCreator } from 'slash-create';
2+
import { TextCommand } from '../../../imgsrv/abstracts';
3+
4+
export default class Clippy extends TextCommand {
5+
endpoint = 'clippy';
6+
constructor(creator: SlashCreator) {
7+
super(creator, 'clippy', 'Need any help?');
8+
}
9+
}

0 commit comments

Comments
 (0)