diff --git a/telegram/commands.go b/telegram/commands.go index c521190..b8a9c5d 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -44,6 +44,7 @@ var chatCommands = map[string]command{ "block": command{"", "blacklist current user"}, "unblock": command{"", "unblacklist current user"}, "invite": command{"id or @username", "add user to current chat"}, + "link": command{"", "get invite link for current chat"}, "kick": command{"id or @username", "remove user to current chat"}, "ban": command{"id or @username [hours]", "restrict @username from current chat for [hours] or forever"}, "leave": command{"", "leave current chat"}, @@ -536,6 +537,15 @@ func (c *Client) ProcessChatCommand(chatID int64, cmdline string) (string, bool) if err != nil { return err.Error(), true } + // get link to current chat + case "link": + link, err := c.client.CreateChatInviteLink(&client.CreateChatInviteLinkRequest{ + ChatId: chatID, + }) + if err != nil { + return err.Error(), true + } + return link.InviteLink, true // kick @username from current group chat case "kick": if len(args) < 1 {