Skip to content

Commit

Permalink
fix types 64 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nikepan committed Oct 31, 2023
1 parent 24ab520 commit 4343a46
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,21 @@ func (api *VkAPI) CurrentGroup() (*User, error) {
}

// GetChatInfo - returns Chat info by id
func (api *VkAPI) GetUserChatInfo(chatID int) (*ChatInfo, error) {
func (api *VkAPI) GetUserChatInfo(chatID int64) (*ChatInfo, error) {
r := ChatInfoResponse{}
err := api.CallMethod(apiMessagesGetChat, H{
"chat_id": strconv.Itoa(chatID),
"chat_id": strconv.FormatInt(chatID, 10),
"fields": "photo,city,country,sex,bdate",
}, &r)

return &r.Response, err
}

// GetChatInfo - returns Chat info by id
func (api *VkAPI) GetConversation(chatID int) (*ChatInfo, error) {
func (api *VkAPI) GetConversation(chatID int64) (*ChatInfo, error) {
r := ConversationsResponse{}
err := api.CallMethod(apiMessagesGetConversationsById, H{
"peer_ids": strconv.Itoa(chatID),
"peer_ids": strconv.FormatInt(chatID, 10),
"extended": "1",
"fields": "photo,city,country,sex,bdate",
}, &r)
Expand Down Expand Up @@ -210,14 +210,14 @@ func (api *VkAPI) GetConversation(chatID int) (*ChatInfo, error) {
}

// GetChatInfo - returns Chat info by id
func (api *VkAPI) GetChatInfo(chatID int) (*ChatInfo, error) {
func (api *VkAPI) GetChatInfo(chatID int64) (*ChatInfo, error) {
if api.IsGroup() {
return api.GetConversation(chatID)
}
return api.GetUserChatInfo(chatID)
}

func (api *VkAPI) GetChatFullInfo(chatID int) (*ChatInfo, error) {
func (api *VkAPI) GetChatFullInfo(chatID int64) (*ChatInfo, error) {
info, err := api.GetChatInfo(chatID)
if err != nil {
return nil, err
Expand All @@ -233,24 +233,24 @@ func (api *VkAPI) GetChatFullInfo(chatID int) (*ChatInfo, error) {
}

// GetChatUsers - get chat users
func (api *VkAPI) GetUserChatUsers(chatID int) (users []*User, err error) {
func (api *VkAPI) GetUserChatUsers(chatID int64) (users []*User, err error) {

r := UsersResponse{}
err = api.CallMethod(apiMessagesGetChatUsers, H{
"chat_id": strconv.Itoa(chatID),
"chat_id": strconv.FormatInt(chatID, 10),
"fields": "photo,city,country,sex,bdate",
}, &r)

return r.Response, err
}

// GetChatUsers - get chat users
func (api *VkAPI) GetConversationMembers(chatID int) (users []*User, err error) {
func (api *VkAPI) GetConversationMembers(chatID int64) (users []*User, err error) {

r := MembersResponse{}

err = api.CallMethod(apiMessagesGetConversationMembers, H{
"peer_id": strconv.Itoa(chatID),
"peer_id": strconv.FormatInt(chatID, 10),
"fields": "photo,city,country,sex,bdate",
}, &r)

Expand Down Expand Up @@ -280,7 +280,7 @@ func (api *VkAPI) GetConversationMembers(chatID int) (users []*User, err error)
return users, err
}

func (api *VkAPI) GetChatUsers(chatID int) (users []*User, err error) {
func (api *VkAPI) GetChatUsers(chatID int64) (users []*User, err error) {
if api.IsGroup() {
return api.GetConversationMembers(chatID)
}
Expand Down Expand Up @@ -335,11 +335,11 @@ func (api *VkAPI) DeleteFriend(uid int64) bool {
}

// User - get simple user info
func (api *VkAPI) User(uid int) (*User, error) {
func (api *VkAPI) User(uid int64) (*User, error) {

r := UsersResponse{}
err := api.CallMethod(apiUsersGet, H{
"user_ids": strconv.Itoa(uid),
"user_ids": strconv.FormatInt(uid, 10),
"fields": "sex,screen_name, city, country, bdate",
}, &r)

Expand Down

0 comments on commit 4343a46

Please sign in to comment.