Skip to content

Commit 5f08c59

Browse files
committed
Comment register & delete command func
1 parent 91da77c commit 5f08c59

File tree

4 files changed

+55
-84
lines changed

4 files changed

+55
-84
lines changed

Diff for: app/envs.ts

-30
This file was deleted.

Diff for: app/lib/db/drafts.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import createClient from "edgedb";
44
import { client, auth } from "@/app/lib/edgedb";
5-
import e from "@/dbschema/edgeql-js";
5+
import e, { type $infer } from "@/dbschema/edgeql-js";
66
import { getFtsDraftsCount } from "./queries/getFtsDraftsCount.query";
77
import { getFtsDrafts } from "./queries/getFtsDrafts.query";
88

@@ -42,6 +42,7 @@ const getDraftsQuery = e.params(
4242
id: true,
4343
title: true,
4444
question: true,
45+
opa: true,
4546
linkedTags: {
4647
name: true,
4748
disabled: true,

Diff for: app/lib/discord/scripts/deleteCommand.ts

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import dotenv from "dotenv";
2-
import { REST } from "@discordjs/rest";
3-
import { Routes } from "discord-api-types/v10";
1+
// import dotenv from "dotenv";
2+
// import { REST } from "@discordjs/rest";
3+
// import { Routes } from "discord-api-types/v10";
44

5-
dotenv.config();
6-
dotenv.config({ path: ".env.prod" });
5+
// dotenv.config();
6+
// dotenv.config({ path: ".env.prod" });
77

8-
if (!process.env.DISCORD_TOKEN) {
9-
console.error("DISCORD_TOKEN environment variable is not set.");
10-
process.exit(1);
11-
}
8+
// if (!process.env.DISCORD_TOKEN) {
9+
// console.error("DISCORD_TOKEN environment variable is not set.");
10+
// process.exit(1);
11+
// }
1212

13-
if (!process.env.DISCORD_CLIENT_ID) {
14-
console.error("DISCORD_CLIENT_ID environment variable is not set.");
15-
process.exit(1);
16-
}
13+
// if (!process.env.DISCORD_CLIENT_ID) {
14+
// console.error("DISCORD_CLIENT_ID environment variable is not set.");
15+
// process.exit(1);
16+
// }
1717

18-
const rest = new REST().setToken(process.env.DISCORD_TOKEN!);
18+
// const rest = new REST().setToken(process.env.DISCORD_TOKEN!);
1919

20-
// for guild-based commands
20+
// // for guild-based commands
21+
// // rest
22+
// // .delete(
23+
// // Routes.applicationGuildCommand(
24+
// // process.env.DISCORD_CLIENT_ID!,
25+
// // process.env.DISCORD_GUILD_ID!,
26+
// // "1157365753314553900"
27+
// // )
28+
// // )
29+
// // .then(() => console.log("Successfully deleted guild command"))
30+
// // .catch(console.error);
31+
32+
// // for global commands
2133
// rest
22-
// .delete(
23-
// Routes.applicationGuildCommand(
24-
// process.env.DISCORD_CLIENT_ID!,
25-
// process.env.DISCORD_GUILD_ID!,
26-
// "1157365753314553900"
27-
// )
28-
// )
29-
// .then(() => console.log("Successfully deleted guild command"))
34+
// .delete(Routes.applicationCommand(process.env.DISCORD_CLIENT_ID, "commandId"))
35+
// .then(() => console.log("Successfully deleted global command"))
3036
// .catch(console.error);
31-
32-
// for global commands
33-
rest
34-
.delete(Routes.applicationCommand(process.env.DISCORD_CLIENT_ID, "commandId"))
35-
.then(() => console.log("Successfully deleted global command"))
36-
.catch(console.error);

Diff for: app/lib/discord/scripts/registerCommands.ts

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import dotenv from "dotenv";
2-
import { REST } from "@discordjs/rest";
3-
import { loadCommandDefinitions } from "../command";
4-
import { Routes } from "discord-api-types/v10";
1+
// import dotenv from "dotenv";
2+
// import { REST } from "@discordjs/rest";
3+
// import { loadCommandDefinitions } from "../command";
4+
// import { Routes } from "discord-api-types/v10";
55

6-
dotenv.config();
7-
dotenv.config({ path: ".env.prod" });
6+
// dotenv.config();
7+
// dotenv.config({ path: ".env.prod" });
88

9-
(async function () {
10-
if (!process.env.DISCORD_TOKEN) {
11-
console.error("DISCORD_TOKEN environment variable is not set.");
12-
process.exit(1);
13-
}
9+
// (async function () {
10+
// if (!process.env.DISCORD_TOKEN) {
11+
// console.error("DISCORD_TOKEN environment variable is not set.");
12+
// process.exit(1);
13+
// }
1414

15-
var commands = await loadCommandDefinitions();
15+
// var commands = await loadCommandDefinitions();
1616

17-
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
17+
// const rest = new REST().setToken(process.env.DISCORD_TOKEN);
1818

19-
await rest.put(
20-
Routes.applicationGuildCommands(
21-
process.env.DISCORD_CLIENT_ID!,
22-
process.env.DISCORD_GUILD_ID!
23-
),
24-
{
25-
body: commands.map((c) => c.definition),
26-
}
27-
);
19+
// await rest.put(
20+
// Routes.applicationGuildCommands(
21+
// process.env.DISCORD_CLIENT_ID!,
22+
// process.env.DISCORD_GUILD_ID!
23+
// ),
24+
// {
25+
// body: commands.map((c) => c.definition),
26+
// }
27+
// );
2828

29-
console.log("Successfully registered guild commands.");
30-
})();
29+
// console.log("Successfully registered guild commands.");
30+
// })();

0 commit comments

Comments
 (0)