WTelegramClientHelperGetChannelTopicsByTitleAsync Method
Asynchronously retrieves a collection of ForumTopic
objects that match the provided topic title from the provided channel.
Namespace: DevCase.ThirdParty.WTelegramClientAssembly: DevCase.net48.ThirdParty.WTelegramClient (in DevCase.net48.ThirdParty.WTelegramClient.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Task<ReadOnlyCollection<ForumTopic>> GetChannelTopicsByTitleAsync(
Client client,
Channel channel,
string topicTitle,
StringComparison stringComparison = StringComparison.Ordinal
)
Public Shared Function GetChannelTopicsByTitleAsync (
client As Client,
channel As Channel,
topicTitle As String,
Optional stringComparison As StringComparison = StringComparison.Ordinal
) As Task(Of ReadOnlyCollection(Of ForumTopic))
Dim client As Client
Dim channel As Channel
Dim topicTitle As String
Dim stringComparison As StringComparison
Dim returnValue As Task(Of ReadOnlyCollection(Of ForumTopic))
returnValue = WTelegramClientHelper.GetChannelTopicsByTitleAsync(client,
channel, topicTitle, stringComparison)
public:
static Task<ReadOnlyCollection<ForumTopic^>^>^ GetChannelTopicsByTitleAsync(
Client^ client,
Channel^ channel,
String^ topicTitle,
StringComparison stringComparison = StringComparison::Ordinal
)
static member GetChannelTopicsByTitleAsync :
client : Client *
channel : Channel *
topicTitle : string *
?stringComparison : StringComparison
(* Defaults:
let _stringComparison = defaultArg stringComparison StringComparison.Ordinal
*)
-> Task<ReadOnlyCollection<ForumTopic>>
No code example is currently available or this language may not be supported.
- client Client
-
The source Client object.
- channel Channel
-
The channel where to search for topics.
It must be a group (See: IsGroup).
- topicTitle String
-
The title of the topic to search for in the provided channel.
- stringComparison StringComparison (Optional)
-
Optional. The type of string comparison to be used for topicTitle.
Default value is: Ordinal
TaskReadOnlyCollectionForumTopic
An asynchronous operation that yields a
ReadOnlyCollectionT
containing the matching topics. Or null if the channel does not have any topics created
or a topic with the specified name is nto found.
This is a code example.
No code example is currently available or this language may not be supported.
Private Async Sub Test()
Dim clientConfig As New TelegramClientConfig With {
.ApiId = "###",
.ApiHash = "###",
.FirstName = "###",
.LastName = "###",
.Password = "###",
.PhoneNumber = "+34###",
.VerificationCode = "###"
}
Dim client As WTelegram.Client = CreateClient(clientConfig)
Dim myUser As TL.User = Await client.LoginUserIfNeeded()
Dim myUserId As Long = DirectCast(myUser, UserBase).ID
Debug.WriteLine($"We are logged-in as user: {myUser.MainUsername}, id: {myUserId}")
Dim groupTitle As String = "Group Title"
Dim group As TL.Channel =
(Await GetChannelsByTitleAsync(client, groupTitle)
).Single()
Dim topicTitle As String = "Topic Title"
Dim topic As TL.ForumTopic =
(Await GetChannelTopicsByTitleAsync(client, group, topicTitle, StringComparison.OrdinalIgnoreCase)
).Single()
Dim sb As New StringBuilder()
sb.AppendLine($"Topic Title: {topic.title}")
sb.AppendLine($"Topic Id...: {DirectCast(topic, TL.ForumTopicBase).ID}")
Debug.WriteLine(sb.ToString())
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.