Fix the creation of guilds from templates
The biggest hold-up was missing fields (`premium_tier`,
`welcome_screen`, etc.) but it looks like someone has provided a
helpful function called `createGuild(...)` to provide sensible default
values.

This commit fixes the errors related to creating a guild from a
template. I've also refactored the code to include roles and channels in
the template.

To make sure that the @everyone role is cloned correctly, when
creating the guild from a template, we check if the role's ID
matches the template's `source_guild_id`. If it does, we set the
@everyone role to the new guild's ID.
1 parent eec2a8b commit 33fde3bc4a338dccd8707a7712763535862aa037
@Zane Helton Zane Helton authored on 29 Jun 2025
Madeline committed on 29 Jun 2025
Showing 4 changed files
View
src/api/routes/guilds/#guild_id/templates.ts
View
src/api/routes/guilds/index.ts
View
src/api/routes/guilds/templates/index.ts
View
src/util/entities/Guild.ts