sync static method

Future<VanityInvite?> sync(
  1. Snowflake guildId
)

Syncs the vanity invite for the Guild.

VanityInvite? invite = await VanityInvite.sync(guild);

Implementation

static Future<VanityInvite?> sync(Snowflake guildId) async {
   Response response = await ioc.use<DiscordApiHttpService>().get(url: "/guilds/$guildId/vanity-url").build();

   if(response.statusCode != 200) {
     return null;
   }

  return VanityInvite.from(jsonDecode(response.body));
}