Skip to content

Commit 2047942

Browse files
authored
Port b1 command from python bot (#15)
* Port b1 command from python bot * use cdn url
1 parent 32d3622 commit 2047942

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

src/api/endpoints.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const Api = Object.freeze({
173173

174174
IMAGE_TOOLS_BACKGROUND_REMOVE:
175175
'/image/tools/background/remove',
176-
IMAGE_TOOLS_OBJECT_REMOVE:
176+
IMAGE_TOOLS_OBJECT_REMOVE:
177177
'/image/tools/object/remove',
178178
IMAGE_TOOLS_CONVERT:
179179
'/image/tools/convert',
@@ -305,6 +305,9 @@ export const Api = Object.freeze({
305305
export const CDN = Tools.URIEncodeWrap({
306306
URL: Domains.CDN,
307307

308+
COMMAND_ASSETS_B1:
309+
'/command-assets/b1.png',
310+
308311
EMOJIS_APPLE: (codepoint: string) =>
309312
`/emojis/apple/128x128/${codepoint}.png`,
310313
EMOJIS_TWEMOJI: (codepoint: string) =>

src/commands/prefixed/fun/b1.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Command, CommandClient } from 'detritus-client';
2+
3+
import { CDN } from '../../../api/endpoints';
4+
import { CommandCategories } from '../../../constants';
5+
import { editOrReply } from '../../../utils';
6+
7+
import { BaseCommand } from '../basecommand';
8+
9+
10+
export const COMMAND_NAME = 'b1';
11+
12+
export default class B1Command extends BaseCommand {
13+
constructor(client: CommandClient) {
14+
super(client, {
15+
name: COMMAND_NAME,
16+
17+
metadata: {
18+
description: 'cool',
19+
examples: [
20+
COMMAND_NAME,
21+
],
22+
category: CommandCategories.FUN,
23+
usage: '',
24+
},
25+
});
26+
}
27+
28+
async run(context: Command.Context) {
29+
return editOrReply(
30+
context,
31+
CDN.COMMAND_ASSETS_B1,
32+
);
33+
}
34+
}

0 commit comments

Comments
 (0)