Is there a way to let the bot use a template? I know there is a way to create a template Create Server Template discord.js or by doing it by hand. But is there a way to apply a template with a bot? just like this:
message.guild.applyTemplate('TemplateUrl')
message.guild.useTemplate('TemplateUrl')
Edit Discord.js v13
Yes, it's possible now with <GuildTemplate>.sync().
Syncs this template to the current state of the guild.
Returns: Promise
Initial Answer (Discord.js v12)
Using Discord.js: Not yet.
Using the Discord API: technically Yes
As of now there is no way to apply a server template with a discord.js bot. However there is something interesting mentioned in the Official Discord Devs Docs.
PUT
/guilds/{guild.id}/templates/{template.code}Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the guild template object on success.
Source: https://discord.com/developers/docs/resources/guild-template#sync-guild-template
Also Discord.js v13 introduction mentions Guild Template API support in the Update Notes/Changes in v13.
GuildTemplate Provides API support for server templates
I am going to adapt this answer once Discord.js v13 has been released.