Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

# plz read fucking readme.md
/src/main/resources/application.yml

*.iml
*.json

Expand All @@ -16,20 +20,20 @@ debug/
# mpeltonen/sbt-idea plugin
.idea_modules/


*.class
*.jar
*.war
*.ear
*.tmp
*.exe


thumbs.db
.DS_Store
*.log

test/
target/generated-sources/
target/
pom.backup
/.classpath
/.project
.settings/
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Build stage
#
FROM maven:3.6.0-jdk-8 AS build
COPY src /home/app/src
COPY pom.xml /home/app
RUN mvn -f /home/app/pom.xml clean package

#
# Package stage
#
FROM openjdk:8
COPY --from=build /home/app/target/telebot-0.1-SNAPSHOT.jar /usr/local/lib/bot.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/local/lib/bot.jar"]
4 changes: 0 additions & 4 deletions botToken/config.example

This file was deleted.

6 changes: 0 additions & 6 deletions botToken/readme.md

This file was deleted.

8 changes: 0 additions & 8 deletions docker-compose.yml

This file was deleted.

112 changes: 52 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,98 +4,90 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>TelegaAWS13</name>
<description>
Berlin Telegram main.java.de.Bot.
</description>
<developers>
<developer>
<id>andron13</id>
<name>Andrej</name>
<email>andron13@gmail.com</email>
<timezone>ECT</timezone>
</developer>
</developers>

<groupId>de.telran</groupId>
<artifactId>TelegaBerlin13</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>

<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Internal repo</name>
<url>file:///target</url>
</repository>
</distributionManagement>
<name>TelegaAWS13</name>
<description>
Telegram bot with spring boot starter
</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/>
</parent>

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<developers>
<developer>
<id>andron13</id>
<name>Andrej</name>
<email>andron13@gmail.com</email>
<url>https://t.me/andron13</url>
<organization>tel-ran</organization>
<organizationUrl>https://www.tel-ran.de/</organizationUrl>
<timezone>ECT</timezone>
</developer>
</developers>

<build>
<!--<sourceDirectory>/src/main/java/de</sourceDirectory>-->

<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>de.Main</mainClass>
</manifest>
</archive>
</configuration>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>

</plugins>

</build>

<dependencies>
<dependency>
<groupId>com.github.xabgesagtx</groupId>
<artifactId>telegram-spring-boot-starter</artifactId>
<version>0.19</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>4.1</version>
<version>4.1.2</version>
</dependency>

<!-- <dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>-->

<dependency>
<!--
JSON SIMPLE PARSER
-->
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
<groupId>org.telegram</groupId>
<artifactId>telegrambotsextensions</artifactId>
<version>4.1.2</version>
</dependency>

</dependencies>

</project>
30 changes: 30 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Telegram Bot as SpringBoot starter app


## How to start

### Telegram Token

You have to change the the config values for `bot.token` and `bot.username` and `weather` in the `application.yml` to the credentials of your bot and then
you're ready to go.

Plz rename _./src/main/resources/application.example_ to _./src/main/resources/application.yml_ and write you data.
Make your Bot by https://telegram.me/BotFather

### Weather Token
https://home.agromonitoring.com/api_keys


### Telegram Bot as SpringBoot starter app

You have to change the the config values for `bot.token` and `bot.username` in the `application.yml` to the credentials of your bot and then
you're ready to go.

To start in Docker container, first build the image:
```
docker build -t bot .
```
then run:
```
docker run -d --rm -it bot:latest
```
44 changes: 0 additions & 44 deletions src/main/java/de/Bot.java

This file was deleted.

57 changes: 0 additions & 57 deletions src/main/java/de/BotTokenReader.java

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/java/de/IBotReaction.java

This file was deleted.

25 changes: 0 additions & 25 deletions src/main/java/de/Main.java

This file was deleted.

Loading