Skip to content

Commit

Permalink
feat: don't load on no token
Browse files Browse the repository at this point in the history
  • Loading branch information
JayXTQ committed Dec 9, 2024
1 parent ae801f5 commit ea9a215
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions DiscordLab.Bot/API/Modules/HandlerLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class HandlerLoader
/// </remarks>
public void Load(Assembly assembly)
{
if (Plugin.Instance.Config.Token is "token" or "") return;
Type registerType = typeof(IRegisterable);
foreach (Type type in assembly.GetTypes())
{
Expand Down
6 changes: 6 additions & 0 deletions DiscordLab.Bot/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public class Plugin : Plugin<Config>

public override void OnEnabled()
{
if(Config.Token is "token" or "")
{
Log.Error("Please set the bot token in the config file.");
return;
}

Instance = this;

_handlerLoader = new ();
Expand Down

0 comments on commit ea9a215

Please sign in to comment.