ChatFull Participants helpers

This commit is contained in:
Wizou 2022-01-18 15:24:04 +01:00
parent 79224551e6
commit 8d70f241ad
2 changed files with 15 additions and 6 deletions

View file

@ -103,6 +103,7 @@ namespace TL
partial class ChatBase : IPeerInfo
{
/// <summary>Is this chat among current user active chats?</summary>
public abstract bool IsActive { get; }
public abstract ChatPhoto Photo { get; }
/// <summary>returns true if you're banned of any of these rights</summary>
@ -155,11 +156,19 @@ namespace TL
public override string ToString() => $"ChannelForbidden {id} \"{title}\"";
}
partial class ChatFullBase { public abstract int ParticipantsCount { get; } }
partial class ChatFull { public override int ParticipantsCount => participants.Participants.Length; }
partial class ChannelFull { public override int ParticipantsCount => participants_count; }
partial class ChatParticipantBase { public abstract bool IsAdmin { get; } }
partial class ChatParticipant { public override bool IsAdmin => false; }
partial class ChatParticipantCreator { public override bool IsAdmin => true; }
partial class ChatParticipantAdmin { public override bool IsAdmin => true; }
partial class ChatParticipantsBase { public abstract ChatParticipantBase[] Participants { get; }}
partial class ChatParticipantsForbidden { public override ChatParticipantBase[] Participants => Array.Empty<ChatParticipantBase>(); }
partial class ChatParticipants { public override ChatParticipantBase[] Participants => participants; }
partial class PhotoBase
{
public abstract long ID { get; }

View file

@ -1034,7 +1034,7 @@ namespace TL
}
/// <summary>Object containing detailed group info <para>Derived classes: <see cref="ChatFull"/>, <see cref="ChannelFull"/></para> <para>See <a href="https://corefork.telegram.org/type/ChatFull"/></para></summary>
public abstract class ChatFullBase : IObject
public abstract partial class ChatFullBase : IObject
{
/// <summary>ID of the chat</summary>
public abstract long ID { get; }
@ -1066,7 +1066,7 @@ namespace TL
}
/// <summary>Detailed chat info <para>See <a href="https://corefork.telegram.org/constructor/chatFull"/></para></summary>
[TLDef(0xD18EE226)]
public class ChatFull : ChatFullBase
public partial class ChatFull : ChatFullBase
{
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags;
@ -1160,7 +1160,7 @@ namespace TL
}
/// <summary>Full info about a <a href="https://corefork.telegram.org/api/channel">channel/supergroup</a> <para>See <a href="https://corefork.telegram.org/constructor/channelFull"/></para></summary>
[TLDef(0xE13C3D20)]
public class ChannelFull : ChatFullBase
public partial class ChannelFull : ChatFullBase
{
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags;
@ -1363,14 +1363,14 @@ namespace TL
}
/// <summary>Object contains info on group members. <para>Derived classes: <see cref="ChatParticipantsForbidden"/>, <see cref="ChatParticipants"/></para> <para>See <a href="https://corefork.telegram.org/type/ChatParticipants"/></para></summary>
public abstract class ChatParticipantsBase : IObject
public abstract partial class ChatParticipantsBase : IObject
{
/// <summary>Group ID</summary>
public abstract long ChatId { get; }
}
/// <summary>Info on members is unavailable <para>See <a href="https://corefork.telegram.org/constructor/chatParticipantsForbidden"/></para></summary>
[TLDef(0x8763D3E1)]
public class ChatParticipantsForbidden : ChatParticipantsBase
public partial class ChatParticipantsForbidden : ChatParticipantsBase
{
/// <summary>Flags, see <a href="https://corefork.telegram.org/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></summary>
public Flags flags;
@ -1390,7 +1390,7 @@ namespace TL
}
/// <summary>Group members. <para>See <a href="https://corefork.telegram.org/constructor/chatParticipants"/></para></summary>
[TLDef(0x3CBC93F8)]
public class ChatParticipants : ChatParticipantsBase
public partial class ChatParticipants : ChatParticipantsBase
{
/// <summary>Group identifier</summary>
public long chat_id;