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 SourceChannelUsername
The username of the public channel
Declaration
public string ChannelUsername { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ChatIdentifier
The identifier of the group
Declaration
public long ChatIdentifier { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
| Improve this Doc View SourceEquals(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 |
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 SourceExplicit(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 |
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 |
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 |
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 |
Implicit(Chat to 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 |