Add /join command
This commit is contained in:
parent
b9c07b6f16
commit
c5996f304c
|
@ -356,6 +356,18 @@ func (c *Client) ProcessChatCommand(chatID int64, cmdline string) (string, bool)
|
||||||
gateway.SPFrom(strconv.FormatInt(chat.Id, 10)),
|
gateway.SPFrom(strconv.FormatInt(chat.Id, 10)),
|
||||||
gateway.SPType("subscribe"),
|
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":
|
case "help":
|
||||||
return helpString(helpTypeChat), true
|
return helpString(helpTypeChat), true
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue