From 0ec6b55216dd824e710d729714dd1124850f1603 Mon Sep 17 00:00:00 2001 From: Ruben Bermudez Date: Sun, 18 Jun 2017 05:34:13 +0200 Subject: [PATCH] Version 3.0.2 Create new extensions module --- Bots.ipr | 26 ++ README.md | 8 +- TelegramBots.wiki/Changelog.md | 8 +- TelegramBots.wiki/Getting-Started.md | 4 +- TelegramBots.wiki/How-To-Update.md | 5 +- pom.xml | 5 +- telegrambots-extensions/README.md | 27 +++ telegrambots-extensions/pom.xml | 226 ++++++++++++++++++ .../TelegramLongPollingCommandBot.java | 11 +- .../bots/commandbot}/commands/BotCommand.java | 2 +- .../commandbot}/commands/CommandRegistry.java | 2 +- .../commands/ICommandRegistry.java | 2 +- .../timedbot}/TimedSendLongPollingBot.java | 3 +- telegrambots-meta/pom.xml | 2 +- telegrambots/pom.xml | 4 +- 15 files changed, 314 insertions(+), 21 deletions(-) create mode 100644 telegrambots-extensions/README.md create mode 100644 telegrambots-extensions/pom.xml rename {telegrambots/src/main/java/org/telegram/telegrambots/bots => telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot}/TelegramLongPollingCommandBot.java (90%) rename {telegrambots/src/main/java/org/telegram/telegrambots/bots => telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot}/commands/BotCommand.java (97%) rename {telegrambots/src/main/java/org/telegram/telegrambots/bots => telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot}/commands/CommandRegistry.java (98%) rename {telegrambots/src/main/java/org/telegram/telegrambots/bots => telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot}/commands/ICommandRegistry.java (97%) rename {telegrambots/src/main/java/org/telegram/telegrambots/bots => telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/timedbot}/TimedSendLongPollingBot.java (99%) diff --git a/Bots.ipr b/Bots.ipr index 6cbcc842..04178b7e 100644 --- a/Bots.ipr +++ b/Bots.ipr @@ -17,6 +17,7 @@ + @@ -29,11 +30,13 @@ + + @@ -261,6 +264,7 @@ + @@ -834,6 +838,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 91d6639c..bbad1838 100644 --- a/README.md +++ b/README.md @@ -27,16 +27,16 @@ Just import add the library to your project with one of these options: org.telegram telegrambots - 3.0.1 + 3.0.2 ``` ```gradle - compile "org.telegram:telegrambots:3.0.1" + compile "org.telegram:telegrambots:3.0.2" ``` - 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.0.1) - 3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/3.0.1) + 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.0.2) + 3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/3.0.2) In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`. diff --git a/TelegramBots.wiki/Changelog.md b/TelegramBots.wiki/Changelog.md index c7f54bda..6a81f224 100644 --- a/TelegramBots.wiki/Changelog.md +++ b/TelegramBots.wiki/Changelog.md @@ -58,4 +58,10 @@ ### 3.0.1 ### 1. Added `getLevel` to `BotLogger` class. 2. Fix wrong URL when setting webhook -3. Bug Fixing: #244, #233 \ No newline at end of file +3. Bug Fixing: #244, #233 + +### 3.0.2 ### +1. Bug Fixing: #250 +2. Added new module `telegrambots-extensions` that should contains any extensions of the API such as CommandBot or TimedBot. + +**[[How to update to version 3.0.2|How-To-Update#3.0.2]]** diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md index 8e503c51..e60b719b 100644 --- a/TelegramBots.wiki/Getting-Started.md +++ b/TelegramBots.wiki/Getting-Started.md @@ -11,13 +11,13 @@ First you need ot get the library and add it to your project. There are few poss org.telegram telegrambots - 3.0.1 + 3.0.2 ``` * With **Gradle**: ```groovy - compile group: 'org.telegram', name: 'telegrambots', version: '3.0.1' + compile group: 'org.telegram', name: 'telegrambots', version: '3.0.2' ``` 2. Don't like **Maven Central Repository**? It can also be taken from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots). diff --git a/TelegramBots.wiki/How-To-Update.md b/TelegramBots.wiki/How-To-Update.md index ca3d4670..4ebb7fd9 100644 --- a/TelegramBots.wiki/How-To-Update.md +++ b/TelegramBots.wiki/How-To-Update.md @@ -23,4 +23,7 @@ 2. In `editMessageTextAsync`, `editMessageCaptionAsync` or `editMessageReplyMarkupAsync` in `AbsSender`, second parameter should become `SentCallback` due to new return type. ### To version 3.0 ### -1. In `Message` object, field `new_chat_member` was replaced by `new_chat_members` that is now an array of users. \ No newline at end of file +1. In `Message` object, field `new_chat_member` was replaced by `new_chat_members` that is now an array of users. + +### To version 3.0.2 ### +1. If you were using `TelegramLongPollingCommandBot`, add the new [extensions dependency](https://github.com/rubenlagus/TelegramBots/tree/master/telegrambots-extensions) to your maven and fix import statements in your project. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 63fb8465..8f92bf11 100644 --- a/pom.xml +++ b/pom.xml @@ -7,11 +7,12 @@ org.telegram Bots pom - 3.0.1 + 3.0.2 telegrambots telegrambots-meta + telegrambots-extensions @@ -24,6 +25,6 @@ true - 3.0.1 + 3.0.2 \ No newline at end of file diff --git a/telegrambots-extensions/README.md b/telegrambots-extensions/README.md new file mode 100644 index 00000000..a117e067 --- /dev/null +++ b/telegrambots-extensions/README.md @@ -0,0 +1,27 @@ +# Telegram Bot Extensions + +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.telegram/telegrambotsextensions/badge.svg)](http://mvnrepository.com/artifact/org.telegram/telegrambotsextensions) +[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rubenlagus/TelegramBots/blob/master/LICENSE) + +Extensions to default bots implementation of Telegram Bots library + + +## Usage + +Just import add the library to your project with one of these options: + + 1. Using Maven Central Repository: + +```xml + + org.telegram + telegrambotsextensions + 3.0.2 + +``` + + 2. Using Gradle: + +```gradle + compile "org.telegram:telegrambotsextensions:3.0.2" +``` \ No newline at end of file diff --git a/telegrambots-extensions/pom.xml b/telegrambots-extensions/pom.xml new file mode 100644 index 00000000..111bbd4b --- /dev/null +++ b/telegrambots-extensions/pom.xml @@ -0,0 +1,226 @@ + + + 4.0.0 + org.telegram + telegrambotsextensions + 3.0.1 + jar + + Telegram Bots Extensions + https://github.com/rubenlagus/TelegramBots + Extensions Bots for Telegram Bots library + + + https://github.com/rubenlagus/TelegramBots/issues + GitHub Issues + + + + https://github.com/rubenlagus/TelegramBots + scm:git:git://github.com/rubenlagus/TelegramBots.git + scm:git:git@github.com:rubenlagus/TelegramBots.git + + + + https://travis-ci.org/rubenlagus/TelegramBots + Travis + + + + + rberlopez@gmail.com + Ruben Bermudez + https://github.com/rubenlagus + rubenlagus + + + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + repo + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + UTF-8 + UTF-8 + 3.0.1 + + + + + org.telegram + telegrambots + ${bots.version} + + + + + ${project.basedir}/target + ${project.build.directory}/classes + ${project.artifactId}-${project.version} + ${project.build.directory}/test-classes + ${project.basedir}/src/main/java + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + ossrh + https://oss.sonatype.org/ + true + + + + maven-clean-plugin + 3.0.0 + + + clean-project + clean + + clean + + + + + + maven-assembly-plugin + 2.6 + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.0 + + + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + + jar + + + -Xdoclint:none + + + + + + org.jacoco + jacoco-maven-plugin + 0.7.7.201606060606 + + + + prepare-agent + + + + report + test + + report + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.4.1 + + + enforce-versions + + enforce + + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.4 + + + copy + package + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + UTF-8 + + + + + + \ No newline at end of file diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/TelegramLongPollingCommandBot.java similarity index 90% rename from telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java rename to telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/TelegramLongPollingCommandBot.java index 3cf4edea..f46661c9 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingCommandBot.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/TelegramLongPollingCommandBot.java @@ -1,12 +1,15 @@ -package org.telegram.telegrambots.bots; +package org.telegram.telegrambots.bots.commandbot; import org.telegram.telegrambots.ApiContext; import org.telegram.telegrambots.api.objects.Message; import org.telegram.telegrambots.api.objects.Update; -import org.telegram.telegrambots.bots.commands.BotCommand; -import org.telegram.telegrambots.bots.commands.CommandRegistry; -import org.telegram.telegrambots.bots.commands.ICommandRegistry; +import org.telegram.telegrambots.bots.AbsSender; +import org.telegram.telegrambots.bots.DefaultBotOptions; +import org.telegram.telegrambots.bots.TelegramLongPollingBot; +import org.telegram.telegrambots.bots.commandbot.commands.BotCommand; +import org.telegram.telegrambots.bots.commandbot.commands.CommandRegistry; +import org.telegram.telegrambots.bots.commandbot.commands.ICommandRegistry; import java.util.Collection; import java.util.Map; diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/BotCommand.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/BotCommand.java similarity index 97% rename from telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/BotCommand.java rename to telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/BotCommand.java index 4b0935fa..02da6ebd 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/BotCommand.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/BotCommand.java @@ -1,4 +1,4 @@ -package org.telegram.telegrambots.bots.commands; +package org.telegram.telegrambots.bots.commandbot.commands; import org.telegram.telegrambots.api.objects.Chat; import org.telegram.telegrambots.api.objects.User; diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/CommandRegistry.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java similarity index 98% rename from telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/CommandRegistry.java rename to telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java index e43c273b..17da10d3 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/CommandRegistry.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/CommandRegistry.java @@ -1,4 +1,4 @@ -package org.telegram.telegrambots.bots.commands; +package org.telegram.telegrambots.bots.commandbot.commands; import org.telegram.telegrambots.api.objects.Message; import org.telegram.telegrambots.bots.AbsSender; diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/ICommandRegistry.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/ICommandRegistry.java similarity index 97% rename from telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/ICommandRegistry.java rename to telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/ICommandRegistry.java index 56ae4c6c..1f2a4d5f 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/commands/ICommandRegistry.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/commandbot/commands/ICommandRegistry.java @@ -1,4 +1,4 @@ -package org.telegram.telegrambots.bots.commands; +package org.telegram.telegrambots.bots.commandbot.commands; import org.telegram.telegrambots.api.objects.Message; import org.telegram.telegrambots.bots.AbsSender; diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/TimedSendLongPollingBot.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/timedbot/TimedSendLongPollingBot.java similarity index 99% rename from telegrambots/src/main/java/org/telegram/telegrambots/bots/TimedSendLongPollingBot.java rename to telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/timedbot/TimedSendLongPollingBot.java index 19440e28..734c52a4 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/TimedSendLongPollingBot.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/bots/timedbot/TimedSendLongPollingBot.java @@ -1,6 +1,7 @@ -package org.telegram.telegrambots.bots; +package org.telegram.telegrambots.bots.timedbot; import org.telegram.telegrambots.bots.TelegramLongPollingBot; + import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml index 0993a01c..ce6c9519 100644 --- a/telegrambots-meta/pom.xml +++ b/telegrambots-meta/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.telegram telegrambots-meta - 3.0.1 + 3.0.2 jar Telegram Bots Meta diff --git a/telegrambots/pom.xml b/telegrambots/pom.xml index b38fc101..357ea738 100644 --- a/telegrambots/pom.xml +++ b/telegrambots/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.telegram telegrambots - 3.0.1 + 3.0.2 jar Telegram Bots @@ -66,7 +66,7 @@ 2.8.7 2.8.0 2.5 - 3.0.1 + 3.0.2