コード例 #1
0
        /// <summary>
        /// Synchronizes this integration, if this is a guild integration.
        /// <para>You can check if this is a guild integration, if <see cref="GuildId"/> is not null.</para>
        /// <para>Requires <see cref="DiscordPermission.ManageGuild"/>.</para>
        /// </summary>
        /// <exception cref="DiscordHttpApiException"></exception>
        /// <exception cref="InvalidOperationException">Thrown if this is not a guild integration.</exception>
        public Task Sync()
        {
            if (!GuildId.HasValue)
            {
                throw new InvalidOperationException("This integration does not represent a guild integration");
            }

            return(http.SyncGuildIntegration(GuildId.Value, Id));
        }