Show / Hide Table of Contents

Class ChatId

Identifier of a telegram chat

Inheritance
System.Object
ChatId
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TelegramBotApi.Types
Assembly: TelegramBotApi.dll
Syntax
public class ChatId

Properties

| Improve this Doc View Source

ChannelUsername

The username of the public channel

Declaration
public string ChannelUsername { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ChatIdentifier

The identifier of the group

Declaration
public long ChatIdentifier { get; set; }
Property Value
Type Description
System.Int64

Methods

| Improve this Doc View Source

Equals(Object)

Find out whether this ChatId is equal to another object. This is true if the other object is a ChatId and has the same ChatIdentifier and ChannelUsername.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare this ChatId with.

Returns
Type Description
System.Boolean

True if obj is equal to this ChatId.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Get the HashCode for this ChatId object

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

The ChatId's HashCode

Overrides
System.Object.GetHashCode()

Operators

| Improve this Doc View Source

Explicit(ChatId to Int64)

Explicitly converts a chatId to a long value

Declaration
public static explicit operator long (ChatId cId)
Parameters
Type Name Description
ChatId cId

The chatId

Returns
Type Description
System.Int64
| Improve this Doc View Source

Explicit(ChatId to String)

Explicitly converts a chatId to a string value

Declaration
public static explicit operator string (ChatId cId)
Parameters
Type Name Description
ChatId cId

The chatId

Returns
Type Description
System.String
| Improve this Doc View Source

Implicit(Int64 to ChatId)

Automatically converts a long into a ChatId

Declaration
public static implicit operator ChatId(long id)
Parameters
Type Name Description
System.Int64 id

The unique identifier of the target chat

Returns
Type Description
ChatId
| Improve this Doc View Source

Implicit(String to ChatId)

Automatically converts a string into a ChatId

Declaration
public static implicit operator ChatId(string channelName)
Parameters
Type Name Description
System.String channelName

The username of the target public channel

Returns
Type Description
ChatId
| Improve this Doc View Source

Implicit(Chat to ChatId)

Automatically converts a Chat object into a ChatId

Declaration
public static implicit operator ChatId(Chat chat)
Parameters
Type Name Description
Chat chat

The Chat to which the desired id belongs

Returns
Type Description
ChatId
  • Improve this Doc
  • View Source
Back to top Generated by DocFX