Python Telethon check is channel or group

I was looking for some way in order to check if username is group or channel. I try with client.get_entity("group or channel") and nothing helpful Someone have any suggestion? Thank you,

Answer

you can try with this:

bot = client.get_dialogs()
for i in bot:
    if not i.is_group:
        print(i.name) # for channels
    if i.is_group:
        print(i.name) # for groups