add debug
This commit is contained in:
parent
88db4dcf8d
commit
22268986e3
17
main.go
17
main.go
@ -78,7 +78,7 @@ func main() {
|
||||
fmt.Scanln(&number)
|
||||
_, err := client.SendPhoneNumber(number)
|
||||
if err != nil {
|
||||
fmt.Printf("Error sending phone number: %v", err)
|
||||
fmt.Printf("Error sending phone number: %v\n", err)
|
||||
}
|
||||
} else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateWaitCodeType {
|
||||
fmt.Print("Enter code: ")
|
||||
@ -86,7 +86,7 @@ func main() {
|
||||
fmt.Scanln(&code)
|
||||
_, err := client.SendAuthCode(code)
|
||||
if err != nil {
|
||||
fmt.Printf("Error sending auth code : %v", err)
|
||||
fmt.Printf("Error sending auth code : %v\n", err)
|
||||
}
|
||||
} else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateWaitPasswordType {
|
||||
fmt.Print("Enter Password: ")
|
||||
@ -94,7 +94,7 @@ func main() {
|
||||
fmt.Scanln(&password)
|
||||
_, err := client.SendAuthPassword(password)
|
||||
if err != nil {
|
||||
fmt.Printf("Error sending auth password: %v", err)
|
||||
fmt.Printf("Error sending auth password: %v\n", err)
|
||||
}
|
||||
} else if currentState.GetAuthorizationStateEnum() == tdlib.AuthorizationStateReadyType {
|
||||
fmt.Println("Authorization Ready! Let's rock")
|
||||
@ -271,9 +271,9 @@ func ListenCW(c *tdlib.Client) {
|
||||
msgDelete = true
|
||||
case "/g_withdraw":
|
||||
time.Sleep(1 * time.Second)
|
||||
fmt.Printf("WITHDRAW VALIDATED : msg_id : %d", updateMsg.Message.ID)
|
||||
fmt.Printf("WITHDRAW VALIDATED : chat_id : %d", updateMsg.Message.ChatID)
|
||||
fmt.Printf("WITHDRAW VALIDATED : user_id : %d", msgUserID64)
|
||||
fmt.Printf("WITHDRAW VALIDATED : msg_id : %d\n", updateMsg.Message.ID)
|
||||
fmt.Printf("WITHDRAW VALIDATED : chat_id : %d\n", updateMsg.Message.ChatID)
|
||||
fmt.Printf("WITHDRAW VALIDATED : user_id : %d\n", msgUserID64)
|
||||
_ = ForwardMsg(c, updateMsg.Message.ID, updateMsg.Message.ChatID, msgUserID64)
|
||||
msgDisplay = false
|
||||
msgDelete = false
|
||||
@ -729,7 +729,10 @@ func ListenAll(c *tdlib.Client) {
|
||||
func ForwardMsg(c *tdlib.Client, msgID int64, fromChatID int64, toChatID int64) int64 {
|
||||
msgIDs := make([]int64, 1)
|
||||
msgIDs[0] = msgID
|
||||
msgs, _ := c.ForwardMessages(toChatID, fromChatID, msgIDs, false, false, false)
|
||||
msgs, err := c.ForwardMessages(toChatID, fromChatID, msgIDs, false, false, false)
|
||||
if err != nil {
|
||||
fmt.Printf("ForwardMsg (error) : %s\n", err)
|
||||
}
|
||||
if msgs != nil {
|
||||
return msgs.Messages[0].ID
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user