Skip to content

Commit

Permalink
feat(commands): define instalation type
Browse files Browse the repository at this point in the history
  • Loading branch information
NedcloarBR committed Sep 18, 2024
1 parent b245d7e commit d702fd5
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"discord-api-types": "^0.37.100",
"discord.js": "^14.16.1",
"discord.js": "^14.16.2",
"ioredis": "^5.4.1",
"moment": "^2.30.1",
"necord": "^6.8.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import {
localizationMapByKey,
} from "@necord/localization";
import { ConfigService } from "@nestjs/config";
import { EmbedBuilder, codeBlock } from "discord.js";
import {
ApplicationIntegrationType,
EmbedBuilder,
InteractionContextType,
codeBlock,
} from "discord.js";
import { Ctx, Options, type SlashCommandContext, Subcommand } from "necord";
import { DeveloperToolsCommand } from "../../DeveloperTools.decorator";
import type { EvalDTO } from "./eval.dto";
Expand All @@ -25,6 +30,8 @@ export class EvalCommand {
descriptionLocalizations: localizationMapByKey(
"DeveloperTools.eval.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({
category: "🛠️ Developer Tools",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
localizationMapByKey,
} from "@necord/localization";
import { Logger } from "@nestjs/common";
import { ApplicationIntegrationType, InteractionContextType } from "discord.js";
import { Ctx, SlashCommandContext, Subcommand } from "necord";
import { DeveloperToolsCommand } from "../DeveloperTools.decorator";

Expand All @@ -19,6 +20,8 @@ export class TestCommand {
descriptionLocalizations: localizationMapByKey(
"DeveloperTools.test.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🛠️ Developer Tools", disable: false })
@CommandPermissions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import {
localizationMapByKey,
} from "@necord/localization";
import { Logger } from "@nestjs/common";
import { channelMention } from "discord.js";
import {
ApplicationIntegrationType,
InteractionContextType,
channelMention,
} from "discord.js";
import { Ctx, Options, SlashCommandContext, Subcommand } from "necord";
import { ModerationCommand } from "../../Moderation.decorator";
import { ClearDTO } from "./clear.dto";
Expand All @@ -22,6 +26,8 @@ export class ClearCommand {
descriptionLocalizations: localizationMapByKey(
"Moderation.clear.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🛡️ Moderation", disable: false })
@CommandPermissions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import {
CommandPermissions,
ValidatedOptions,
} from "@/common/decorators/";
import { CommandConfigGuard, CommandPermissionsGuard } from "@/common/guards";
import { MessageTools } from "@/modules/commands/Message";
import { localizationMapByKey } from "@necord/localization";
import { Inject, Logger, UseGuards } from "@nestjs/common";
import { Client, TextChannel } from "discord.js";
import { Inject, Logger } from "@nestjs/common";
import {
ApplicationIntegrationType,
Client,
InteractionContextType,
TextChannel,
} from "discord.js";
import { Ctx, SlashCommandContext, Subcommand } from "necord";
import { ReactionRolesCommand } from "../../ReactionRoles.decorator";
import type {
Expand Down Expand Up @@ -36,6 +40,8 @@ export class CreateReactionCommand {
descriptionLocalizations: localizationMapByKey(
"ReactionRoles.create.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🎩 ReactionRole", disable: false })
@CommandPermissions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import {
import { Extends } from "@/types/Constants";
import { localizationMapByKey } from "@necord/localization";
import { Inject, Logger } from "@nestjs/common";
import { CommandInteraction } from "discord.js";
import {
ApplicationIntegrationType,
CommandInteraction,
InteractionContextType,
} from "discord.js";
import {
Button,
ButtonContext,
Expand Down Expand Up @@ -42,6 +46,8 @@ export class DeleteAllReactionsCommand {
descriptionLocalizations: localizationMapByKey(
"ReactionRoles.deleteall.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🎩 ReactionRole", disable: false })
@CommandPermissions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import { Buttons } from "@/modules/components/Buttons.component";
import { Extends } from "@/types/Constants";
import { localizationMapByKey } from "@necord/localization";
import { Inject, Logger } from "@nestjs/common";
import { Client, TextChannel } from "discord.js";
import {
ApplicationIntegrationType,
Client,
InteractionContextType,
TextChannel,
} from "discord.js";
import { Ctx, SlashCommandContext, Subcommand } from "necord";
import { ReactionRolesCommand } from "../../ReactionRoles.decorator";
import type {
Expand Down Expand Up @@ -36,6 +41,8 @@ export class DeleteReactionCommand {
descriptionLocalizations: localizationMapByKey(
"ReactionRoles.delete.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🎩 ReactionRole", disable: false })
@CommandPermissions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import {
} from "@/common/decorators";
import { Buttons } from "@/modules/components/Buttons.component";
import { Extends } from "@/types/Constants";
import { localizationMapByKey } from "@necord/localization";
import { Inject, Logger } from "@nestjs/common";
import { Client, TextChannel } from "discord.js";
import {
ApplicationIntegrationType,
Client,
InteractionContextType,
TextChannel,
} from "discord.js";
import { Ctx, SlashCommandContext, Subcommand } from "necord";
import { ReactionRolesCommand } from "../../ReactionRoles.decorator";
import type {
Expand All @@ -30,7 +36,13 @@ export class EditReactionCommand {

@Subcommand({
name: "edit",
nameLocalizations: localizationMapByKey("ReactionRoles.edit.name"),
description: "Edit an ReactionRole",
descriptionLocalizations: localizationMapByKey(
"ReactionRoles.edit.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🎩 ReactionRole", disable: false })
@CommandPermissions({
Expand Down
3 changes: 3 additions & 0 deletions src/modules/reactionRoles/commands/ReactionTypes.command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CommandConfig, CommandPermissions } from "@/common/decorators";
import { localizationMapByKey } from "@necord/localization";
import { Inject, Logger } from "@nestjs/common";
import { ApplicationIntegrationType, InteractionContextType } from "discord.js";
import { Ctx, SlashCommandContext, Subcommand } from "necord";
import { ReactionRolesCommand } from "../ReactionRoles.decorator";
import type {
Expand All @@ -26,6 +27,8 @@ export class ReactionTypesCommand {
descriptionLocalizations: localizationMapByKey(
"ReactionRoles.types.description",
),
integrationTypes: [ApplicationIntegrationType.GuildInstall],
contexts: [InteractionContextType.Guild],
})
@CommandConfig({ category: "🎩 ReactionRole", disable: false })
@CommandPermissions({
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4151,7 +4151,7 @@ __metadata:
languageName: node
linkType: hard

"discord.js@npm:^14.16.1":
"discord.js@npm:^14.16.2":
version: 14.16.2
resolution: "discord.js@npm:14.16.2"
dependencies:
Expand Down Expand Up @@ -6402,7 +6402,7 @@ __metadata:
commitizen: "npm:^4.3.0"
cross-env: "npm:^7.0.3"
discord-api-types: "npm:^0.37.100"
discord.js: "npm:^14.16.1"
discord.js: "npm:^14.16.2"
husky: "npm:^9.1.5"
ioredis: "npm:^5.4.1"
lint-staged: "npm:^15.2.10"
Expand Down

0 comments on commit d702fd5

Please sign in to comment.