mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-28 00:36:00 +00:00
Add support for Guild Member object & included data (#279)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
namespace DiscordChatExporter.Core.Models
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace DiscordChatExporter.Core.Models
|
||||
{
|
||||
// https://discordapp.com/developers/docs/topics/permissions#role-object
|
||||
|
||||
@@ -8,10 +11,19 @@
|
||||
|
||||
public string Name { get; }
|
||||
|
||||
public Role(string id, string name)
|
||||
public Color Color { get; }
|
||||
|
||||
public string ColorAsHex => $"#{(Color.ToArgb() & 0xffffff):X6}";
|
||||
public string ColorAsRgb => $"{Color.R}, {Color.G}, {Color.B}";
|
||||
|
||||
public int Position { get; }
|
||||
|
||||
public Role(string id, string name, Color color, int position)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
Color = color;
|
||||
Position = position;
|
||||
}
|
||||
|
||||
public override string ToString() => Name;
|
||||
@@ -19,6 +31,6 @@
|
||||
|
||||
public partial class Role
|
||||
{
|
||||
public static Role CreateDeletedRole(string id) => new Role(id, "deleted-role");
|
||||
public static Role CreateDeletedRole(string id) => new Role(id, "deleted-role", Color.Black, -1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user