dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit a3c44e7aa744f461223dee3044913579261a1be9
parent 6e89639b79e560dbbdd83118f747870e2ac92b93
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 15 Nov 2022 14:24:33 -0500

error command; for testing

Diffstat:
Mpkg/web/handlers/api/v1/slashInterceptor.go | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -73,7 +73,8 @@ func handleUserCmd(c *Command) (handled bool) { handleSha512Cmd(c) || handleDiceCmd(c) || handleChoiceCmd(c) || - handleSuccessCmd(c) + handleSuccessCmd(c) || + handleErrorCmd(c) } func handlePrivateRoomCmd(c *Command) (handled bool) { @@ -1278,3 +1279,11 @@ func handleSuccessCmd(c *Command) (handled bool) { } return } + +func handleErrorCmd(c *Command) (handled bool) { + if c.message == "/error" { + c.err = errors.New("error message") + return true + } + return +}