Skip to content

Commit e3d2f8b

Browse files
feat: rm mjx
1 parent 62ce22e commit e3d2f8b

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

src/commands.js

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ export const MO_COMMAND = {
1313
description: '摸鱼办',
1414
};
1515

16-
export const MJX_COMMAND = {
17-
name: 'mjx',
18-
description: '买家秀随机一图',
19-
};
20-
2116
export const AI_TEXT_COMMAND = {
2217
name: 'ai_text',
2318
description: 'AI 文本',

src/register.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SE_COMMAND, MO_COMMAND, MJX_COMMAND } from './commands.js';
1+
import { SE_COMMAND, MO_COMMAND } from './commands.js';
22
import dotenv from 'dotenv';
33
import process from 'node:process';
44

@@ -34,7 +34,7 @@ const response = await fetch(url, {
3434
Authorization: `Bot ${token}`,
3535
},
3636
method: 'PUT',
37-
body: JSON.stringify([SE_COMMAND, MO_COMMAND, MJX_COMMAND]),
37+
body: JSON.stringify([SE_COMMAND, MO_COMMAND]),
3838
});
3939

4040
if (response.ok) {

src/server.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
InteractionType,
99
verifyKey,
1010
} from 'discord-interactions';
11-
import { SE_COMMAND, MO_COMMAND, MJX_COMMAND, AI_TEXT_COMMAND } from './commands.js';
11+
import { SE_COMMAND, MO_COMMAND, AI_TEXT_COMMAND } from './commands.js';
1212
import { Ai } from '@cloudflare/ai'
1313

1414
class JsonResponse extends Response {
@@ -83,22 +83,6 @@ router.post('/', async (request, env) => {
8383
},
8484
});
8585
}
86-
case MJX_COMMAND.name.toLowerCase(): {
87-
const response = await fetch(env.UOMG_URL, {
88-
method: 'GET',
89-
headers: {
90-
"Content-Type": "application/json",
91-
}
92-
});
93-
const data = await response.json();
94-
console.log('MJX_COMMAND data: ' + data);
95-
return new JsonResponse({
96-
type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE,
97-
data: {
98-
content: data["imgurl"],
99-
},
100-
});
101-
}
10286
case AI_TEXT_COMMAND.name.toLowerCase(): {
10387
if (!interaction.data.content) {
10488
return new JsonResponse({

0 commit comments

Comments
 (0)