Send position property on guild join
This commit is contained in:
parent
6ca12cb7fb
commit
5f9c6b01a7
@ -31,7 +31,7 @@ import {
|
|||||||
PrimaryGeneratedColumn,
|
PrimaryGeneratedColumn,
|
||||||
RelationId,
|
RelationId,
|
||||||
} from "typeorm";
|
} from "typeorm";
|
||||||
import { Ban, PublicGuildRelations } from ".";
|
import { Ban, Channel, PublicGuildRelations } from ".";
|
||||||
import { ReadyGuildDTO } from "../dtos";
|
import { ReadyGuildDTO } from "../dtos";
|
||||||
import {
|
import {
|
||||||
GuildCreateEvent,
|
GuildCreateEvent,
|
||||||
@ -330,6 +330,13 @@ export class Member extends BaseClassWithoutId {
|
|||||||
relationLoadStrategy: "query",
|
relationLoadStrategy: "query",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
for await (const channel of guild.channels) {
|
||||||
|
channel.position = await Channel.calculatePosition(
|
||||||
|
channel.id,
|
||||||
|
guild_id,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const memberCount = await Member.count({ where: { guild_id } });
|
const memberCount = await Member.count({ where: { guild_id } });
|
||||||
|
|
||||||
const memberPreview = (
|
const memberPreview = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user