telegram-bot
所属分类:编程语言基础
开发工具:kotlin
文件大小:0KB
下载次数:0
上传日期:2023-10-19 10:53:47
上 传 者:
sh-1993
说明: 使用kotlin编程语言的一些简单电报机器人的一个简单示例,
(A salple example for some simple telegram bots using kotlin programming language,)
文件列表:
.idea/ (0, 2023-10-19)
.idea/gradle.xml (444, 2023-10-19)
.idea/inspectionProfiles/ (0, 2023-10-19)
.idea/inspectionProfiles/Project_Default.xml (276, 2023-10-19)
.idea/kotlinc.xml (175, 2023-10-19)
.idea/vcs.xml (180, 2023-10-19)
build.gradle.kts (1089, 2023-10-19)
gradle.properties (27, 2023-10-19)
gradle/ (0, 2023-10-19)
gradle/wrapper/ (0, 2023-10-19)
gradle/wrapper/gradle-wrapper.jar (60756, 2023-10-19)
gradle/wrapper/gradle-wrapper.properties (201, 2023-10-19)
gradlew (8070, 2023-10-19)
gradlew.bat (2674, 2023-10-19)
settings.gradle.kts (221, 2023-10-19)
src/ (0, 2023-10-19)
src/main/ (0, 2023-10-19)
src/main/kotlin/ (0, 2023-10-19)
src/main/kotlin/Ktor.kt (766, 2023-10-19)
src/main/kotlin/echo/ (0, 2023-10-19)
src/main/kotlin/echo/EchoBot.kt (844, 2023-10-19)
src/main/kotlin/echo/EchoMain.kt (498, 2023-10-19)
src/main/kotlin/name/ (0, 2023-10-19)
src/main/kotlin/name/NameBot.kt (2605, 2023-10-19)
src/main/kotlin/name/NameMain.kt (498, 2023-10-19)
src/main/kotlin/watermark/ (0, 2023-10-19)
src/main/kotlin/watermark/WatermarkBot.kt (5960, 2023-10-19)
src/main/kotlin/watermark/WatermarkMain.kt (518, 2023-10-19)
# Kotlin Telegram Bots
This repository contains multiple Telegram bots:
1. **EchoBot** - A simple bot that echoes back any message you send to it.
2. **NameBot** - A bot that provides information about a given name, including its likely gender, average age, and nationality.
3. **WatermarkBot** - A Telegram bot designed to add watermarks to images. Users can specify the text and choose from a selection of colors.
## Getting Started
### Prerequisites
- Java JDK (preferably JDK 8 or above)
- Maven or Gradle for dependency management
- Set up your `BOT_TOKEN` and `BOT_USERNAME` as environment variables or replace them in the code directly.
### Running the bots
To run any of the bots, navigate to their respective main functions and execute the application.
## Features
### EchoBot
- Echoes back any message sent to it.
### NameBot
- Responds with gender, average age, and most probable nationality for a provided name.
- Uses external APIs like `genderize.io`, `agify.io`, and `nationalize.io` for fetching name data.
### WatermarkBot
- **User Interaction**: The bot interacts with the user through a series of prompts.
- **Custom Watermark**: Users can specify their own text for the watermark.
- **Color Selection**: Users can choose from a predefined set of colors for the watermark text.
- **Image Processing**: The bot processes the image and sends back the watermarked image.
## Libraries Used
- **TelegramBots** - Java library to create bots using the Telegram Bots API.
- **Ktor** - Kotlin asynchronous framework for creating microservices, web applications, and more.
- **Kotlinx Serialization** - Kotlin library for JSON serialization.
- Java's AWT and ImageIO: Used for image processing in the WatermarkBot.
## Special Thanks
A special shoutout and thanks to the [TelegramBots library by rubenlagus](https://github.com/rubenlagus/TelegramBots). This project wouldn't have been possible without it!
## Contributing
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
## License
This project is free software; you can redistribute it and/or modify it under the terms of the license provided.
---
Remember, always keep your tokens and sensitive information secret. Never expose them in your code or version control.
近期下载者:
相关文件:
收藏者: