commit 4c2cf54ddfa99ee82753ca386c16e58797047714 parent 82ed989407b812811980c917617a51a9e56fa639 Author: n0tr1v <n0tr1v@protonmail.com> Date: Tue, 23 May 2023 17:24:21 -0700 Add /date command Diffstat:
| M | pkg/web/handlers/api/v1/slashInterceptor.go | | | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -89,6 +89,7 @@ func handleUserCmd(c *Command) (handled bool) { handleListMemes(c) || handleSuccessCmd(c) || handleAfkCmd(c) || + handleDateCmd(c) || handleErrorCmd(c) } @@ -1524,6 +1525,15 @@ func handleAfkCmd(c *Command) (handled bool) { return } +func handleDateCmd(c *Command) (handled bool) { + if c.message == "/date" { + c.zeroMsg(time.Now().Format(time.RFC1123)) + c.err = ErrRedirect + return true + } + return +} + func handleSuccessCmd(c *Command) (handled bool) { if c.message == "/success" { c.err = NewErrSuccess("success message")