summary refs log tree commit diff
path: root/src/util/entities/Guild.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-20 18:10:47 +1100
committerGitHub <noreply@github.com>2023-01-20 18:10:47 +1100
commit084dc0be08555891cad4c2bb984822a62ec5ec9f (patch)
treeed2ca0fafefa2224ae32761f955f63935422a97d /src/util/entities/Guild.ts
parentfix: route file regex (#956) (diff)
downloadserver-084dc0be08555891cad4c2bb984822a62ec5ec9f.tar.xz
Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit

* Fix all ESLint errors

* Update GH workflow to check prettier and eslint
Diffstat (limited to '')
-rw-r--r--src/util/entities/Guild.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/entities/Guild.ts b/src/util/entities/Guild.ts

index 9f300334..c835f5fc 100644 --- a/src/util/entities/Guild.ts +++ b/src/util/entities/Guild.ts
@@ -20,10 +20,8 @@ import { Column, Entity, JoinColumn, - ManyToMany, ManyToOne, OneToMany, - OneToOne, RelationId, } from "typeorm"; import { Config, handleFile, Snowflake } from ".."; @@ -370,12 +368,12 @@ export class Guild extends BaseClass { } }); - for (const channel of body.channels?.sort((a, b) => + for (const channel of body.channels.sort((a) => a.parent_id ? 1 : -1, )) { - var id = ids.get(channel.id) || Snowflake.generate(); + const id = ids.get(channel.id) || Snowflake.generate(); - var parent_id = ids.get(channel.parent_id); + const parent_id = ids.get(channel.parent_id); await Channel.createChannel( { ...channel, guild_id, id, parent_id },