aboutsummaryrefslogtreecommitdiff
path: root/telegram/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/commands.go')
-rw-r--r--telegram/commands.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/telegram/commands.go b/telegram/commands.go
index f71040d..74406f5 100644
--- a/telegram/commands.go
+++ b/telegram/commands.go
@@ -395,6 +395,34 @@ func (c *Client) ProcessChatCommand(chatID int64, cmdline string) (string, bool)
if err != nil {
return err.Error(), true
}
+ // create new secret chat with current user
+ case "secret":
+ _, user, err := c.GetContactByID(chatID, nil)
+ if err != nil || user == nil {
+ return "User not found", true
+ }
+
+ _, err = c.client.CreateNewSecretChat(&client.CreateNewSecretChatRequest{
+ UserId: int32(chatID),
+ })
+ if err != nil {
+ return err.Error(), true
+ }
+ // create group chat with current user
+ case "group":
+ if len(args) < 1 {
+ return notEnoughArguments, true
+ }
+
+ if chatID > 0 {
+ _, err := c.client.CreateNewBasicGroupChat(&client.CreateNewBasicGroupChatRequest{
+ UserIds: []int32{int32(chatID)},
+ Title: args[0],
+ })
+ if err != nil {
+ return err.Error(), true
+ }
+ }
case "help":
return helpString(helpTypeChat), true
default: