Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/register-commands.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
import { readFileSync } from "fs";

try {
const lines = readFileSync(".dev.vars", "utf-8").split("\n");
for (const line of lines) {
const match = line.match(/^([^=]+)=(.+)$/);
if (match && !process.env[match[1]]) {
process.env[match[1]] = match[2].replace(/^"|"$/g, "");
}
}
} catch {}

const APPLICATION_ID = process.env.DISCORD_APPLICATION_ID!;
const BOT_TOKEN = process.env.DISCORD_BOT_TOKEN!;
const GUILD_ID = process.env.DISCORD_GUILD_ID!;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function handleChannelJoin(env: Env): Promise<void> {
await replyToMessage(
threadId,
msg.id,
"⚠️ 메시지 형식이 올바르지 않습니다. 포스트 **제목(title)** 에 아래 형식으로 작성해주세요.\n```\n리트코드 스터디 7기 신청 (github_username, team)\n```",
"⚠️ 메시지 형식이 올바르지 않습니다. 포스트 **제목(title)** 에 아래 형식으로 작성해주세요.\n```\n리트코드 스터디 8기 신청 (github_username, team)\n```",
env.DISCORD_BOT_TOKEN,
);
await addReaction(threadId, msg.id, "❌", env.DISCORD_BOT_TOKEN);
Expand Down
2 changes: 1 addition & 1 deletion wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"compatibility_flags": ["nodejs_compat"],
"vars": {
"GITHUB_ORG": "DaleStudy",
"ROLE_TEAM_CONFIG": "[{\"value\":\"leetcode07\",\"label\":\"leetcode07\",\"discordRoleId\":\"1233209102495383572\",\"teamSlug\":\"leetcode07\"}]",
"ROLE_TEAM_CONFIG": "[{\"value\":\"leetcode07\",\"label\":\"leetcode07\",\"discordRoleId\":\"1233209102495383572\",\"teamSlug\":\"leetcode07\"},{\"value\":\"leetcode08\",\"label\":\"leetcode08\",\"discordRoleId\":\"1513390176200818769\",\"teamSlug\":\"leetcode08\"}]",
},
"kv_namespaces": [],
"durable_objects": {
Expand Down
Loading