Added in fail checks on files existing for all the JSON files in the project. Minus questions.json since that file doesn't exist quite yet.

This commit is contained in:
Christopher Darnell committed 2021-04-18 00:43:18 -07:00
1 parent 9af84c3e62
commit f1ac028c35
4 files changed
+216 -26

No files matched your search

+9 -1
View File
@@ -201,6 +201,12 @@ namespace StarsiegeBot
{
d.Logger.LogDebug(BotEventId, "Event_MessageCreated.");
// Ignore all bots. We don't care.
if (e.Author.IsBot)
{
return Task.CompletedTask;
}
CommandsNextExtension cnext = d.GetCommandsNext();
DiscordMessage msg = e.Message;
@@ -208,7 +214,7 @@ namespace StarsiegeBot
// json file loaded...
int cmdStart = msg.GetStringPrefixLength("!");
// e.
// if Guild is null, do nothing for now.
if (e.Guild is null)
{
@@ -223,10 +229,12 @@ namespace StarsiegeBot
// see if the guild wants global prefixes.
if (BotSettings.GuildSettings[gId].UseGlobalPrefix)
{
// add the Guild prefixes to the list of others.
prefixes = prefixes.Concat(BotSettings.GuildSettings[gId].Prefixes).ToList();
}
else
{
// dont use defaults? reset list to just the guild prefixes.
prefixes = BotSettings.GuildSettings[gId].Prefixes;
}
}