This tiny script helps you send audio message to person at VK.
Attention! Your application have to have direct authorization ability!
You should set up this Auth
fields in call:
ClientID
— your application has client IDClientSecret
— your application has client secret key; you have to have direct authorization ability!Username
— your username: phone or emailPassword
— your password in plain text 🤷♂️Filename
— your.ogg
filename (you should use mono,16KHz,16Kb/s audio) without pathRecipient
— recipient user ID
You can set up this Setup
fields in call:
SaveOauth
— should the application save VK token to fileOauthFile
— custom filename for token; otherwise file has namevk-token
(seedefaultOauthFile
)
This script was tested on Go 1.14. You have to use application with enabled direct authorizaion.
Example (w/o token saving)
package main
import sender "github.com/dimon4ezzz/vk-audiomessage-sender"
func main() {
auth := sender.Auth{
ClientID: 111222,
ClientSecret: "Z6jB1ka2uinYsHhHbZxr",
Username: "personal@mail.com",
Password: "dolphins42",
Filename: "audiomessage.ogg",
Recipient: 11235813
}
sender.Send(auth, Setup{})
}
If needed (2fa activated): wait for 2fa code prompt and type this code.
At the end of this script you will see link to your message at full VK Web version.
Token is saved with AES, encrypted with your password.