Fixed custom command handler. Fixed up DeathMessage Add sub command.

This commit is contained in:
Christopher Darnell committed 2021-04-17 17:12:54 -07:00
1 parent c96f85d4a5
commit bc8ae6c02f
1 file changed
+11 -5
+11 -5
View File
@@ -65,7 +65,7 @@ namespace StarsiegeBot
if (args.Length > 0) if (args.Length > 0)
BotName = args[0].ToLower(); BotName = args[0].ToLower();
else else
BotName = "cybrid"; BotName = "sspdev";
BotEventId = new EventId(276, BotName); BotEventId = new EventId(276, BotName);
} }
@@ -82,7 +82,7 @@ namespace StarsiegeBot
AutoReconnect = true, AutoReconnect = true,
MinimumLogLevel = LogLevel.Debug, MinimumLogLevel = LogLevel.Debug,
Intents = DiscordIntents.AllUnprivileged, Intents = DiscordIntents.All,
}; };
// then we want to instantiate our client // then we want to instantiate our client
@@ -208,6 +208,13 @@ namespace StarsiegeBot
// json file loaded... // json file loaded...
int cmdStart = msg.GetStringPrefixLength("!"); int cmdStart = msg.GetStringPrefixLength("!");
// e.
if (e.Guild is null)
{
}
else
{
string gId = e.Guild.Id.ToString(); string gId = e.Guild.Id.ToString();
List<string> prefixes = BotSettings.GuildSettings["default"].Prefixes; List<string> prefixes = BotSettings.GuildSettings["default"].Prefixes;
// Check to see if the guild has settings. // Check to see if the guild has settings.
@@ -243,6 +250,7 @@ namespace StarsiegeBot
var ctx = cnext.CreateContext(msg, prefix, command, args); var ctx = cnext.CreateContext(msg, prefix, command, args);
Task.Run(async () => await cnext.ExecuteCommandAsync(ctx)); Task.Run(async () => await cnext.ExecuteCommandAsync(ctx));
}
return Task.CompletedTask; return Task.CompletedTask;
} }
@@ -362,9 +370,6 @@ namespace StarsiegeBot
BotSettings.GuildSettings.Add(gId, item); BotSettings.GuildSettings.Add(gId, item);
} }
if (e.Guild.Id == 376937422010974209)
{
}
// let's log the name of the guild that was just // let's log the name of the guild that was just
// sent to our client // sent to our client
d.Logger.LogInformation(BotEventId, $"Guild available: {e.Guild.Name}"); d.Logger.LogInformation(BotEventId, $"Guild available: {e.Guild.Name}");
@@ -397,6 +402,7 @@ namespace StarsiegeBot
private Task Event_GuildDownloadCompleted(DiscordClient d, GuildDownloadCompletedEventArgs e) private Task Event_GuildDownloadCompleted(DiscordClient d, GuildDownloadCompletedEventArgs e)
{ {
d.Logger.LogDebug(BotEventId, "Event_GuildDownloadCompleted."); d.Logger.LogDebug(BotEventId, "Event_GuildDownloadCompleted.");
notify = e.Guilds[376937422010974209].Members[139548200099905536];
return Task.CompletedTask; return Task.CompletedTask;
} }
private Task Event_GuildEmojisUpdated(DiscordClient d, GuildEmojisUpdateEventArgs e) private Task Event_GuildEmojisUpdated(DiscordClient d, GuildEmojisUpdateEventArgs e)