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.

RpcGuildSummary.cs 761 B

123456789101112131415161718192021222324252627282930
  1. using System.Diagnostics;
  2. using Model = Discord.API.Rpc.GuildSummary;
  3. namespace Discord.Rpc
  4. {
  5. [DebuggerDisplay(@"{DebuggerDisplay,nq}")]
  6. public class RpcGuildSummary
  7. {
  8. public ulong Id { get; }
  9. public string Name { get; private set; }
  10. internal RpcGuildSummary(ulong id)
  11. {
  12. Id = id;
  13. }
  14. internal static RpcGuildSummary Create(Model model)
  15. {
  16. var entity = new RpcGuildSummary(model.Id);
  17. entity.Update(model);
  18. return entity;
  19. }
  20. internal void Update(Model model)
  21. {
  22. Name = model.Name;
  23. }
  24. public override string ToString() => Name;
  25. private string DebuggerDisplay => $"{Name} ({Id})";
  26. }
  27. }