From 59994bd5afc3a7193ab319a6de6f7f04c65df8cf Mon Sep 17 00:00:00 2001 From: Arkadiy Date: Thu, 9 Mar 2023 10:42:42 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=B2=D0=B5=D1=82=20=D0=BF=D0=BE?= =?UTF-8?q?=20peerid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/theoni/vkbot/managers/BotManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/theoni/vkbot/managers/BotManager.java b/src/main/java/theoni/vkbot/managers/BotManager.java index d0129f9..f2c3398 100644 --- a/src/main/java/theoni/vkbot/managers/BotManager.java +++ b/src/main/java/theoni/vkbot/managers/BotManager.java @@ -23,7 +23,7 @@ public BotManager(GroupActor actor) { public void sendMessage(String text, Message message, Keyboard keyboard) { try { - vk.messages().send(actor).message(text).userId(message.getFromId()).randomId(random.nextInt(10000)).keyboard(keyboard).execute(); + vk.messages().send(actor).message(text).peerId(message.getPeerId()).randomId(random.nextInt(10000)).keyboard(keyboard).execute(); } catch (ApiException | ClientException e) { e.printStackTrace(); } @@ -31,7 +31,7 @@ public void sendMessage(String text, Message message, Keyboard keyboard) { public void sendMessage(String text, Message message) { try { - vk.messages().send(actor).message(text).userId(message.getFromId()).randomId(random.nextInt(10000)).execute(); + vk.messages().send(actor).message(text).peerId(message.getPeerId()).randomId(random.nextInt(10000)).execute(); } catch (ApiException | ClientException e) { e.printStackTrace(); } @@ -39,7 +39,7 @@ public void sendMessage(String text, Message message) { public void sendMessage(String text, Integer id, Keyboard keyboard) { try { - vk.messages().send(actor).message(text).userId(id).randomId(random.nextInt(10000)).keyboard(keyboard).execute(); + vk.messages().send(actor).message(text).peerId(id).randomId(random.nextInt(10000)).keyboard(keyboard).execute(); } catch (ApiException | ClientException e) { e.printStackTrace(); } @@ -47,7 +47,7 @@ public void sendMessage(String text, Integer id, Keyboard keyboard) { public void sendMessage(String text, Integer id) { try { - vk.messages().send(actor).message(text).userId(id).randomId(random.nextInt(10000)).execute(); + vk.messages().send(actor).message(text).peerId(id).randomId(random.nextInt(10000)).execute(); } catch (ApiException | ClientException e) { e.printStackTrace(); } @@ -64,7 +64,7 @@ public Integer getTs() { } public MessagesGetLongPollHistoryQuery getHistoryQuery(Integer ts) { - MessagesGetLongPollHistoryQuery historyQuery = vk.messages().getLongPollHistory(actor).ts(ts); + MessagesGetLongPollHistoryQuery historyQuery = vk.messages().getLongPollHistory(actor).ts(ts); return historyQuery; }