You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

what-are-they.md 1.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. uid: FAQ.BuildOverrides.WhatAreThey
  3. title: Build Overrides, What are they?
  4. ---
  5. # Build Overrides
  6. Build overrides are a way for library developers to override the default behavior of the library on the fly. Adding them to your code is really simple.
  7. ## Installing the package
  8. The build override package can be installed on nuget [here](TODO) or by using the package manager
  9. ```
  10. PM> Install-Package Discord.Net.BuildOverrides
  11. ```
  12. ## Adding an override
  13. ```cs
  14. public async Task MainAsync()
  15. {
  16. // hook into the log function
  17. BuildOverrides.Log += (buildOverride, message) =>
  18. {
  19. Console.WriteLine($"{buildOverride.Name}: {message}");
  20. return Task.CompletedTask;
  21. };
  22. // add your overrides
  23. await BuildOverrides.AddOverrideAsync("example-override-name");
  24. }
  25. ```
  26. Overrides are normally built for specific problems, for example if someone is having an issue and we think we might have a fix then we can create a build override for them to test out the fix.
  27. ## Security and Transparency
  28. Overrides can only be created and updated by library developers, you should only apply an override if a library developer askes you to.
  29. Code for the overrides server and the overrides themselves can be found [here](https://github.com/discord-net/Discord.Net.BuildOverrides).