将 Better Than Adventure 服务器的聊天与 Discord 频道链接起来。
玩家可以在游戏中向 Discord 发言,Discord 也会回复。使用 [item] 和 [inv] 分别显示你手中的物品或整个背包,它们会像在游戏中一样以图像形式出现在 Discord 上。在 Discord 上发送的图片可以在游戏中作为地图持有。
仅限服务器端。玩家无需安装任何内容。


[item] 在游戏内的样子以及它发送到 Discord 的图片。
聊天
- 消息双向同步,每位玩家在 Discord 上的名字和头像都会显示
- 加入、离开、死亡、跳过夜晚以及服务器启动和停止都会发布公告
- 加粗、斜体、下划线、删除线和剧透( spoilers )在两个方向上都支持
- Discord 上的回复、附件和表情贴纸会显示在游戏中
- 游戏中的
@name 会在 Discord 上提及该玩家。@everyone 和 @here 不会触发通知

来自 Discord 的格式在游戏内生效。剧透部分保持为乱码文本隐藏。

物品与背包
在聊天中输入 [item] 或 [i] 显示你手中的物品,输入 [inv] 或 [inventory] 显示你的背包。图片使用游戏自带的纹理、字体和工具提示样式,并支持其他模组的物品。

Aether 配件栏、副手栏以及背负背包的背包展示。
- 玩家模型上的皮肤和盔甲
- Better With Bags 的背包会显示其内容,背负背包会显示在背部及背包上方
- Aether 配件栏、手套、吊坠和披风
- Better With Hands 的副手栏
- 地图在其工具提示下方绘制


背包内容和一张地图,绘制在工具提示内部。
来自 Discord 的图片
当有人在 Discord 上发布图片时,游戏会将其显示为 [image.png] /preview 3。输入命令可将图片作为地图持有。GIF 动图会播放。切换快捷栏槽位会使物品回归原位。


通过 /preview 命令后,在手中作为地图持有的来自 Discord 的图片。
命令
| 命令 |
位置 |
描述 |
/preview [number] |
游戏 |
将来自 Discord 的图片作为地图持有,若未指定数字则默认为最后一张 |
/playerlist |
Discord |
在线玩家列表图片,类似标签页列表 |

/playerlist 在 Discord 上显示,绘制方式类似标签页列表。
控制台
服务器控制台可以镜像到第二个 Discord 频道。在该频道发送的消息将作为命令执行。可以通过黑名单或白名单限制命令的使用,所有来自 Discord 的命令都会写入 logs/better_with_discord-commands.log。
设置
- 在 Discord Developer Portal 创建应用并添加机器人
- 在 Bot 选项卡中开启 Message Content Intent
- 邀请机器人时使用
bot 和 applications.commands 作用域,并赋予以下权限:查看频道、发送消息、管理 Webhook、嵌入链接、附加文件
- 首次启动服务器,然后填写
config/better_with_discord.cfg
- 重启服务器
所有设置均在 GitHub 上的 README 中列出。
要求
许可证
请参阅 LICENSE。简要说明:个人使用和带有署名的免费整合包可免费使用,未经许可不得用于商业用途。
Links the chat of a Better Than Adventure server with a Discord channel.
Players talk to Discord from the game and Discord talks back. Show the item in your hand or your whole inventory with [item] and [inv], and they appear on Discord drawn just like in the game. Images sent on Discord can be held in game as a map.
Server only. Players don't need to install anything.


[item] in the game and the picture it sends to Discord.
Chat
- Messages go both ways, with each player's name and head on Discord
- Joins, leaves, deaths, skipped nights and server start and stop are announced
- Bold, italics, underline, strikethrough and spoilers work in both directions
- Replies, attachments and stickers from Discord show up in the game
@name in the game mentions that person on Discord. @everyone and @here never ping

Formatting from Discord in the game. Spoilers stay hidden as scrambled text.

Items and inventories
Write [item] or [i] in chat to show the item in your hand, and [inv] or [inventory] to show your inventory. The pictures use the game's own textures, font and tooltip style, and also cover items from other mods.

Inventories with Aether accessory slots, the offhand slot and a worn backpack.
- Your skin and armor on the player model
- Backpacks from Better With Bags show their contents, and a worn backpack shows on your back and under the inventory
- Aether accessory slots, gloves, pendants and capes
- The offhand slot from Better With Hands
- Maps are drawn under their tooltip


Backpack contents and a map, drawn inside the tooltip.
Images from Discord
When someone posts an image on Discord, the game shows it as [image.png] /preview 3. Type the command to hold the image as a map. GIFs play. Switching slots puts your item back.


An image from Discord held as a map after /preview.
Commands
| Command |
Where |
Description |
/preview [number] |
game |
Hold an image from Discord as a map, the last one if no number is given |
/playerlist |
Discord |
Picture of who is online, like the tab list |

/playerlist on Discord, drawn like the tab list.
Console
The server console can be mirrored to a second Discord channel. Messages sent there run as commands. Commands can be limited with a blacklist or a list of allowed commands, and every command from Discord is written to logs/better_with_discord-commands.log.
Setup
- Create an application in the Discord Developer Portal and add a bot
- Turn on Message Content Intent in the Bot tab
- Invite the bot with the
bot and applications.commands scopes and these permissions: View Channels, Send Messages, Manage Webhooks, Embed Links, Attach Files
- Start the server once, then fill in
config/better_with_discord.cfg
- Restart the server
All settings are listed in the README on GitHub.
Requirements
License
See LICENSE. Short version: free for personal use and free modpacks with attribution, no commercial use without permission.
评论 0
登录后参与评分
还没有评论,来抢沙发吧