luckydonald / pytg

Python package that wraps around Telegram messenger CLI. Send and receive messages, and more.
MIT License
369 stars 76 forks source link

Channel joining issue #96

Open bebehack3r opened 7 years ago

bebehack3r commented 7 years ago

The problem

How can I join channels by channel name? like, sender.channel_join(@foochannel). But it's not working... What should I do? P.S. let us think, that @foochannel is the real one with more than 200 members (so it is not possible to invite me from creator or admin).

Your environment

python 2.7.5, last pytg, ubuntu 14.04

Steps to reproduce

Detailed steps to reproduce the issue.

tg = Telegram(
    telegram="tg/bin/telegram-cli",
    pubkey_file="tg/tg-server.pub")
sender = tg.sender
receiver = tg.receiver

def join(ch_name):
    sender.channel_join(ch_name)

Expected behavior

% username % joined channel

Actual behaviour

FailException: Error 38: u'can not parse arg #1' (command u'[disable_preview] channel_join @foochannel\n')

luckydonald commented 7 years ago

I think that is #95, too

Shatnerz commented 7 years ago

Can someone throw together some examples of channel_join (or just post them here. I can make a pull request after we get a few examples)?

I find I can join channels by name if I was previously in the channel already. I'm still not sure about joining channel links. I need to play around with the tg-cli more.