Code Monkey home page Code Monkey logo

golang-vk-api's People

Contributors

0x7b-dev avatar bssth avatar crossworth avatar encritary avatar epicstep avatar ezavalishin avatar himidori avatar i1i1 avatar iliayar avatar lexfrei avatar manfredmann avatar ninestems avatar seilem avatar ulnsig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golang-vk-api's Issues

открыть makeRequest

Добрый день!
Нужна возможность самому делать запросы в частности

photos.getOwnerCoverPhotoUploadServer

Null Pointer Deference on calling NewVKClientWithToken with nil TokenOptions.

Error:

$ go run vk-crawler                                                                                                                                                                                                                    
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x15e1f45]

goroutine 1 [running]:
github.com/himidori/golang-vk-api.NewVKClientWithToken(0xc000030070, 0x47, 0x0, 0x47, 0x0, 0xc000010728)
	/Users/carter/go/pkg/mod/github.com/himidori/[email protected]/client.go:76 +0x105
main.init()
	/Users/carter/go/src/vk-crawler/main.go:138 +0x578
exit status 2

When using the example for initialization with a token, a null pointer deference is raised (due to parsing nil to the TokenOptions parameter, which is later dereferenced in client.go before checking if TokenOptions is nil.

Example from Readme.md:

client, err := vkapi.NewVKClientWithToken("token", nil)

Error cause:

func NewVKClientWithToken(token string, options *TokenOptions) (*VKClient, error) {
	vkclient := newVKClientBlank()
	vkclient.Self.AccessToken = token
	vkclient.Self.Lang = options.TokenLanguage // when options is nil, this is illegal

	if options != nil {
		if options.ValidateOnStart {
			uid, err := vkclient.requestSelfID()
			if err != nil {
				return nil, err
			}
			vkclient.Self.UID = uid

			if !options.ServiceToken {
				if err := vkclient.updateSelfUser(); err != nil {
					return nil, err
				}
			}
		}
	}

	return vkclient, nil
}

Hope this help 👍

Cheers

2х факторная аутентификация

Приветствую, как можно обойти 2х факторную аутентификацию?
Где-то нужно писать обработчик (callback функцию) или что?

Проблема с сервисным API ключом

При использовании сервисного токена ваша библиотека падает с ошибкой:

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/himidori/golang-vk-api.(*VKClient).isTokenValid(0xc0000e82c0, 0x6db5d2, 0x47, 0x0, 0x0)
	/home/nomadic/go/src/github.com/himidori/golang-vk-api/client.go:116 +0x84a
github.com/himidori/golang-vk-api.NewVKClientWithToken(0x6db5d2, 0x47, 0xd0, 0x6a1a60, 0xc000080c01)
	/home/nomadic/go/src/github.com/himidori/golang-vk-api/client.go:73 +0x86

Почему-то ВК для сервисного ключа при вызове https://api.vk.com/method/users.get возвращает пустой массив [] и вылетает ошибка при попытке получить данные пользователя в https://github.com/himidori/golang-vk-api/blob/master/client.go#L116
Можно это как-то обойти?

Как-то так например

	if len(user) > 0 {
		client.Self.UID = user[0].UID
		client.Self.FirstName = user[0].FirstName
		client.Self.LastName = user[0].LastName
		client.Self.PicSmall = user[0].Photo
		client.Self.PicMedium = user[0].PhotoMedium
		client.Self.PicBig = user[0].PhotoBig
	}

Ошибка в message.go

`type StickerAttachment struct {

ID        int    `json:"id"`
ProductID int    `json:"product_id"`
Photo64   string `json:"photo_64"`
Photo128  string `json:"photo_128"`
Photo256  string `json:'photo_256"`
Photo352  string `json:"photo_352"`
Photo512  string `json:"photo_512"`
Width     int    `json:"width"`
Height    int    `json:"height"`

}вот здесь вместо двойной кавычки одинарная Photo256 stringjson:'photo_256"`

Как использовать порт?

Написал вк бота с этой либой, запушил в хероку, но он требует забиндить порт (Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch). Может кто помочь?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.