Reimplemnt slash command

This commit is contained in:
semblanceofsense 2025-02-01 12:04:30 -07:00
parent 6f6a1201d8
commit 7ca6319244

View File

@ -50,8 +50,19 @@ func Run(BotToken string) {
switch data.Name { switch data.Name {
case "solve-maze": case "solve-maze":
maze, err := getMaze.GetMaze(i.ApplicationCommandData().Options[0].Value.(string))
} if err != nil {
responseData = "You must provide an image! Select the maze, click \"open in browser\", and copy the link of the image"
} else {
if (len(maze) < 1) {
responseData = "You must provide an image! Select the maze, click \"open in browser\", and copy the link of the image"
} else {
points := solvemaze.FindPath(maze)
if (len(points) < 1) {
responseData = "You must provide an image! Select the maze, click \"open in browser\", and copy the link of the image"
} else {
outputmaze.EditMaze(points, "/tmp/maze.png", "/tmp/outputmaze.png")
}}}}
if responseData != "" { if responseData != "" {
err = s.InteractionRespond( err = s.InteractionRespond(