FluxpointDev / RevoltSharp

A C# lib for using the revolt chat API and connecting to the gateway to get events.
https://rvlt.gg/N33Rf6DE
MIT License
17 stars 3 forks source link

Use the UserAgent field vervatim #19

Closed nulldg closed 1 year ago

nulldg commented 1 year ago

this PR makes 3 changes:

  1. RevoltClient.Version is now static and reads from the assembly information rather than being hard-coded cherry-picked into #20
  2. ClientConfig.UserAgent is null by default. ConfigSafetyChecks will replace it with the default user agent which accounts for library version and whether or not the user has specified that the library will be controlling a userbot.
  3. ClientConfig.UserAgent, if set, is now used in its entirety with no additions. this enables the user to have full control over their user agent, which makes #18 significantly easier to use and allows users to insert their own bot versions (eg for open source "host it yourself" bots like back in the good old days of IRC).
  4. the websocket now includes the user agent.

this PR will conflict with #18. ideally this one should be merged first, and i'll correct that PR accordingly.