Skip to content

Check if a user is member of channel #145

@abhi3700

Description

@abhi3700

Hi guys!,
How to achieve this?

  • I have added a bot as an admin to a public channel.
  • I have tried this:
@bot.command("channelstatus")
def channelstatus_command(chat, message, args):
    """shows the channel status of a user - joined or not"""
    status = chat.status_of(message.sender.username)
    chat.send("*%s*" % status)

It is showing this error:

File "app/bot.py", line 491, in channelstatus_command
    status = chat.status_of(message.sender.username)
  File "/app/.heroku/python/lib/python3.6/site-packages/botogram/objects/chats.py", line 213, in status_of
    raise TypeError("Not available in private chats or channels")
TypeError: Not available in private chats or channels

Can anyone please help me with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions