python-telegram-bot/ptbcontrib

[Feature] create chat link for private groups/channels

Poolitzer opened this issue · 3 comments

This feature should introduce a give_me_a_link_to_the_chat_no_matter_what(chat: Chat) -> str function. This means, it should check if a username exists and then return it like chat.link does. If the chat doesnt have a username and is a group/channel, check if the bot is an admin with add member rights (I think this is required), then check if get_chat returns a link. If not, export a new one. Then return the invite link. And definitely document that calling this might result in three API calls

Because this just came up in the off-topic group: A PR may want to allow including the functionality of https://core.telegram.org/bots/api#createchatinvitelink in this.

Is it okay to rely on chat.bot being available?

Yes