forked from cryptiklemur/valheim-discord-notifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiscordNotifier.cs
35 lines (28 loc) · 1.02 KB
/
DiscordNotifier.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Reflection;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
namespace DiscordNotifier
{
[BepInPlugin(GUID, MODNAME, VERSION)]
public class Main : BaseUnityPlugin
{
public const string MODNAME = "Discord Notifier";
public const string AUTHOR = "CryptikLemur";
public const string GUID = "CryptikLemur_DiscordNotifier";
public const string VERSION = "0.0.5.0";
internal static ManualLogSource StaticLogger;
public static Configuration Configuration;
private void Awake()
{
var harmony = new Harmony(GUID);
var assembly = Assembly.GetExecutingAssembly();
StaticLogger = Logger;
Configuration = new Configuration(Config);
if (!Configuration.Enabled.Value || Configuration.WebhookUrl.Value.Length <= 0) return;
harmony.PatchAll(assembly);
Logger.LogMessage($"{AUTHOR}'s {MODNAME} (v{VERSION}) has started");
}
}
}