Skip to content

Commit

Permalink
chore: refactor module
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannm committed Feb 11, 2024
1 parent 2a471d0 commit 80c8ff7
Show file tree
Hide file tree
Showing 1,059 changed files with 62,136 additions and 213,234 deletions.
1,212 changes: 606 additions & 606 deletions cmd/cli-river/commands.go

Large diffs are not rendered by default.

278 changes: 139 additions & 139 deletions cmd/cli-river/commands_account.go
Original file line number Diff line number Diff line change
@@ -1,177 +1,177 @@
package main

import (
"git.ronaksoft.com/river/msg/go/msg"
"gopkg.in/abiosoft/ishell.v2"
"github.com/ronaksoft/river-msg/go/msg"
"gopkg.in/abiosoft/ishell.v2"
)

var Account = &ishell.Cmd{
Name: "Account",
Name: "Account",
}

var AccountRegisterDevice = &ishell.Cmd{
Name: "RegisterDevice",
Func: func(c *ishell.Context) {
req := msg.AccountRegisterDevice{}
req.TokenType = fnGetTokenType(c)
req.Token = fnGetToken(c)
req.DeviceModel = fnGetDeviceModel(c)
req.SystemVersion = fnGetSysytemVersion(c)
req.AppVersion = fnGetAppVersion(c)
req.LangCode = fnGetLangCode(c)
req.ClientID = fnGetClientID(c)

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountRegisterDevice, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "RegisterDevice",
Func: func(c *ishell.Context) {
req := msg.AccountRegisterDevice{}
req.TokenType = fnGetTokenType(c)
req.Token = fnGetToken(c)
req.DeviceModel = fnGetDeviceModel(c)
req.SystemVersion = fnGetSysytemVersion(c)
req.AppVersion = fnGetAppVersion(c)
req.LangCode = fnGetLangCode(c)
req.ClientID = fnGetClientID(c)

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountRegisterDevice, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountUpdateUsername = &ishell.Cmd{
Name: "UpdateUsername",
Func: func(c *ishell.Context) {
req := msg.AccountUpdateUsername{}
req.Username = fnGetUsername(c)

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountUpdateUsername, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "UpdateUsername",
Func: func(c *ishell.Context) {
req := msg.AccountUpdateUsername{}
req.Username = fnGetUsername(c)

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountUpdateUsername, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountCheckUsername = &ishell.Cmd{
Name: "CheckUsername",
Func: func(c *ishell.Context) {
req := msg.AccountCheckUsername{}
req.Username = fnGetUsername(c)

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountCheckUsername, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "CheckUsername",
Func: func(c *ishell.Context) {
req := msg.AccountCheckUsername{}
req.Username = fnGetUsername(c)

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountCheckUsername, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountUnregisterDevice = &ishell.Cmd{
Name: "UnregisterDevice",
Func: func(c *ishell.Context) {
req := msg.AccountUnregisterDevice{}
req.TokenType = 1
req.Token = "token"

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountUnregisterDevice, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "UnregisterDevice",
Func: func(c *ishell.Context) {
req := msg.AccountUnregisterDevice{}
req.TokenType = 1
req.Token = "token"

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountUnregisterDevice, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountUpdateProfile = &ishell.Cmd{
Name: "UpdateProfile",
Func: func(c *ishell.Context) {
req := msg.AccountUpdateProfile{}
req.FirstName = fnGetFirstName(c)
req.LastName = fnGetLastName(c)
reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)
if reqID, err := _SDK.ExecuteCommand(msg.C_AccountUpdateProfile, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "UpdateProfile",
Func: func(c *ishell.Context) {
req := msg.AccountUpdateProfile{}
req.FirstName = fnGetFirstName(c)
req.LastName = fnGetLastName(c)
reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)
if reqID, err := _SDK.ExecuteCommand(msg.C_AccountUpdateProfile, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountSetNotifySettings = &ishell.Cmd{
Name: "SetNotifySettings",
Func: func(c *ishell.Context) {
req := msg.AccountSetNotifySettings{
Peer: new(msg.InputPeer),
Settings: new(msg.PeerNotifySettings),
}
req.Peer.ID = fnGetPeerID(c)
req.Peer.Type = 1
req.Peer.AccessHash = fnGetAccessHash(c)
req.Settings.Flags = 113
req.Settings.MuteUntil = 0
req.Settings.Sound = ""

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountSetNotifySettings, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "SetNotifySettings",
Func: func(c *ishell.Context) {
req := msg.AccountSetNotifySettings{
Peer: new(msg.InputPeer),
Settings: new(msg.PeerNotifySettings),
}
req.Peer.ID = fnGetPeerID(c)
req.Peer.Type = 1
req.Peer.AccessHash = fnGetAccessHash(c)
req.Settings.Flags = 113
req.Settings.MuteUntil = 0
req.Settings.Sound = ""

reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountSetNotifySettings, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountUploadPhoto = &ishell.Cmd{
Name: "UploadPhoto",
Func: func(c *ishell.Context) {
filePath := fnGetFilePath(c)
_SDK.AccountUploadPhoto(filePath)
Name: "UploadPhoto",
Func: func(c *ishell.Context) {
filePath := fnGetFilePath(c)
_SDK.AccountUploadPhoto(filePath)

},
},
}

var AccountRemovePhoto = &ishell.Cmd{
Name: "RemovePhoto",
Func: func(c *ishell.Context) {
req := msg.AccountRemovePhoto{}
reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountRemovePhoto, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "RemovePhoto",
Func: func(c *ishell.Context) {
req := msg.AccountRemovePhoto{}
reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountRemovePhoto, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

var AccountGetTeams = &ishell.Cmd{
Name: "GetTeams",
Func: func(c *ishell.Context) {
req := msg.AccountGetTeams{}
reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountGetTeams, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
Name: "GetTeams",
Func: func(c *ishell.Context) {
req := msg.AccountGetTeams{}
reqBytes, _ := req.Marshal()
reqDelegate := new(RequestDelegate)

if reqID, err := _SDK.ExecuteCommand(msg.C_AccountGetTeams, reqBytes, reqDelegate); err != nil {
c.Println("Command Failed:", err)
} else {
reqDelegate.RequestID = reqID
}
},
}

func init() {
Account.AddCmd(AccountRegisterDevice)
Account.AddCmd(AccountUpdateUsername)
Account.AddCmd(AccountCheckUsername)
Account.AddCmd(AccountUnregisterDevice)
Account.AddCmd(AccountUpdateProfile)
Account.AddCmd(AccountSetNotifySettings)
Account.AddCmd(AccountUploadPhoto)
Account.AddCmd(AccountRemovePhoto)
Account.AddCmd(AccountGetTeams)
Account.AddCmd(AccountRegisterDevice)
Account.AddCmd(AccountUpdateUsername)
Account.AddCmd(AccountCheckUsername)
Account.AddCmd(AccountUnregisterDevice)
Account.AddCmd(AccountUpdateProfile)
Account.AddCmd(AccountSetNotifySettings)
Account.AddCmd(AccountUploadPhoto)
Account.AddCmd(AccountRemovePhoto)
Account.AddCmd(AccountGetTeams)
}
Loading

0 comments on commit 80c8ff7

Please sign in to comment.