diff options
Diffstat (limited to 'telegram')
-rw-r--r-- | telegram/commands.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/telegram/commands.go b/telegram/commands.go index 91bc9d5..2602609 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -356,6 +356,18 @@ func (c *Client) ProcessChatCommand(chatID int64, cmdline string) (string, bool) gateway.SPFrom(strconv.FormatInt(chat.Id, 10)), gateway.SPType("subscribe"), ) + // join https://t.me/publichat + case "join": + if len(args) < 1 { + return notEnoughArguments, true + } + + _, err := c.client.JoinChatByInviteLink(&client.JoinChatByInviteLinkRequest{ + InviteLink: args[0], + }) + if err != nil { + return err.Error(), true + } case "help": return helpString(helpTypeChat), true default: |