Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

How do I create a new Channel? #1037

Open
nmanjuonline opened this issue Jul 23, 2021 · 4 comments
Open

How do I create a new Channel? #1037

nmanjuonline opened this issue Jul 23, 2021 · 4 comments

Comments

@nmanjuonline
Copy link

Hi,
Could you please let me know if there is a way or if i can create a channel.

@cemahseri
Copy link

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();

@nmanjuonline
Copy link
Author

nmanjuonline commented Jul 28, 2021

Thank you so much this worked! Can i also set photo/image to this wen i create a channel?

@nmanjuonline
Copy link
Author

nmanjuonline commented Jul 28, 2021 via email

@cemahseri
Copy link

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 TLRequestEditChatPhoto class but I don't know if it's the right class for you and how should you use it. Take a look at here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants