Skip to content

Commit

Permalink
fix(CommandRegistryHandler): updates even without difference
Browse files Browse the repository at this point in the history
  • Loading branch information
ijsKoud committed Dec 6, 2022
1 parent 78dad33 commit 17e15fd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/handlers/CommandRegistryHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import {
Collection,
PermissionsBitField
} from "discord.js";
import type { IgloClient } from "../Client.js";
import { InteractionHandlerError } from "../Errors/InteractionHandlerError.js";
import type { Command } from "../structures/Command.js";
import { bold } from "colorette";
import _ from "lodash";
import { Command, IgloClient, InteractionHandlerError } from "@snowcrystals/iglo";

export class CommandRegistry {
public constructor(public client: IgloClient) {}
Expand Down Expand Up @@ -180,9 +178,9 @@ export class CommandRegistry {
if (!discord) return "undefined";

// check the name localizations
if (!_.isEqual(discord.nameLocalizations, command.nameLocalizations)) return "nameLocalizations";
if (!_.isEqual(discord.nameLocalizations, command.nameLocalizations ?? null)) return "nameLocalizations";
// check the description localizations
if (!_.isEqual(discord.descriptionLocalizations, command.descriptionLocalizations)) return "descriptionLocalizations";
if (!_.isEqual(discord.descriptionLocalizations, command.descriptionLocalizations ?? null)) return "descriptionLocalizations";
// check the description
if (discord.description !== command.description) return "description";

Expand Down

0 comments on commit 17e15fd

Please sign in to comment.