AstralBot
这是一个集 Minecraft 模组与 Discord 机器人于一体的包。它旨在用于 Create: Astral 整合包的官方服务器,但其跨平台实现也使其可供其他用户使用。 目标是让非技术性的服务器管理员能够轻松使用且易于上手, 同时为高级用户允许真正的复杂性。
功能
这些功能是此机器人的核心用途。查看 状态部分 以了解目前已实现的内容。
- Discord 与 Minecraft 账户关联,可选择要求白名单验证
- Discord 与 Minecraft 聊天同步,可选通过 Webhook 以提高可读性
- 使用 Markdown 文件的 FAQ 命令,无需重启服务器
依赖项
此模组有一些依赖项,其中一些在技术上并非必需,因此未直接指定:
- 你所运行平台的 Kotlin 实现。(例如 Kotlin For Forge 或 Fabric Language Kotlin)
- (Neo-)Forge 配置 API(包含在 Neo/Forge 中,Fabric 的额外模组)
实现
- 使用 JDA 库与 Discord API 进行通信。
- 使用 Kotlin 以获得比 Java 更好的开发体验
- 使用 JetBrains Exposed 与数据库进行通信
配置
以下内容可配置:
-
白名单所需的链接绑定(默认:
关闭) -
与模拟 Discord 用户的聊天同步:
- 无用户模拟(机器人将以其自身名称发送消息)
- (如可能)Minecraft 用户模拟(使用 Minecraft 用户名和头像发送消息)
- (仅在要求链接绑定以加入白名单时可用)Discord 用户模拟(消息将以绑定的 Discord 名称发送)
默认:Minecraft 用户模拟(如果已设置 webhook,否则为无模拟)
-
通过命令界面管理常见问题解答(FAQ)(默认:
关闭) -
数据库连接。默认使用 SQLite 数据库
状态
- 白名单功能
- FAQ 命令
- 读取 Markdown 文件
- 无需重启即可更新建议
- 通过命令进行管理/创建
- 聊天同步
- Minecraft 到 Discord
- Discord 到 Minecraft
- Discord 上的用户模仿。可使用 Minecraft 头像或 Discord 头像
运行方式
目前尚无该机器人/模组的公开实例。要使用它,请在 Discord Developer Portal 上创建一个新的应用程序,并配置以下三个特权网关意图:PRESENCE、SERVER MEMBERS 和 MESSAGE CONTENT。
复制机器人令牌并将其保存在安全的地方(例如密码管理器),切勿向任何人展示。为确保令牌能被机器人正确读取,您需要将其设置为运行 Minecraft 服务器可访问的环境变量 DISCORD_TOKEN,或者在配置文件的 token 键下填入该令牌。
例如,您可以在类 Unix 系统上修改 start.sh 脚本以 export 它,或直接设置该变量后启动 shell 脚本:
startmc.sh:
export DISCORD_TOKEN=<place token here>
java ... # 启动服务器的 Java 命令
或
DISCORD_TOKEN=<place token here> startmc.sh # 在设置环境变量后启动脚本
服务器启动后,你可以前往 Discord 开发者门户中的 OAuth2 URL 生成器,生成一个包含 bot 和 applications.command 权限的 URL。使用该生成的 URL 让机器人加入你的服务器。
为了实现用户模拟功能(使聊天同步更易读),机器人将尝试在配置的聊天同步频道中创建一个 webhook。这意味着它需要拥有管理 webhook 的权限。如果你不希望如此,可以手动在你希望同步消息的频道中创建一个 webhook,并在模组的配置文件中将其设置到 webhook.url 选项内。
AstralBot
This is a Minecraft mod and Discord Bot in one package. It's intended for the Create: Astral Modpack's official server, but it's implemented cross-platform to be usable by others too. The goal is to be easy-to-use and accessible for non-technical server admins, while allowing true complexity for power users.
Features
These features are the core of what this bot will do. See the Status section to see how much is already implemented.
- Discord and Minecraft account linking, optionally requiring this to be whitelisted
- Discord and Minecraft chat synchronization, optionally via webhook for improved readability
- FAQ commands using Markdown files without needing to restart the server
Dependencies
This mod has a few dependencies, some of which are not specified directly as they're technically optional:
- The Kotlin Implementation for the platform you're running. (e.g. Kotlin For Forge or Fabric Language Kotlin)
- The (Neo-)Forge Config API (Included in Neo/Forge, extra mod for Fabric)
Implementation
- JDA library to communicate with the Discord API.
- Kotlin for the improved development experience over Java
- JetBrains Exposed to communicate with the Database
Configuration
The following things will be configurable:
-
Required linking to be whitelisted (default:
off) -
Chat synchronization with imitated Discord Users:
- No user imitation (The bot will write the messages under its own name)
- (If possible) Minecraft user imitation (The Minecraft usernames and heads will be used for messages)
- (Only available if requiring linking for whitelist) Discord user imitation (The messages will be written under the linked Discord name)
Default: Minecraft user imitation (if webhook available is set, otherwise no imitation)
-
Managing FAQs through a command interface (default:
off) -
Database connection. Uses an SQLite database by default
Status
- Whitelisting
- FAQ Commands
- Reading Markdown files
- Updating suggestions without restart
- Management/Creation via commands
- Chat synchronization
- Minecraft to Discord
- Discord to Minecraft
- User imitation on Discord. Either uses Minecraft avatars or Discord avatars
Running
There is no public instance of this bot/mod available. To use it, create a new Application
on the Discord Developer Portal and configure it
to have the three privileged gateway intents: PRESENCE, SERVER MEMBERS and MESSAGE CONTENT.
Copy the bot token and store it somewhere safe (like a Password Manager) and never show it to
anybody else. To make sure the token gets read by the bot, it has to be in either an Environment Variable
DISCORD_TOKEN where the running Minecraft server can access it or in the config file under the key token.
You could for example modify a start.sh script on a Unix-like system to export it or start the shell script with it set directly:
startmc.sh:
export DISCORD_TOKEN=<place token here>
java ... # java command that starts the server
or
DISCORD_TOKEN=<place token here> startmc.sh # Start the script with the env variable set
After starting the server, you can go into the OAuth2 URL builder on the Discord
Developer Portal and generate a URL with the bot and applications.command permissions.
Use the generated URL to have the bot join your server.
To be able to use user imitation, which makes the chat synchronization more readable, the bot will try and create a webhook
in the configured chat synchronization channel. This means it will need to have the permission to manage webhooks. If you
don't want that you can manually create a webhook in the channel where you want the messages synchronized and set it in the
webhook.url option in the config for the mod.
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AstralBot
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
更新 JetBrains 的 Exposed,以防止与 Ledger 相关的问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧