VampireWebhook
A simple package for sending messages to Discord.
模組介紹 作者原文
VampireWebhook - Simple Discord webhook integration
Features
- Loads webhook from hook.txt
- Allows mods to send messages to discord
- Format messages with markdown syntax
For admins and server owners:
To properly setup this mod you need to:
- Create a hook.txt file in \BepInEx\config\
- Go to your discord and get your webhook url in the channel you want messages sent to. (how to get hook url)
- Add the webhook url to hook.txt
- ‼️NOTE: Do not share the webhook url with anyone. Don't post it when asking for support either.
- Add the VampireWebhook.dll to \BepInEx\plugins\
- You're good to go!
Setttings
The settings file will be created at: BepInEx\config\phlebotomist.morphine.VampireWebhook.cfg
Set the value to false if you need to turn off the webhook for some reason.
[General]
toggle for sending messages to the webhook
Setting type: Boolean
Default value: true
UseDiscordWebhook = true
For devs:
The code is pretty short and I added doc comments above all functions but here's a quick overview of how it's intended to be used.
SendDiscordMessageAsync can be used to send the messages. HookEnabled is public so you can short circuit any proccessing or string building if the hook is turned off, however it is not required.
using VampireWebhook;
private static void exmapleMessageBuilder(int someNumber){
if (!HookEnabled())
return;
string myString = $"Wow it's over: {someNumber}!"
_ = DiscordWebhook.SendDiscordMessageAsync(myString)
}
credits and thanks:
Want to give thanks to Deca, Odjit and everyone in the VrisingModing discord who helped answer questions.
Support:
- I go by Morphine on the Vrising modding Discord
- Additionally feel free to open issues on the github
Pull Requests:
I want to keep this thing simple but if there's anything you think I missed or did stupid I will try to review any PR's in a timely manner. Feel free to msg me on Discord (@morphine) if I don't respond within a day.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: