This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 378
How do I create a new Channel? #1037
Comments
If you want to just create a new channel and forget; await client.SendRequestAsync<bool>(new TLRequestCreateChannel
{
Title = "Epic Channel!",
About = "This channel is created by TLSharp.",
Broadcast = false,
Megagroup = false
}); If you want to create a new channel and interact with it; var update = await client.SendRequestAsync<TLUpdates>(new TLRequestCreateChannel
{
Title = "Epic Channel!",
About = "This channel is created by TLSharp.",
Broadcast = false,
Megagroup = false
});
var channel = (TLChannel)update.Chats.Last(); |
Thank you so much this worked! Can i also set photo/image to this wen i create a channel? |
Hello,
Thank you so much for your response.
I was looking for a code which I can use to update the Channel profile
picture. Please let me know if there is an option for the same.
Regards,
Manju
…On Wed, Jul 28, 2021 at 1:19 PM Yunus Emre ***@***.***> wrote:
I'm glad I could help you! Yup, you can also send photos to this channel.
You have various of options but this is the easiest one;
await client.ExecuteAsync(new TdApi.SendMessage
{
ChatId = channel.Id,
InputMessageContent = new TdApi.InputMessageContent.InputMessagePhoto
{
Photo = new TdApi.InputFile.InputFileLocal
{
Path = "photo.png" // This is the path to your photo.
}
}
});
If you want to interact with your newly sent photo, you should do it like
this;
var sentMessage = await client.ExecuteAsync(new TdApi.SendMessage
{
ChatId = channel.Id,
InputMessageContent = new TdApi.InputMessageContent.InputMessagePhoto
{
Photo = new TdApi.InputFile.InputFileLocal
{
Path = "photo.png"
}
}
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1037 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFAPIM6L3FJFZLISD27DMCLTZ6Y7HANCNFSM5A4KM4JA>
.
|
Hello there! Well, I've thought you wanted to send a photo to the channel but then I've realised that I've read your message wrong. Sadly I don't have any ideas about that. There is a |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Could you please let me know if there is a way or if i can create a channel.
The text was updated successfully, but these errors were encountered: