-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MEFRREEX/1.5.0
refactor: full bot refactor
- Loading branch information
Showing
68 changed files
with
1,390 additions
and
1,250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Compiled class file | ||
*.class | ||
.gradle/ | ||
build/ | ||
bin/ | ||
target/ | ||
.idea/ | ||
.vscode/ | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
replay_pid* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,70 @@ | ||
# Vk-Rcon-Bot | ||
Simple bot for VK to send commands to the server using RCON | ||
|
||
![example](https://i.imgur.com/DH8hsSV.png) | ||
A simple bot for sending commands to a Minecraft server via RCON through the VK platform. | ||
|
||
## 📃 Used libraries: | ||
- [vk-java-sdk](https://github.com/VKCOM/vk-java-sdk) | ||
- [snakeyaml](https://github.com/snakeyaml/snakeyaml) | ||
- [rkon-core](https://github.com/kr5ch/rkon-core) | ||
## 🚀 Features | ||
- Sends RCON commands to a server directly from VK messages. | ||
- Easy setup and configuration. | ||
- Lightweight and simple to use. | ||
- **Multilingual support**: The bot supports multiple languages, with easy customization of all messages. | ||
- **Command prefix**: Ability to specify a custom prefix for commands. | ||
- **Quick commands**: Add predefined quick commands for frequent actions. | ||
- **Command blocking**: Option to block specific unwanted commands from being executed. | ||
|
||
## 🎮 Running the Bot | ||
1. Download the latest release of the bot. | ||
2. Run the following command to start the bot: | ||
```bash | ||
java -jar VkRconBot-<Version>.jar | ||
``` | ||
|
||
## 🛠 Build JAR file | ||
- `git clone https://github.com/MEFRREEX/Vk-Rcon-Bot.git` | ||
- `cd Vk-Rcon-Bot` | ||
- `mvn clean package` | ||
## ⚙️ Configuration | ||
After the first run of the bot, a configuration file config.yml will be generated. You will need to edit this file before the bot can function properly. | ||
```yaml | ||
# Available languages: eng (English), rus (Русский) | ||
language: "rus" | ||
|
||
## 🎮 Run | ||
`java -jar VkRconBot-1.4.jar` | ||
# VK settings | ||
vk: | ||
groupId: 123 # VK group Id | ||
accessToken: "token" # VK group token | ||
|
||
# RCON settings | ||
rcon: | ||
host: "localhost" # RCON address | ||
port: 19132 # RCON port | ||
password: "password" # RCON password | ||
|
||
# Command settings | ||
commands: | ||
# A character before the command to send the command. For example '/'. | ||
# Leave blank if not required. | ||
prefix: '/' | ||
|
||
# Fast commands | ||
# (Displayed when “Start”, “Rcon” is entered) | ||
fast-commands: ["ver", "status", "stop"] | ||
|
||
# Blocked commands | ||
blocked-commands: ["stop"] | ||
``` | ||
## 🛠 Building the JAR File | ||
To build the project from source: | ||
1. Clone the repository: | ||
```bash | ||
git clone https://github.com/MEFRREEX/Vk-Rcon-Bot.git | ||
``` | ||
2. Navigate to the project directory: | ||
```bash | ||
cd Vk-Rcon-Bot | ||
``` | ||
3. Build the JAR file using Gradle: | ||
```bash | ||
gradle build | ||
``` | ||
|
||
## 📄 Dependencies | ||
The project uses the following libraries: | ||
- [Vk-Java-Sdk](https://github.com/VKCOM/vk-java-sdk) - for VK API integration. | ||
- [Configuration](https://github.com/MEFRREEX/Configuration) - for managing configuration files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Vk-Rcon-Bot | ||
|
||
Простой бот для отправки команд на сервер через RCON с помощью платформы ВКонтакте. | ||
|
||
## 🚀 Основные возможности | ||
- Отправка команд на сервер через RCON из сообщений ВКонтакте. | ||
- Простая настройка и конфигурация. | ||
- Лёгкий в использовании. | ||
- **Поддержка нескольких языков**: Бот поддерживает несколько языков с простой настройкой всех сообщений. | ||
- **Префикс для команд**: Возможность указать префикс для команд. | ||
- **Быстрые команды**: Возможность добавить заранее настроенные быстрые команды для частых действий. | ||
- **Блокировка команд**: Возможность заблокировать нежелательные для использования команды. | ||
|
||
|
||
## 🎮 Запуск бота | ||
1. Скачайте последнюю версию бота. | ||
2. Запустите следующую команду для старта бота: | ||
```bash | ||
java -jar VkRconBot-<Версия>.jar | ||
``` | ||
|
||
## ⚙️ Конфигурация | ||
После первого запуска бота будет сгенерирован файл конфигурации config.yml. Вам необходимо отредактировать этот файл перед дальнейшим использованием бота. | ||
|
||
```yaml | ||
# Доступные языки: eng (English), rus (Русский) | ||
language: "rus" | ||
|
||
# Настройки VK | ||
vk: | ||
groupId: 123 # Id группы ВК | ||
accessToken: "token" # Токен группы ВК | ||
|
||
# Настройки RCON | ||
rcon: | ||
host: "localhost" # Адрес RCON | ||
port: 19132 # Порт RCON | ||
password: "password" # Пароль RCON | ||
|
||
# Настройки команд | ||
commands: | ||
# Символ перед командой для отправки комманды. Например '/'. | ||
# Оставьте пустым если не требуется. | ||
prefix: '/' | ||
|
||
# Быстрые команды | ||
# (Отображаются при вводе "Начать", "Rcon") | ||
fast-commands: ["ver", "status", "stop"] | ||
|
||
# Заблокированные команды | ||
blocked-commands: ["stop"] | ||
``` | ||
## 🛠 Сборка JAR-файла | ||
Чтобы собрать проект из исходного кода: | ||
1. Клонируйте репозиторий: | ||
```bash | ||
git clone https://github.com/MEFRREEX/Vk-Rcon-Bot.git | ||
``` | ||
2. Перейдите в директорию проекта: | ||
```bash | ||
cd Vk-Rcon-Bot | ||
``` | ||
3. Соберите JAR-файл с помощью Gradle: | ||
```bash | ||
gradle build | ||
``` | ||
|
||
## 📄 Зависимости | ||
Проект использует следующие библиотеки: | ||
- [Vk-Java-Sdk](https://github.com/VKCOM/vk-java-sdk) - для интеграции с API ВКонтакте. | ||
- [Configuration](https://github.com/MEFRREEX/Configuration) - для управления файлами конфигурации. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.21" | ||
} | ||
|
||
tasks.withType<Jar> { | ||
archiveFileName.set("Vk-Rcon-Bot-API-${project.version}.jar") | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(17) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.mefrreex.vkbot.command | ||
|
||
abstract class Command( | ||
val name: String, | ||
val description: String = "", | ||
val aliases: Array<String> = emptyArray() | ||
) |
14 changes: 14 additions & 0 deletions
14
api/src/main/kotlin/com/mefrreex/vkbot/command/CommandService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.mefrreex.vkbot.command | ||
|
||
interface CommandService { | ||
|
||
fun getCommands(): Map<String, Command> | ||
|
||
fun getCommand(name: String): Command? | ||
|
||
fun register(vararg commands: Command) { | ||
commands.forEach { register(it)} | ||
} | ||
|
||
fun register(command: Command) | ||
} |
Oops, something went wrong.