Skip to content

Commit

Permalink
Merge pull request #13 from Ferius057/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ferius057 authored Nov 12, 2023
2 parents 050cec7 + a75b078 commit 4319512
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">VK-MailingGroup</h1>
<p align="center">
<a href="https://github.com/Ferius057/VK-MailingGroup/releases/tag/1.4.0">
<a href="https://github.com/Ferius057/VK-MailingGroup/releases/tag/1.4.1">
<img src="https://img.shields.io/github/v/release/Ferius057/VK-MailingGroup?style=flat-square">
</a>
<a href="https://opensource.org/licenses/MIT">
Expand All @@ -13,7 +13,7 @@
<img src="https://img.shields.io/badge/License-MIT-yellow.svg">
</a>
<p align="center">
<a href="https://github.com/Ferius057/VK-MailingGroup/releases/download/1.4.0/MailingGroup.jar">
<a href="https://github.com/Ferius057/VK-MailingGroup/releases/download/1.4.1/MailingGroup.jar">
<img src="https://img.shields.io/github/downloads/Ferius057/VK-MailingGroup/total?color=6ff00">
<a href="https://www.donationalerts.com/r/ferius_057">
<img src="https://img.shields.io/badge/Donate-DonationAlerts-orange.svg">
Expand All @@ -39,13 +39,13 @@
<hr>

## Использование:
<a href="https://github.com/Ferius057/VK-MailingGroup/releases/download/1.4.0/MailingGroup.jar">
<a href="https://github.com/Ferius057/VK-MailingGroup/releases/download/1.4.1/MailingGroup.jar">
<img src="https://img.shields.io/github/downloads/Ferius057/VK-MailingGroup/total?color=6ff00">
</a>

```bash
# Скачать на Linux
$ wget https://github.com/Ferius057/VK-MailingGroup/releases/download/1.4.0/MailingGroup.jar
$ wget https://github.com/Ferius057/VK-MailingGroup/releases/download/1.4.1/MailingGroup.jar


# Для запуска скрипта
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>kz.ferius_057</groupId>
<artifactId>MailingGroup</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kz/ferius_057/mailingGroup/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @date ⭐ 10.09.2022 | 2:57 ⭐
*/
public class Main {
static final Logger LOGGER = LogManager.getLogger(Config.class);
static final Logger LOGGER = LogManager.getLogger(Main.class);
static final String CURRENT_VERSION = getCurrentVersion();

static {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/kz/ferius_057/mailingGroup/data/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public static Config load(final Path path) {
return new Config(
config.getString("token"),
config.getString("message")
.replace("\n", "<br>"),
.replace("\n", "<br>")
.replace("\"", "&#8221;"),
config.getConfigurationSection("attachments")
.getValues(true)
.entrySet().stream()
Expand Down
18 changes: 12 additions & 6 deletions src/main/java/kz/ferius_057/mailingGroup/vk/Mailing.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,17 @@ private void send(final List<Integer> users, final AtomicInteger numberQuery, fi
.exceptionally(throwable -> {
try {
// TODO: 05.11.2022 | проверять ошибки
LOGGER.error("Прошу вас отписать мне в вк - vk.com/ferius_057 или тг - t.me/ferius_057");
LOGGER.error("Не удалось выполнить метод execute: {}", throwable.getCause().getMessage());
JsonObject jsonObject = new Gson().fromJson(throwable.getCause().getMessage(), JsonObject.class);
System.out.println(jsonObject);
System.out.println(jsonObject.get("error").getAsJsonObject().get("error_code").getAsInt());
val errorMessage = throwable.getMessage();
val sb = new StringBuilder("\n");
sb.append("Прошу вас отписать мне в вк - vk.com/ferius_057 или тг - t.me/ferius_057");
sb.append("\n").append("Не удалось выполнить метод execute: ").append(errorMessage);

val jsonObject = new Gson().fromJson(errorMessage, JsonObject.class);
sb.append("\n").append(jsonObject);
sb.append("\n").append(jsonObject.get("error").getAsJsonObject().get("error_code").getAsInt());
sb.append("\n").append(jsonObject.get("error").getAsJsonObject().get("error_msg").getAsString()).append("\n");

LOGGER.error(sb.toString());
} catch (Exception e) {
e.printStackTrace();
}
Expand All @@ -163,7 +169,7 @@ private void send(final List<Integer> users, final AtomicInteger numberQuery, fi
totalMemory / 1048576, freeMemory / 1048576,
(totalMemory - freeMemory) / 1048576);

isLastQuery(numberQuery.get()); // если последний запрос то завершение
isLastQuery(numberQuery.get()); // если последний запрос, то завершение
}
});
}
Expand Down

0 comments on commit 4319512

Please sign in to comment.