? Minecraft 电报机器人 - 设置指南
? 这是什么?
一款允许你通过 Telegram 管理 Minecraft 服务器的插件。玩家可以向 Telegram 群组发送指令,机器人将在服务器上执行这些操作。
? 快速安装(5 分钟)
- 步骤 1:在 Telegram 中创建机器人
- 打开 Telegram
- 找到 @BotFather
- 发送 /newbot
- 选择机器人名称(例如 MyServerBot)
- 获取令牌(请保存好!)
令牌格式如下:1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
- 步骤 2:将机器人添加到群组
- 创建一个新的 Telegram 群组
- 将你的机器人加入该群组
- 将机器人设为管理员
- 获取群组 ID:
- 将 @getidsbot 添加到群组中
- 发送 /start
- 复制群组 ID(以 -100 开头)
步骤 3:在服务器上安装插件
- 下载 UniversalTelegramBot.jar 文件
- 将其放入服务器的 plugins/ 文件夹中
- 重启服务器
步骤 4:配置设置
首次启动后,会出现文件 plugins/TelegramBot/config.yml
编辑该文件:
telegram:
enabled: true
bot-token: "在此粘贴你的令牌"
group-chat-id: "在此粘贴你的群组 ID"
步骤 5:重载插件
在游戏中执行:
/telegrambot reload
⚙️ 游戏内管理命令
基本命令:
/telegrambot status - 检查机器人状态
/telegrambot reload - 重载配置
/telegrambot test - 发送测试消息
/telegrambot list - 显示所有命令
/telegrambot debug - 切换调试模式
权限管理:
/telegrambot addperm <ID> <permission> - 授予用户权限
/telegrambot removeperm <ID> <permission> - 移除权限
/telegrambot listperms - 列出所有权限
授予权限示例:
/telegrambot addperm (id)123456789 telegrambot.restart
? Telegram 命令
适用于所有玩家(如果已配置):
/help - 显示命令列表
/fly <nick> - 授予 1 小时飞行权限
/money <nick> - 给予金钱
/kit <nick> - 给予装备包
/online - 查看在线玩家
适用于管理员(需要相应权限):
/kick <nick> - 踢出玩家
/ban <nick> - 封禁玩家
/restart - 重启服务器
/give <nick> - 给予物品
? 配置命令
命令示例:
commands:
fly:
command: "lp user %player% permission settemp essentials.fly true 60m"
cooldown: 86400 # 冷却时间(秒),此处为 24 小时
eho: "Fly for 1 hour | " # /help 菜单中的描述
message: "✅ Fly granted!" # 成功时的消息
error-message: "❌ Error" # 错误时的消息
permission: "" # 所需权限(留空表示所有人可用)
run-as-console: true # 以控制台身份执行
命令参数:
- command - 要在服务器上执行的命令
- cooldown - 使用间隔冷却时间(秒)
- eho - /help 菜单中的描述
- message - 成功时机器人的回复
- error-message - 出错时的回复
- permission - 所需权限(留空表示对所有人开放)
- run-as-console - 以控制台身份执行(建议保持为 true)
命令占位符
在 command 字段中使用:
%player% - 来自 Telegram 命令的玩家昵称
%args% - 命令后的所有参数
%user% - Telegram 用户名
%user_id% - Telegram 用户 ID
示例:
command: "eco give %player% 1000" # 将给予玩家 1000 金钱
command: "msg %player% Hello from %user%" # 将发送消息
? 权限系统
- 如何获取用户 ID:
- 要求用户向群组发送任意消息
- 查看服务器日志 - 其中会包含其 ID
- 或使用 @getidsbot
- 授予权限:
/telegrambot addperm 123456789 telegrambot.restart
/telegrambot addperm 123456789 telegrambot.ban
- 标准权限:
telegrambot.restart - 重启权限
telegrambot.ban - 封禁权限
telegrambot.kick - 踢出权限
telegrambot.admin - 所有权限(适用于操作员)
?️ 故障排除
- 机器人无响应:
- 检查令牌:/telegrambot status
- 检查群组 ID
- 确保机器人为群组管理员
- 启用调试:/telegrambot debug
- 命令未执行:
- 检查服务器日志
- 确保安装了所需的插件
- 检查配置中的命令语法
控制台错误:
[TelegramBot] ERROR: ... - 检查 config.yml
[TelegramBot] WARNING: ... - 通常不严重
有用的诊断命令:
/telegrambot execute say Test command # 测试执行
/telegrambot debug # 启用详细日志
/telegrambot reload # 重载设置
? 实用技巧
- 对于初学者:
- 从单个命令 /fly 开始
- 在小群组中进行测试
- 逐步添加新命令
- 对于管理员:
- 为命令创建单独的群组
- 指定专人负责权限分配
- 定期检查日志
- 对于玩家:
- 使用格式:/command player_nickname
- 遵守冷却时间
- 使用 /help 查看命令列表
完成!现在玩家可以通过 Telegram 管理服务器。从简单命令开始,逐步扩展功能。 ?
? TELEGRAM BOT FOR MINECRAFT - SETUP GUIDE
? WHAT IS THIS?
A plugin that allows you to manage your Minecraft server through Telegram. Players can send commands to a Telegram group, and the bot will execute them on the server.
? QUICK INSTALLATION (5 MINUTES)
- Step 1: Create a bot in Telegram
- Open Telegram
- Find @BotFather
- Send /newbot
- Choose a bot name (e.g., MyServerBot)
- Get the token (save it!)
Token looks like this: 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
- Step 2: Add bot to group
- Create a new Telegram group
- Add your bot to the group
- Make the bot an administrator
- Get the group ID:
- Add @getidsbot to the group
- Send /start
- Copy the group ID (starts with -100)
Step 3: Install plugin on server
- Download UniversalTelegramBot.jar file
- Place it in your server's plugins/ folder
- Restart the server
Step 4: Configure settings
After first launch, the file plugins/TelegramBot/config.yml will appear
Edit it:
telegram:
enabled: true
bot-token: "PASTE_YOUR_TOKEN_HERE"
group-chat-id: "PASTE_YOUR_GROUP_ID_HERE"
Step 5: Reload the plugin
In-game, execute:
/telegrambot reload
⚙️ IN-GAME MANAGEMENT COMMANDS
Basic commands:
/telegrambot status - Check bot status
/telegrambot reload - Reload configuration
/telegrambot test - Send test message
/telegrambot list - Show all commands
/telegrambot debug - Toggle debug mode
Permission management:
/telegrambot addperm <ID> <permission> - Grant permission to user
/telegrambot removeperm <ID> <permission> - Remove permission
/telegrambot listperms - List all permissions
Example of granting permission:
/telegrambot addperm (id)123456789 telegrambot.restart
? TELEGRAM COMMANDS
For all players (if configured):
/help - Show command list
/fly <nick> - Grant 1 hour of fly
/money <nick> - Give money
/kit <nick> - Give kit
/online - Check online players
For admins (require permissions):
/kick <nick> - Kick player
/ban <nick> - Ban player
/restart - Restart server
/give <nick> - Give items
? CONFIGURING COMMANDS
Command example:
commands:
fly:
command: "lp user %player% permission settemp essentials.fly true 60m"
cooldown: 86400 # 24 hours in seconds
eho: "Fly for 1 hour | " # Description in /help
message: "✅ Fly granted!" # Success message
error-message: "❌ Error" # Error message
permission: "" # Required permission (empty = for everyone)
run-as-console: true # Execute as console
Command parameters:
- command - command to execute on server
- cooldown - cooldown between uses (seconds)
- eho - description in /help menu
- message - bot response on success
- error-message - response on error
- permission - required permission (leave empty for everyone)
- run-as-console - execute as console (better to keep true)
PLACEHOLDERS FOR COMMANDS
Use in command field:
%player% - Player nickname from Telegram command
%args% - All arguments after command
%user% - Telegram username
%user_id% - Telegram user ID
Example:
command: "eco give %player% 1000" # Will give 1000 money to player
command: "msg %player% Hello from %user%" # Will send message
? PERMISSION SYSTEM
- How to get user ID:
- Ask user to send any message to group
- Check server logs - their ID will be there
- Or use @getidsbot
- Granting permissions:
/telegrambot addperm 123456789 telegrambot.restart
/telegrambot addperm 123456789 telegrambot.ban
- Standard permissions:
telegrambot.restart - restart permission
telegrambot.ban - ban permission
telegrambot.kick - kick permission
telegrambot.admin - all permissions (for operators)
?️ TROUBLESHOOTING
- Bot not responding:
- Check token: /telegrambot status
- Check group ID
- Ensure bot is group administrator
- Enable debug: /telegrambot debug
- Commands not executing:
- Check server logs
- Ensure required plugins are installed
- Check command syntax in config
Console errors:
[TelegramBot] ERROR: ... - check config.yml
[TelegramBot] WARNING: ... - usually not critical
Useful diagnostic commands:
/telegrambot execute say Test command # Test execution
/telegrambot debug # Enable detailed logs
/telegrambot reload # Reload settings
? USEFUL TIPS
- For beginners:
- Start with one command /fly
- Test in a small group
- Gradually add new commands
- For administrators:
- Create separate group for commands
- Assign responsible people for permissions
- Regularly check logs
- For players:
- Use format: /command player_nickname
- Respect cooldowns
- Use /help for command list
Done! Now players can manage the server through Telegram. Start with simple commands and gradually expand functionality. ?
评论 0
登录后参与评分
还没有评论,来抢沙发吧