aboutsummaryrefslogtreecommitdiff
path: root/chats.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-11-20 15:14:54 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-11-20 15:14:54 +0300
commit7a749a3d0c87ddb9d8109c5cbca7d7efcb3991eb (patch)
tree4c00b77dcb08920733035fcb1fdf16497b60ff83 /chats.go
parentb551e8bcc63900eee1052499b00e9eb2fce71d77 (diff)
Fix descriptionv0.3.3
Fix int64 ids
Diffstat (limited to 'chats.go')
-rw-r--r--chats.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/chats.go b/chats.go
index 414b4f4..e905a95 100644
--- a/chats.go
+++ b/chats.go
@@ -20,7 +20,7 @@ func newChats(client *client) *chats {
}
//GetChats returns information about chats that bot participated in: a result list and marker points to the next page
-func (a *chats) GetChats(count, marker int) (*schemes.ChatList, error) {
+func (a *chats) GetChats(count, marker int64) (*schemes.ChatList, error) {
result := new(schemes.ChatList)
values := url.Values{}
if count > 0 {
@@ -42,7 +42,7 @@ func (a *chats) GetChats(count, marker int) (*schemes.ChatList, error) {
}
//GetChat returns info about chat
-func (a *chats) GetChat(chatID int) (*schemes.Chat, error) {
+func (a *chats) GetChat(chatID int64) (*schemes.Chat, error) {
result := new(schemes.Chat)
values := url.Values{}
body, err := a.client.request(http.MethodGet, fmt.Sprintf("chats/%d", chatID), values, nil)
@@ -58,7 +58,7 @@ func (a *chats) GetChat(chatID int) (*schemes.Chat, error) {
}
//GetChatMembership returns chat membership info for current bot
-func (a *chats) GetChatMembership(chatID int) (*schemes.ChatMember, error) {
+func (a *chats) GetChatMembership(chatID int64) (*schemes.ChatMember, error) {
result := new(schemes.ChatMember)
values := url.Values{}
body, err := a.client.request(http.MethodGet, fmt.Sprintf("chats/%d/members/me", chatID), values, nil)
@@ -74,7 +74,7 @@ func (a *chats) GetChatMembership(chatID int) (*schemes.ChatMember, error) {
}
//GetChatMembers returns users participated in chat
-func (a *chats) GetChatMembers(chatID, count, marker int) (*schemes.ChatMembersList, error) {
+func (a *chats) GetChatMembers(chatID, count, marker int64) (*schemes.ChatMembersList, error) {
result := new(schemes.ChatMembersList)
values := url.Values{}
if count > 0 {
@@ -96,7 +96,7 @@ func (a *chats) GetChatMembers(chatID, count, marker int) (*schemes.ChatMembersL
}
//LeaveChat removes bot from chat members
-func (a *chats) LeaveChat(chatID int) (*schemes.SimpleQueryResult, error) {
+func (a *chats) LeaveChat(chatID int64) (*schemes.SimpleQueryResult, error) {
result := new(schemes.SimpleQueryResult)
values := url.Values{}
body, err := a.client.request(http.MethodDelete, fmt.Sprintf("chats/%d/members/me", chatID), values, nil)
@@ -112,7 +112,7 @@ func (a *chats) LeaveChat(chatID int) (*schemes.SimpleQueryResult, error) {
}
//EditChat edits chat info: title, icon, etc…
-func (a *chats) EditChat(chatID int, update *schemes.ChatPatch) (*schemes.Chat, error) {
+func (a *chats) EditChat(chatID int64, update *schemes.ChatPatch) (*schemes.Chat, error) {
result := new(schemes.Chat)
values := url.Values{}
body, err := a.client.request(http.MethodPatch, fmt.Sprintf("chats/%d", chatID), values, update)
@@ -128,7 +128,7 @@ func (a *chats) EditChat(chatID int, update *schemes.ChatPatch) (*schemes.Chat,
}
//AddMember adds members to chat. Additional permissions may require.
-func (a *chats) AddMember(chatID int, users schemes.UserIdsList) (*schemes.SimpleQueryResult, error) {
+func (a *chats) AddMember(chatID int64, users schemes.UserIdsList) (*schemes.SimpleQueryResult, error) {
result := new(schemes.SimpleQueryResult)
values := url.Values{}
body, err := a.client.request(http.MethodPost, fmt.Sprintf("chats/%d/members", chatID), values, users)
@@ -144,7 +144,7 @@ func (a *chats) AddMember(chatID int, users schemes.UserIdsList) (*schemes.Simpl
}
//RemoveMember removes member from chat. Additional permissions may require.
-func (a *chats) RemoveMember(chatID int, userID int) (*schemes.SimpleQueryResult, error) {
+func (a *chats) RemoveMember(chatID int64, userID int64) (*schemes.SimpleQueryResult, error) {
result := new(schemes.SimpleQueryResult)
values := url.Values{}
values.Set("user_id", strconv.Itoa(int(userID)))
@@ -161,7 +161,7 @@ func (a *chats) RemoveMember(chatID int, userID int) (*schemes.SimpleQueryResult
}
//SendAction send bot action to chat
-func (a *chats) SendAction(chatID int, action schemes.SenderAction) (*schemes.SimpleQueryResult, error) {
+func (a *chats) SendAction(chatID int64, action schemes.SenderAction) (*schemes.SimpleQueryResult, error) {
result := new(schemes.SimpleQueryResult)
values := url.Values{}
body, err := a.client.request(http.MethodPost, fmt.Sprintf("chats/%d/actions", chatID), values, schemes.ActionRequestBody{Action: action})