Skip to content

Commit

Permalink
Rename Duplicate to Redirected (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
zegevlier committed May 30, 2024
1 parent 28325cb commit 3845b7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a Discord bot built on Cloudflare Workers with the purpose of managing Q

## How it works

The bot is triggered by a slash command `/questions` which takes a required `open` argument. The bot will then post a message in the questions channel, inviting users to submit questions via a button. When people submit a question, it gets posted to a separate questions channel via webhook, and the status of the question is clearly indicated (Answered, Unanswered, Duplicate, etc).
The bot is triggered by a slash command `/questions` which takes a required `open` argument. The bot will then post a message in the questions channel, inviting users to submit questions via a button. When people submit a question, it gets posted to a separate questions channel via webhook, and the status of the question is clearly indicated (Answered, Unanswered, Redirected, etc).

The status of these questions can be managed through Context Menus (right click on a question) and the bot will update the status of the question in the questions channel. For this case, anybody with Manage Messages permission can update the status of a question.

Expand Down
4 changes: 2 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RouteBases,
Routes,
} from "discord-api-types/v10";
import { Unanswered, Answered, NeedsMoreInfo, Duplicate, FollowUp } from "./question-state";
import { Unanswered, Answered, NeedsMoreInfo, Redirected, FollowUp } from "./question-state";
import type { APIApplicationCommand } from "discord-api-types/v10";

type ApplicationCommandCreate = Omit<APIApplicationCommand, "id" | "application_id" | "version">;
Expand Down Expand Up @@ -47,7 +47,7 @@ const commands: ApplicationCommandCreate[] = [
default_member_permissions: ManageMessages,
},
{
name: Duplicate.CmdName,
name: Redirected.CmdName,
description: "", // message commands don't have descriptions
type: ApplicationCommandType.Message,
default_member_permissions: ManageMessages,
Expand Down
8 changes: 4 additions & 4 deletions src/question-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export const NeedsMoreInfo: QuestionState = {
Color: 0xefad67,
};

export const Duplicate: QuestionState = {
Title: "**🔁 Duplicate Question**",
CmdName: "Mark Duplicate",
export const Redirected: QuestionState = {
Title: "**↪️ Question Redirected**",
CmdName: "Mark Redirected",
Color: 0xef6767,
};

Expand All @@ -40,7 +40,7 @@ export function GetQuestionStateFromCommandName(commandName: string): QuestionSt
"Mark Answered": Answered,
"Mark Unanswered": Unanswered,
"Mark Needs More Info": NeedsMoreInfo,
"Mark Duplicate": Duplicate,
"Mark Redirected": Redirected,
"Mark as Will Follow Up": FollowUp,
}[commandName] || Unanswered
);
Expand Down

0 comments on commit 3845b7f

Please sign in to comment.