Skip to content

Commit

Permalink
fix: woops - forget some files
Browse files Browse the repository at this point in the history
  • Loading branch information
Yann151924 committed Oct 29, 2023
1 parent ebf537d commit 2a75837
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/commands/serveurs/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Server } from '@mineaurion/api';
import { AbstractModal, FlattenTypeModal } from '../../libs/AbstractModal.js';
import { ServersService } from './serversService.js';
import { format } from 'util';
import flat from 'flat';
import { flatten, unflatten } from 'flat';

@Discord()
@injectable()
Expand Down Expand Up @@ -140,7 +140,7 @@ export class Servers extends AbstractModal<Server> {
interaction: StringSelectMenuInteraction,
): Promise<void> {
await interaction.deferUpdate();
const server = flat.flatten(
const server = flatten(
await this.service.getOneServer(parseInt(interaction.values[0])),
);
this.cacheLocal.set(
Expand Down Expand Up @@ -172,7 +172,7 @@ export class Servers extends AbstractModal<Server> {
@ButtonComponent({ id: 'servers-modalButton-final' })
async handleFinal(interaction: ButtonInteraction): Promise<void> {
await interaction.deferUpdate();
const server = flat.unflatten<FlattenTypeModal, Server>(
const server = unflatten<FlattenTypeModal, Server>(
this.cacheLocal.get(
format(this.cacheKeyForm, interaction.user.id),
) as FlattenTypeModal,
Expand Down
4 changes: 2 additions & 2 deletions src/libs/AbstractModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { ModalConfig } from '../commands/serveurs/model';
import { CacheLocal } from '../utils/cache_locale.js';
import { strToBool } from '../utils/helper.js';
import { unflatten } from 'flat';
import { flatten, unflatten } from 'flat';
import { format } from 'util';

export type FlattenTypeModal = Record<string, string | boolean | number>;
Expand Down Expand Up @@ -63,7 +63,7 @@ export abstract class AbstractModal<T> {
.setCustomId(element.id)
.setLabel(element.label)
.setStyle(element.style);
const editChoice: FlattenTypeModal = flat.flatten(
const editChoice: FlattenTypeModal = flatten(
this.cacheLocal.get(
format(this.cacheKeyEditChoice, interaction.user.id),
) || {},
Expand Down

0 comments on commit 2a75837

Please sign in to comment.