This is a simple calculator working with Telegram bot. Including addition, subtraction, multiplication and division
If the Heroku badge shows green that means you can start the bot from Telegram
This project uses the library introduced on the Telegram website. You can find more information about this library here
- Using Maven Central Repository:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.7.1</version>
</dependency>
- Using Gradle:
implementation 'org.telegram:telegrambots:5.7.1'
Import the library .jar direclty to your project. Depending on the IDE you are using, the process to add a library is different, here is a video that may help with Intellij or Eclipse
if you enjoy this project and want to see how it works,
- clone the project:
git clone https://github.com/ILoveBacteria/calculator-telegram-bot.git
-
You must enter the token you received from the BotFather in the
CalculatorBot
class in thegetBotToken()
method -
You must enter the username of your bot without '@' in the
CalculatorBot
class in thegetBotUsername()
method -
Install JDK 11 or later
-
Install Maven 3
-
Build the project:
mvn clean install
Maven will read the pom.xml
and download all dependencies automatically then gives you a jar file named
calculator-telegram-bot-{version}-jar-with-dependencies.jar
- Run this jar file and enjoy:
java -jar calculator-telegram-bot-{version}-jar-with-dependencies.jar
MIT License
Copyright (c) 2022 Moein Arabi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Read the full license here
You can download and run the last release from here