Skip to content

Commit b54d9c3

Browse files
remove feature flag (#275)
1 parent 15aa15e commit b54d9c3

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

src/constants/commands.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ export const MENTION_EACH = {
4444
type: 3,
4545
require: false,
4646
},
47-
{
48-
name: "dev",
49-
description: "want to tag them individually?",
50-
type: 5,
51-
require: false,
52-
},
5347
],
5448
};
5549

src/controllers/mentionEachUser.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { env } from "../typeDefinitions/default.types";
66
import {
77
UserArray,
88
MentionEachUserOptions,
9-
DevFlag,
109
} from "../typeDefinitions/filterUsersByRole";
1110
import { mentionEachUserInMessage } from "../utils/guildRole";
1211
import { checkDisplayType } from "../utils/checkDisplayType";
@@ -16,27 +15,27 @@ export async function mentionEachUser(
1615
roleToBeTaggedObj: MentionEachUserOptions;
1716
displayMessageObj?: MentionEachUserOptions;
1817
channelId: number;
19-
dev?: DevFlag;
2018
},
2119
env: env,
2220
ctx: ExecutionContext
2321
) {
2422
const getMembersInServerResponse = await getMembersInServer(env);
2523
const roleId = transformedArgument.roleToBeTaggedObj.value;
2624
const msgToBeSent = transformedArgument?.displayMessageObj?.value;
27-
const dev = transformedArgument?.dev?.value || false;
28-
// optional chaining here only because display message obj is optional argument
25+
2926
const usersWithMatchingRole = filterUserByRoles(
3027
getMembersInServerResponse as UserArray[],
3128
roleId
3229
);
30+
3331
const payload = {
3432
channelId: transformedArgument.channelId,
3533
roleId: roleId,
3634
message: msgToBeSent,
3735
usersWithMatchingRole,
3836
};
39-
if (!dev || usersWithMatchingRole.length === 0) {
37+
38+
if (usersWithMatchingRole.length === 0) {
4039
const responseData = checkDisplayType({
4140
usersWithMatchingRole,
4241
msgToBeSent,

src/typeDefinitions/filterUsersByRole.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ export type MentionEachUserOptions = {
1010
type: number;
1111
value: string;
1212
};
13-
export type DevFlag = {
14-
name: string;
15-
type: number;
16-
value: boolean;
17-
};

tests/unit/handlers/mentionEachUser.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("Test mention each function", () => {
1919
expect(response).toBeInstanceOf(Promise);
2020
});
2121

22-
it("should run without displayMessageObj argument in dev mode", async () => {
22+
it("should run without displayMessageObj argument", async () => {
2323
const env = {
2424
BOT_PUBLIC_KEY: "xyz",
2525
DISCORD_GUILD_ID: "123",
@@ -28,11 +28,6 @@ describe("Test mention each function", () => {
2828
const response = mentionEachUser(
2929
{
3030
...onlyRoleToBeTagged,
31-
dev: {
32-
name: "dev",
33-
type: 4,
34-
value: true,
35-
},
3631
},
3732
env,
3833
ctx

0 commit comments

Comments
 (0)