Skip to content

Commit 1fe9eed

Browse files
committed
Renamed role to customrole
1 parent 1d671e8 commit 1fe9eed

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/Modules/Commands/slash/RoleGroup.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { BaseSlashCommand } from "../";
22

3-
import RoleCreateCommand from "./role/Create";
4-
import RoleInfoCommand from "./role/Inspect";
5-
import RoleRemoveCommand from "./role/Remove";
3+
import CustomRoleCreateCommand from "./customrole/Create";
4+
import CustomRoleInspectCommand from "./customrole/Inspect";
5+
import CustomRoleRemoveCommand from "./customrole/Remove";
66

77
class RoleGroupCommand extends BaseSlashCommand {
88
constructor() {
99
super({
10-
name: "role",
10+
name: "customrole",
1111
description: "Create your own custom role",
12-
options: [new RoleCreateCommand(), new RoleInfoCommand(), new RoleRemoveCommand()],
12+
options: [new CustomRoleCreateCommand(), new CustomRoleInspectCommand(), new CustomRoleRemoveCommand()],
1313
});
1414
}
1515
}

src/Modules/Commands/slash/role/Create.ts renamed to src/Modules/Commands/slash/customrole/Create.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Signale, Config, CustomRole, Webhooks } from "../../..";
55
import { BaseCommandOption } from "../../Basecommand";
66
import { createInfoEmbed } from "./createInfoEmbed";
77

8-
interface RoleCreateArgs {
8+
interface CustomRoleCreateArgs {
99
hex: string;
1010
rolename: string;
1111
}
1212

13-
class RoleCreateCommand extends BaseCommandOption {
13+
class CustomRoleCreateCommand extends BaseCommandOption {
1414
constructor() {
1515
super({
1616
name: "create",
@@ -42,15 +42,15 @@ class RoleCreateCommand extends BaseCommandOption {
4242
});
4343
}
4444

45-
onBeforeRun(ctx: Interaction.InteractionContext, args: RoleCreateArgs) {
45+
onBeforeRun(ctx: Interaction.InteractionContext, args: CustomRoleCreateArgs) {
4646
return /^#?([0-9A-Fa-f]{6})$/.test(args.hex);
4747
}
4848

49-
onCancelRun(ctx: Interaction.InteractionContext, args: RoleCreateArgs) {
49+
onCancelRun(ctx: Interaction.InteractionContext, args: CustomRoleCreateArgs) {
5050
return this.ephEoR(ctx, `${args.hex} is not a valid hex code.`, 2);
5151
}
5252

53-
async run(ctx: Interaction.InteractionContext, args: RoleCreateArgs) {
53+
async run(ctx: Interaction.InteractionContext, args: CustomRoleCreateArgs) {
5454
ctx.command!.metadata.edited = false;
5555

5656
const guild = ctx.guilds.get(Config.guildId)!;
@@ -98,7 +98,7 @@ class RoleCreateCommand extends BaseCommandOption {
9898
]);
9999
}
100100

101-
async onSuccess(ctx: Interaction.InteractionContext, args: RoleCreateArgs) {
101+
async onSuccess(ctx: Interaction.InteractionContext, args: CustomRoleCreateArgs) {
102102
const verb = ctx.command.metadata.edited ? "Edited" : "Created";
103103

104104
const embed = createInfoEmbed(ctx.user, this.metadata.cachedRole);
@@ -118,4 +118,4 @@ class RoleCreateCommand extends BaseCommandOption {
118118
}
119119
}
120120

121-
export default RoleCreateCommand;
121+
export default CustomRoleCreateCommand;

src/Modules/Commands/slash/role/Inspect.ts renamed to src/Modules/Commands/slash/customrole/Inspect.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Interaction, Structures } from "detritus-client";
22
import { ApplicationCommandOptionTypes } from "detritus-client/lib/constants";
33

4-
import { Config, CustomRole } from "../../../";
5-
import { BaseCommandOption } from "../../";
4+
import { Config, CustomRole } from "../../..";
5+
import { BaseCommandOption } from "../..";
66
import { createInfoEmbed } from "./createInfoEmbed";
77

8-
interface RoleInspectArgs {
8+
interface CustomRoleInspectArgs {
99
user: Structures.Member | Structures.User;
1010
}
1111

12-
class RoleInspectCommand extends BaseCommandOption {
12+
class CustomRoleInspectCommand extends BaseCommandOption {
1313
constructor() {
1414
super({
1515
name: "inspect",
@@ -32,7 +32,7 @@ class RoleInspectCommand extends BaseCommandOption {
3232
});
3333
}
3434

35-
async run(ctx: Interaction.InteractionContext, args: RoleInspectArgs) {
35+
async run(ctx: Interaction.InteractionContext, args: CustomRoleInspectArgs) {
3636
const guild = ctx.guilds.get(Config.guildId)!;
3737

3838
const result = await CustomRole.findOne({ where: { userId: args.user.id } });
@@ -47,4 +47,4 @@ class RoleInspectCommand extends BaseCommandOption {
4747
}
4848
}
4949

50-
export default RoleInspectCommand;
50+
export default CustomRoleInspectCommand;

src/Modules/Commands/slash/role/Remove.ts renamed to src/Modules/Commands/slash/customrole/Remove.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { Interaction } from "detritus-client";
22
import { Permissions } from "detritus-client/lib/constants";
33

44
import { Signale, Config, CustomRole, Webhooks } from "../../..";
5-
import { BaseCommandOption } from "../../";
5+
import { BaseCommandOption } from "../..";
66

7-
class RoleRemoveCommand extends BaseCommandOption {
7+
class CustomRoleRemoveCommand extends BaseCommandOption {
88
constructor() {
99
super({
1010
name: "remove",
@@ -30,7 +30,7 @@ class RoleRemoveCommand extends BaseCommandOption {
3030

3131
result.remove();
3232
} else {
33-
return this.ephEoR(ctx, "This user doesn't have a custom role.", 2);
33+
return this.ephEoR(ctx, "You don't have a custom role.", 2);
3434
}
3535
}
3636

@@ -55,4 +55,4 @@ class RoleRemoveCommand extends BaseCommandOption {
5555
}
5656
}
5757

58-
export default RoleRemoveCommand;
58+
export default CustomRoleRemoveCommand;
File renamed without changes.

0 commit comments

Comments
 (0)