42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Serialization;
|
|
using Telegram.Bot.Requests.Abstractions;
|
|
using Telegram.Bot.Types;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Telegram.Bot.Requests {
|
|
|
|
|
|
/// <summary>
|
|
/// Use this method to get information about a member of a chat. Returns a <see cref="ChatMember"/>
|
|
/// object on success.
|
|
/// </summary>
|
|
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
|
|
public class GetChatMemberRequest : RequestBase<ChatMember>, IChatTargetable, IUserTargetable {
|
|
/// <inheritdoc />
|
|
[JsonProperty(Required = Required.Always)]
|
|
public ChatId ChatId {
|
|
get;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[JsonProperty(Required = Required.Always)]
|
|
public long UserId {
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new request with chatId and userId
|
|
/// </summary>
|
|
/// <param name="chatId">
|
|
/// Unique identifier for the target chat or username of the target supergroup or channel
|
|
/// (in the format <c>@channelusername</c>)
|
|
/// </param>
|
|
/// <param name="userId">Unique identifier of the target user</param>
|
|
public GetChatMemberRequest(ChatId chatId, long userId)
|
|
: base("getChatMember") {
|
|
ChatId = chatId;
|
|
UserId = userId;
|
|
}
|
|
}
|
|
} |