the server's boosting status is rather unstable. it's usually at around 32 boosts, but occasionally, it falls below 30.
these 30 boosts (or level 3) unlock a vanity invite URL, which is configured to discord.gg/buildtheearth. unfortunately, Discord
unsets this setting when level 3 is lost, and it does not restore it once it's regained.
the permission required to update the vanity URL is MANAGE_SERVER, which is only possessed by the Admin role. as known, administrators are not quite the fastest to respond to this type of occasion.
ideally, the bot would detect whenever level 3 is reached, and accordingly update this setting. if needed, a new vanity field could be added to the configuration, as hard-coding this type of value does not ring the prettiest bells.
on the technical side, the Discord WebSocket Gateway does not provide a guildPremiumSubscription event, or similar.
the bot could either subscribe to the guildMemberUpdate event to check for the configured server booster role being added to a member, or subscribe to the message event and check for Message#type to be "USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3".
once again, changing the vanity URL of a guild is not documented (and therefore it's not included in discord.js...), but making a PATCH request to /guilds/{guild.id}/vanity-url will work — see Get Guild Vanity URL & discord/discord-api-docs#519. the best option for this would probably be implementing a custom setVanityCode() method in Guild (and possibly even PR it into discord.js).
overall, the implementation of this feature will be kinda hacky, but it will be worth it!
the server's boosting status is rather unstable. it's usually at around 32 boosts, but occasionally, it falls below 30.
these 30 boosts (or level 3) unlock a vanity invite URL, which is configured to
discord.gg/buildtheearth
. unfortunately, Discord unsets this setting when level 3 is lost, and it does not restore it once it's regained.the permission required to update the vanity URL is
MANAGE_SERVER
, which is only possessed by theAdmin
role. as known, administrators are not quite the fastest to respond to this type of occasion.ideally, the bot would detect whenever level 3 is reached, and accordingly update this setting. if needed, a new
vanity
field could be added to the configuration, as hard-coding this type of value does not ring the prettiest bells.on the technical side, the Discord WebSocket Gateway does not provide a
guildPremiumSubscription
event, or similar.the bot could either subscribe to the
guildMemberUpdate
event to check for the configured server booster role being added to a member, or subscribe to themessage
event and check forMessage#type
to be"USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3"
.once again, changing the vanity URL of a guild is not documented (and therefore it's not included in discord.js...), but making a
PATCH
request to/guilds/{guild.id}/vanity-url
will work — see Get Guild Vanity URL & discord/discord-api-docs#519. the best option for this would probably be implementing a customsetVanityCode()
method inGuild
(and possibly even PR it into discord.js).overall, the implementation of this feature will be kinda hacky, but it will be worth it!