DiscordBot AWL
AWL-maintained DiscordBot fork with Valheim 1.0 support and resilient Discord integration.
模組介紹 作者原文
DiscordBot AWL for Valheim
AWL Gaming maintenance fork of the original RustyMods DiscordBot. It preserves the existing two-way Valheim and Discord integration while maintaining compatibility with current Valheim releases and safer client/server transport.
Original author: RustyMods. AWL Gaming maintains this fork and does not claim authorship of the upstream implementation. See NOTICE.md.
AWL 1.4.9 highlights
- AI-generated responses can now use a configurable output language across the supported AI providers.
- Chat relay now has separate Game To Discord and Discord To Game switches while the existing Enabled setting remains the master switch for backward compatibility.
Prerequisites
- BepInEx installed
- JsonDotNet installed
- Discord Webhooks configured for your server
- Discord Bot Token (If you want your discord server to be able to send messages into your game)
- Required on client and server
Installation
Discord Setup
How to create Discord Bot
- Create a Discord Application
- Go to the Discord Developer Portal
- Click "New Application" (top-right)
- Give your application a name (e.g. ValheimBot) and click "Create".
- Add a Bot to the Application
- In the left sidebar, click "Bot"
- Click "Add Bot" ----> confirm by clicking "Yes, do it!"
- You now have a bot user attached to your application.
- You must enable Message Content Intent
- Copy the Bot Token
- On the Bot page, under the "Token" section, click "Reset Token" (or "Copy" if it is already shown).
- Confirm, then copy the generated token.
- Keep this token secret. If it leaks, click "Reset Token" to generate a new one
- Invite the Bot to your Discord Server
- In the sidebar, click "OAuth2" ----> "URL Generator".
- Under SCOPES, check bot
- Under BOT PERMISSIONS, check the permissions your bot will need
- Send Messages
- Read Message History
- View Channels
- Copy the generated URL at the bottom
- Open that URL in your browser and invite the bot to your Discord server
Creating Discord Webhooks
Webhooks allow the plugin to send messages to Discord channels without using the bot's identity.
- Create Webhook
- Go to "Integrations" tab
- Click "Create Webhook"
- Give it a name (e.g., "Valheim Chat")
- Copy Webhook URL
- Click "Copy Webhook URL"
- Save this URL for your plugin configuration
Getting Channel IDs
You'll need Discord Channel IDs for the bot to read messages:
- Enable Developer Mode
- In Discord, go to User Settings (gear icon)
- Go to "Advanced" settings
- Enable "Developer Mode"
- Copy Channel IDs
- Right-click on each channel you want to use
- Select "Copy ID"
- Save these IDs for your configuration
Configure the Plugin
After first run, configuration files will be generated in BepInEx/config. Edit the Discord Bot config file to set up your:
- Channel IDs
- Webhook URLs [SERVER ONLY]
- Bot Token [SERVER ONLY]
- AI API keys [SERVER ONLY when using the server broker]
Configurations
Find DiscordBot plugin configurations in BepinEx/config/RustyMods.DiscordBot.cfg.
Configure webhook URLs, the Discord bot token, and server AI API keys only in the dedicated server config. Version 1.4.1 no longer synchronizes webhook URLs or API keys to clients. Connected clients submit bounded webhook requests to the server broker, which resolves the destination locally.
Webhook URL requires the complete Discord webhook URL. Channel ID requires only the numeric Discord channel ID. They are not interchangeable.
Config file edits are watched and reloaded automatically after saving. No console command is required. Replacing DiscordBot.dll is not hot-reloadable and requires restarting the affected server or client process.
Here's what your configuration might look like:
[1 - General]
If on, the configuration is locked and can be changed by server admins only. [Synced with Server]
Lock Configuration = On
Set interval between check for messages in discord, in seconds [Synced with Server]
Poll Interval = 5
If on, errors will log to
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: