Formatted code and rebuilt PluginLoader
This commit is contained in:
@@ -106,7 +106,7 @@ public class Boot
|
||||
if (arg.Message.Contains("401"))
|
||||
{
|
||||
Config.AppSettings.Remove("token");
|
||||
Config.Logger.Log("The token is invalid. Please restart the bot and enter a valid token.", source: typeof(Boot), type: LogType.CRITICAL);
|
||||
Config.Logger.Log("The token is invalid. Please restart the bot and enter a valid token.", typeof(Boot), LogType.CRITICAL);
|
||||
await Config.AppSettings.SaveToFile();
|
||||
await Task.Delay(4000);
|
||||
Environment.Exit(0);
|
||||
@@ -115,7 +115,7 @@ public class Boot
|
||||
|
||||
private async Task Client_LoggedOut()
|
||||
{
|
||||
Config.Logger.Log("Successfully Logged Out", source: typeof(Boot));
|
||||
Config.Logger.Log("Successfully Logged Out", typeof(Boot));
|
||||
await Log(new LogMessage(LogSeverity.Info, "Boot", "Successfully logged out from discord !"));
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class Boot
|
||||
|
||||
private Task LoggedIn()
|
||||
{
|
||||
Config.Logger.Log("Successfully Logged In", source: typeof(Boot));
|
||||
Config.Logger.Log("Successfully Logged In", typeof(Boot));
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -138,12 +138,12 @@ public class Boot
|
||||
{
|
||||
case LogSeverity.Error:
|
||||
case LogSeverity.Critical:
|
||||
Config.Logger.Log(message.Message, source: typeof(Boot), type: LogType.ERROR);
|
||||
Config.Logger.Log(message.Message, typeof(Boot), LogType.ERROR);
|
||||
break;
|
||||
|
||||
case LogSeverity.Info:
|
||||
case LogSeverity.Debug:
|
||||
Config.Logger.Log(message.Message, source: typeof(Boot), type: LogType.INFO);
|
||||
Config.Logger.Log(message.Message, typeof(Boot), LogType.INFO);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
@@ -25,9 +25,9 @@ internal class CommandHandler
|
||||
/// <param name="botPrefix">The prefix to watch for</param>
|
||||
public CommandHandler(DiscordSocketClient client, CommandService commandService, string botPrefix)
|
||||
{
|
||||
this._client = client;
|
||||
this._commandService = commandService;
|
||||
this._botPrefix = botPrefix;
|
||||
_client = client;
|
||||
_commandService = commandService;
|
||||
_botPrefix = botPrefix;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -103,12 +103,10 @@ internal class CommandHandler
|
||||
.FirstOrDefault(plug => plug.Command ==
|
||||
message.Content.Substring(mentionPrefix.Length + 1)
|
||||
.Split(' ')[0] ||
|
||||
(
|
||||
plug.Aliases is not null &&
|
||||
plug.Aliases.Contains(message.CleanContent
|
||||
.Substring(mentionPrefix.Length + 1)
|
||||
.Split(' ')[0]
|
||||
)
|
||||
plug.Aliases is not null &&
|
||||
plug.Aliases.Contains(message.CleanContent
|
||||
.Substring(mentionPrefix.Length + 1)
|
||||
.Split(' ')[0]
|
||||
)
|
||||
);
|
||||
|
||||
@@ -120,11 +118,11 @@ internal class CommandHandler
|
||||
plugin = PluginLoader.Commands!
|
||||
.FirstOrDefault(p => p.Command ==
|
||||
message.Content.Split(' ')[0].Substring(_botPrefix.Length) ||
|
||||
(p.Aliases is not null &&
|
||||
p.Aliases.Contains(
|
||||
message.Content.Split(' ')[0]
|
||||
.Substring(_botPrefix.Length)
|
||||
))
|
||||
p.Aliases is not null &&
|
||||
p.Aliases.Contains(
|
||||
message.Content.Split(' ')[0]
|
||||
.Substring(_botPrefix.Length)
|
||||
)
|
||||
);
|
||||
cleanMessage = message.Content.Substring(_botPrefix.Length);
|
||||
}
|
||||
@@ -144,9 +142,9 @@ internal class CommandHandler
|
||||
DbCommandExecutingArguments cmd = new(context, cleanMessage, split[0], argsClean);
|
||||
|
||||
Config.Logger.Log(
|
||||
message: $"User ({context.User.Username}) from Guild \"{context.Guild.Name}\" executed command \"{cmd.cleanContent}\"",
|
||||
source: typeof(CommandHandler),
|
||||
type: LogType.INFO
|
||||
$"User ({context.User.Username}) from Guild \"{context.Guild.Name}\" executed command \"{cmd.cleanContent}\"",
|
||||
typeof(CommandHandler),
|
||||
LogType.INFO
|
||||
);
|
||||
|
||||
if (context.Channel is SocketDMChannel)
|
||||
|
||||
Reference in New Issue
Block a user