1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-14 01:36:08 +03:00
Octobot/src/Extensions/UInt64Extensions.cs
Octol1ttle e6f53b13f0
Split extension methods into separate classes (#161)
This PR splits the extension methods contained in `Extensions.cs` into
separate classes in the `Octobot.Extensions` namespace. This was done
for multiple reasons:
1) The `Extensions.cs` violates SRP (Single Responsibility Principle) -
it takes upon itself every extension method for many types
2) Having a separate class for each extended type is a standard practice
- take a look at
[Remora.Discord](https://github.com/Remora/Remora.Discord/tree/main/Backend/Remora.Discord.Rest/Extensions)
or [osu!](https://github.com/ppy/osu/tree/master/osu.Game/Extensions)
3) Having all extension methods in one file makes it hard to find the
method you want
2023-10-12 15:37:25 +00:00

12 lines
234 B
C#

using Remora.Discord.API;
using Remora.Rest.Core;
namespace Octobot.Extensions;
public static class UInt64Extensions
{
public static Snowflake ToSnowflake(this ulong id)
{
return DiscordSnowflake.New(id);
}
}