Skip to content

Commit

Permalink
Merge pull request #49 from yvasyliev/dev
Browse files Browse the repository at this point in the history
Fixed WallCreateComment
  • Loading branch information
yvasyliev authored Apr 23, 2021
2 parents 18d5dd1 + fff3fba commit 204018a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This library uses the next third-party dependencies:
<dependency>
<groupId>com.github.yvasyliev</groupId>
<artifactId>java-vk-bots-longpoll-api</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
```
4. Extend `LongPollBot` class and override necessary methods:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.yvasyliev</groupId>
<artifactId>java-vk-bots-longpoll-api</artifactId>
<packaging>jar</packaging>
<version>1.4.1</version>
<version>1.4.2</version>

<name>Java VK Bots Long Poll API</name>
<description>A Java library to create VK bots using Bots Long Poll API</description>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/api/longpoll/bots/methods/GetMethod.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package api.longpoll.bots.methods;

import api.longpoll.bots.LongPollBot;
import org.jsoup.Connection;

import java.util.List;
Expand All @@ -13,12 +12,11 @@
public abstract class GetMethod<Response> extends Method<Response> {
private static final String ACCESS_TOKEN = "access_token";
private static final String VERSION = "v";
protected String accessToken;

/**
* Long Poll bot.
* Access token
*/
protected LongPollBot bot;
protected String accessToken;

public GetMethod(String accessToken) {
this.accessToken = accessToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ protected JsonToPojoConverter<GenericResult<WallCreateCommentResponse>> getConve

@Override
protected Stream<Connection.KeyVal> getKeyValStream() {
return null;
return Stream.of(
keyVal("owner_id", ownerId),
keyVal("post_id", postId),
keyVal("from_group", fromGroupId),
keyVal("message", message),
keyVal("reply_to_comment", replyToComment),
keyVal("attachments", attachments),
keyVal("sticker_id", stickerId),
keyVal("guid", guid)
);
}

private WallCreateComment attach(String attachment) {
Expand Down

0 comments on commit 204018a

Please sign in to comment.