Skip to content

Commit

Permalink
exit command
Browse files Browse the repository at this point in the history
  • Loading branch information
drizzle-mizzle committed Jul 5, 2023
1 parent d5dd5c9 commit 85f5eb4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Handlers/Commands/OneShotCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ public async Task AllAlert([Remainder] string text)
}
}

[Command("##exit")]
public async Task ExitApp()
{
if (!ValidatePublic(Context) || !ValidateUserAccess(Context))
await NoPermissionAlert(Context).ConfigureAwait(false);
else
{
await Context.Message.ReplyAsync($"{WARN_SIGN_DISCORD} Shutting down...");

try { CharacterAI.Integration.KillChromes(_handler.CurrentIntegration.EXEC_PATH); }
catch (Exception e)
{
throw new("Failed to kill Chrome processes.\n" + e.ToString());
}
Environment.Exit(0);
}
}

[Command("ping")]
public async Task Ping()
=> await Context.Message.ReplyAsync($"Pong! - {Context.Client.Latency} ms").ConfigureAwait(false);
Expand Down

0 comments on commit 85f5eb4

Please sign in to comment.