WTelegramClientHelperGetChannelTopicsAsync Method
Asynchronously retrieves a collection of ForumTopic
objects containing the topics from the 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>> GetChannelTopicsAsync(
Client client,
Channel channel
)
Public Shared Function GetChannelTopicsAsync (
client As Client,
channel As Channel
) As Task(Of ReadOnlyCollection(Of ForumTopic))
Dim client As Client
Dim channel As Channel
Dim returnValue As Task(Of ReadOnlyCollection(Of ForumTopic))
returnValue = WTelegramClientHelper.GetChannelTopicsAsync(client,
channel)
public:
static Task<ReadOnlyCollection<ForumTopic^>^>^ GetChannelTopicsAsync(
Client^ client,
Channel^ channel
)
static member GetChannelTopicsAsync :
client : Client *
channel : Channel -> 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 from which to retrieve topics. It must be a group (See: IsGroup.
TaskReadOnlyCollectionForumTopic
An asynchronous operation that yields a
ReadOnlyCollectionT
containing the topics from the group. Or null if the channel does not have any topics created.
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 topics As ReadOnlyCollection(Of TL.ForumTopic) =
Await WTelegramClientHelper.GetChannelTopicsAsync(client, group)
For Each topic As TL.ForumTopic In topics
Dim sb As New StringBuilder()
sb.AppendLine($"Topic Title: {topic.title}")
sb.AppendLine($"Topic Id...: {DirectCast(topic, TL.ForumTopicBase).ID}")
Debug.WriteLine(sb.ToString())
Next
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.