set rules/updates in guild if we created them
This commit is contained in:
parent
139d31e938
commit
d06fbcebb8
@ -165,7 +165,7 @@ router.patch(
|
|||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
// create an updates channel for them
|
// create an updates channel for them
|
||||||
await Channel.createChannel(
|
const channel = await Channel.createChannel(
|
||||||
{
|
{
|
||||||
name: "moderator-only",
|
name: "moderator-only",
|
||||||
guild_id: guild.id,
|
guild_id: guild.id,
|
||||||
@ -184,6 +184,8 @@ router.patch(
|
|||||||
undefined,
|
undefined,
|
||||||
{ skipPermissionCheck: true },
|
{ skipPermissionCheck: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
guild.rules_channel_id = channel.id;
|
||||||
} else if (body.public_updates_channel_id != undefined) {
|
} else if (body.public_updates_channel_id != undefined) {
|
||||||
// ensure channel exists in this guild
|
// ensure channel exists in this guild
|
||||||
await Channel.findOneOrFail({
|
await Channel.findOneOrFail({
|
||||||
@ -200,7 +202,7 @@ router.patch(
|
|||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
// create a rules for them
|
// create a rules for them
|
||||||
await Channel.createChannel(
|
const channel = await Channel.createChannel(
|
||||||
{
|
{
|
||||||
name: "rules",
|
name: "rules",
|
||||||
guild_id: guild.id,
|
guild_id: guild.id,
|
||||||
@ -219,6 +221,8 @@ router.patch(
|
|||||||
undefined,
|
undefined,
|
||||||
{ skipPermissionCheck: true },
|
{ skipPermissionCheck: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
guild.rules_channel_id = channel.id;
|
||||||
} else if (body.rules_channel_id != undefined) {
|
} else if (body.rules_channel_id != undefined) {
|
||||||
// ensure channel exists in this guild
|
// ensure channel exists in this guild
|
||||||
await Channel.findOneOrFail({
|
await Channel.findOneOrFail({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user