Skip to content

Commit dc7c778

Browse files
committed
Fix some typings
1 parent b30a01e commit dc7c778

File tree

259 files changed

+17643
-17632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+17643
-17632
lines changed
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import { Interaction } from 'detritus-client';
2-
import { MessageFlags } from 'detritus-client/lib/constants';
3-
4-
import { Formatter, findImageUrlInMessage } from '../../../../utils';
5-
6-
import { BaseContextMenuMessageCommand, ContextMenuMessageArgs } from '../../basecommand';
7-
8-
9-
export interface OCRCommandArgs extends ContextMenuMessageArgs {
10-
url?: string | null,
11-
}
12-
13-
export const COMMAND_NAME = 'OCR';
14-
15-
export default class OCRCommand extends BaseContextMenuMessageCommand {
16-
name = COMMAND_NAME;
17-
18-
onBeforeRun(context: Interaction.InteractionContext, args: OCRCommandArgs) {
19-
args.url = findImageUrlInMessage(args.message);
20-
return !!args.url;
21-
}
22-
23-
onCancelRun(context: Interaction.InteractionContext, args: OCRCommandArgs) {
24-
return context.editOrRespond({
25-
content: 'Message must have some sort of image to read!',
26-
flags: MessageFlags.EPHEMERAL,
27-
});
28-
}
29-
30-
async run(context: Interaction.InteractionContext, args: OCRCommandArgs) {
31-
return Formatter.Commands.ToolsOCR.createMessage(context, {
32-
isEphemeral: true,
33-
url: args.url || '',
34-
});
35-
}
36-
}
1+
import { Interaction } from 'detritus-client';
2+
import { MessageFlags } from 'detritus-client/lib/constants';
3+
4+
import { Formatter, findImageUrlInMessage } from '../../../../utils';
5+
6+
import { BaseContextMenuMessageCommand, ContextMenuMessageArgs } from '../../basecommand';
7+
8+
9+
export interface OCRCommandArgs extends ContextMenuMessageArgs {
10+
url?: string | null,
11+
}
12+
13+
export const COMMAND_NAME = 'OCR';
14+
15+
export default class OCRCommand extends BaseContextMenuMessageCommand {
16+
name = COMMAND_NAME;
17+
18+
onBeforeRun(context: Interaction.InteractionContext, args: OCRCommandArgs) {
19+
args.url = findImageUrlInMessage(args.message);
20+
return !!args.url;
21+
}
22+
23+
onCancelRun(context: Interaction.InteractionContext, args: OCRCommandArgs) {
24+
return context.editOrRespond({
25+
content: 'Message must have some sort of image to read!',
26+
flags: MessageFlags.EPHEMERAL,
27+
});
28+
}
29+
30+
async run(context: Interaction.InteractionContext, args: OCRCommandArgs) {
31+
return Formatter.Commands.ToolsOCR.createMessage(context, {
32+
isEphemeral: true,
33+
url: args.url || '',
34+
});
35+
}
36+
}
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import { Interaction } from 'detritus-client';
2-
import { MessageFlags } from 'detritus-client/lib/constants';
3-
4-
import { Formatter, findImageUrlInMessage } from '../../../../utils';
5-
6-
import { BaseContextMenuMessageCommand, ContextMenuMessageArgs } from '../../basecommand';
7-
8-
9-
export interface QRScanCommandArgs extends ContextMenuMessageArgs {
10-
url?: string | null,
11-
}
12-
13-
export const COMMAND_NAME = 'QR Scan';
14-
15-
export default class QRScanCommand extends BaseContextMenuMessageCommand {
16-
name = COMMAND_NAME;
17-
18-
onBeforeRun(context: Interaction.InteractionContext, args: QRScanCommandArgs) {
19-
args.url = findImageUrlInMessage(args.message);
20-
return !!args.url;
21-
}
22-
23-
onCancelRun(context: Interaction.InteractionContext, args: QRScanCommandArgs) {
24-
return context.editOrRespond({
25-
content: 'Message must have some sort of image to scan!',
26-
flags: MessageFlags.EPHEMERAL,
27-
});
28-
}
29-
30-
async run(context: Interaction.InteractionContext, args: QRScanCommandArgs) {
31-
return Formatter.Commands.ToolsQrScan.createMessage(context, {
32-
isEphemeral: true,
33-
url: args.url || '',
34-
});
35-
}
36-
}
1+
import { Interaction } from 'detritus-client';
2+
import { MessageFlags } from 'detritus-client/lib/constants';
3+
4+
import { Formatter, findImageUrlInMessage } from '../../../../utils';
5+
6+
import { BaseContextMenuMessageCommand, ContextMenuMessageArgs } from '../../basecommand';
7+
8+
9+
export interface QRScanCommandArgs extends ContextMenuMessageArgs {
10+
url?: string | null,
11+
}
12+
13+
export const COMMAND_NAME = 'QR Scan';
14+
15+
export default class QRScanCommand extends BaseContextMenuMessageCommand {
16+
name = COMMAND_NAME;
17+
18+
onBeforeRun(context: Interaction.InteractionContext, args: QRScanCommandArgs) {
19+
args.url = findImageUrlInMessage(args.message);
20+
return !!args.url;
21+
}
22+
23+
onCancelRun(context: Interaction.InteractionContext, args: QRScanCommandArgs) {
24+
return context.editOrRespond({
25+
content: 'Message must have some sort of image to scan!',
26+
flags: MessageFlags.EPHEMERAL,
27+
});
28+
}
29+
30+
async run(context: Interaction.InteractionContext, args: QRScanCommandArgs) {
31+
return Formatter.Commands.ToolsQrScan.createMessage(context, {
32+
isEphemeral: true,
33+
url: args.url || '',
34+
});
35+
}
36+
}
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
import { Interaction } from 'detritus-client';
2-
import { MessageFlags } from 'detritus-client/lib/constants';
3-
4-
import { DefaultParameters, Formatter, findImageUrlInMessage } from '../../../../utils';
5-
6-
import { BaseContextMenuMessageCommand, ContextMenuMessageArgs } from '../../basecommand';
7-
8-
9-
export interface TranslateCommandArgs extends ContextMenuMessageArgs {
10-
text: string,
11-
url?: string | null,
12-
}
13-
14-
export const COMMAND_NAME = 'Translate';
15-
16-
export default class TranslateCommand extends BaseContextMenuMessageCommand {
17-
name = COMMAND_NAME;
18-
19-
onBeforeRun(context: Interaction.InteractionContext, args: TranslateCommandArgs) {
20-
args.text = args.message.content;
21-
args.url = findImageUrlInMessage(args.message);
22-
return !!(args.text || args.url);
23-
}
24-
25-
onCancelRun(context: Interaction.InteractionContext, args: TranslateCommandArgs) {
26-
return context.editOrRespond({
27-
content: 'Message must have some sort of text or image to translate!',
28-
flags: MessageFlags.EPHEMERAL,
29-
});
30-
}
31-
32-
async run(context: Interaction.InteractionContext, args: TranslateCommandArgs) {
33-
const to = await DefaultParameters.locale(context);
34-
if (args.url) {
35-
return Formatter.Commands.ToolsOCRTranslate.createMessage(context, {
36-
isEphemeral: true,
37-
to,
38-
url: args.url,
39-
});
40-
}
41-
return Formatter.Commands.ToolsTranslate.createMessage(context, {
42-
isEphemeral: true,
43-
text: args.text,
44-
to,
45-
});
46-
}
47-
}
1+
import { Interaction } from 'detritus-client';
2+
import { MessageFlags } from 'detritus-client/lib/constants';
3+
4+
import { DefaultParameters, Formatter, findImageUrlInMessage } from '../../../../utils';
5+
6+
import { BaseContextMenuMessageCommand, ContextMenuMessageArgs } from '../../basecommand';
7+
8+
9+
export interface TranslateCommandArgs extends ContextMenuMessageArgs {
10+
text: string,
11+
url?: string | null,
12+
}
13+
14+
export const COMMAND_NAME = 'Translate';
15+
16+
export default class TranslateCommand extends BaseContextMenuMessageCommand {
17+
name = COMMAND_NAME;
18+
19+
onBeforeRun(context: Interaction.InteractionContext, args: TranslateCommandArgs) {
20+
args.text = args.message.content;
21+
args.url = findImageUrlInMessage(args.message);
22+
return !!(args.text || args.url);
23+
}
24+
25+
onCancelRun(context: Interaction.InteractionContext, args: TranslateCommandArgs) {
26+
return context.editOrRespond({
27+
content: 'Message must have some sort of text or image to translate!',
28+
flags: MessageFlags.EPHEMERAL,
29+
});
30+
}
31+
32+
async run(context: Interaction.InteractionContext, args: TranslateCommandArgs) {
33+
const to = await DefaultParameters.locale(context);
34+
if (args.url) {
35+
return Formatter.Commands.ToolsOCRTranslate.createMessage(context, {
36+
isEphemeral: true,
37+
to,
38+
url: args.url,
39+
});
40+
}
41+
return Formatter.Commands.ToolsTranslate.createMessage(context, {
42+
isEphemeral: true,
43+
text: args.text,
44+
to,
45+
});
46+
}
47+
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { Interaction } from 'detritus-client';
2-
import { Permissions } from 'detritus-client/lib/constants';
3-
4-
import { Formatter } from '../../../../utils';
5-
6-
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7-
8-
9-
export const COMMAND_NAME = 'Allowlist Add';
10-
11-
export default class AllowlistAddCommand extends BaseContextMenuUserCommand {
12-
disableDm = true;
13-
name = COMMAND_NAME;
14-
permissions = [Permissions.ADMINISTRATOR];
15-
16-
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17-
return context.editOrRespond({content: 'wip', flags: 64});
18-
}
19-
}
1+
import { Interaction } from 'detritus-client';
2+
import { Permissions } from 'detritus-client/lib/constants';
3+
4+
import { Formatter } from '../../../../utils';
5+
6+
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7+
8+
9+
export const COMMAND_NAME = 'Allowlist Add';
10+
11+
export default class AllowlistAddCommand extends BaseContextMenuUserCommand {
12+
disableDm = true;
13+
name = COMMAND_NAME;
14+
permissions = [Permissions.ADMINISTRATOR];
15+
16+
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17+
return context.editOrRespond({content: 'wip', flags: 64});
18+
}
19+
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { Interaction } from 'detritus-client';
2-
import { Permissions } from 'detritus-client/lib/constants';
3-
4-
import { Formatter } from '../../../../utils';
5-
6-
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7-
8-
9-
export const COMMAND_NAME = 'Allowlist Remove';
10-
11-
export default class AllowlistRemoveCommand extends BaseContextMenuUserCommand {
12-
disableDm = true;
13-
name = COMMAND_NAME;
14-
permissions = [Permissions.ADMINISTRATOR];
15-
16-
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17-
return context.editOrRespond({content: 'wip', flags: 64});
18-
}
19-
}
1+
import { Interaction } from 'detritus-client';
2+
import { Permissions } from 'detritus-client/lib/constants';
3+
4+
import { Formatter } from '../../../../utils';
5+
6+
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7+
8+
9+
export const COMMAND_NAME = 'Allowlist Remove';
10+
11+
export default class AllowlistRemoveCommand extends BaseContextMenuUserCommand {
12+
disableDm = true;
13+
name = COMMAND_NAME;
14+
permissions = [Permissions.ADMINISTRATOR];
15+
16+
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17+
return context.editOrRespond({content: 'wip', flags: 64});
18+
}
19+
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { Interaction } from 'detritus-client';
2-
import { Permissions } from 'detritus-client/lib/constants';
3-
4-
import { Formatter } from '../../../../utils';
5-
6-
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7-
8-
9-
export const COMMAND_NAME = 'Blocklist Add';
10-
11-
export default class BlocklistAddCommand extends BaseContextMenuUserCommand {
12-
disableDm = true;
13-
name = COMMAND_NAME;
14-
permissions = [Permissions.ADMINISTRATOR];
15-
16-
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17-
return context.editOrRespond({content: 'wip', flags: 64});
18-
}
19-
}
1+
import { Interaction } from 'detritus-client';
2+
import { Permissions } from 'detritus-client/lib/constants';
3+
4+
import { Formatter } from '../../../../utils';
5+
6+
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7+
8+
9+
export const COMMAND_NAME = 'Blocklist Add';
10+
11+
export default class BlocklistAddCommand extends BaseContextMenuUserCommand {
12+
disableDm = true;
13+
name = COMMAND_NAME;
14+
permissions = [Permissions.ADMINISTRATOR];
15+
16+
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17+
return context.editOrRespond({content: 'wip', flags: 64});
18+
}
19+
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { Interaction } from 'detritus-client';
2-
import { Permissions } from 'detritus-client/lib/constants';
3-
4-
import { Formatter } from '../../../../utils';
5-
6-
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7-
8-
9-
export const COMMAND_NAME = 'Blocklist Remove';
10-
11-
export default class BlocklistRemoveCommand extends BaseContextMenuUserCommand {
12-
disableDm = true;
13-
name = COMMAND_NAME;
14-
permissions = [Permissions.ADMINISTRATOR];
15-
16-
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17-
return context.editOrRespond({content: 'wip', flags: 64});
18-
}
19-
}
1+
import { Interaction } from 'detritus-client';
2+
import { Permissions } from 'detritus-client/lib/constants';
3+
4+
import { Formatter } from '../../../../utils';
5+
6+
import { BaseContextMenuUserCommand, ContextMenuUserArgs } from '../../basecommand';
7+
8+
9+
export const COMMAND_NAME = 'Blocklist Remove';
10+
11+
export default class BlocklistRemoveCommand extends BaseContextMenuUserCommand {
12+
disableDm = true;
13+
name = COMMAND_NAME;
14+
permissions = [Permissions.ADMINISTRATOR];
15+
16+
async run(context: Interaction.InteractionContext, args: ContextMenuUserArgs) {
17+
return context.editOrRespond({content: 'wip', flags: 64});
18+
}
19+
}

0 commit comments

Comments
 (0)