add: more commands

This commit is contained in:
2026-02-17 09:01:41 -08:00
parent 424abfbb9e
commit ade140bb87
7 changed files with 332 additions and 44 deletions

View File

@@ -3,6 +3,7 @@ package rcon
import (
"context"
"fmt"
"log/slog"
"os"
"time"
@@ -37,6 +38,8 @@ func (c *Client) Execute(command string) (string, error) {
return "", fmt.Errorf("failed to execute command '%s': %w", command, err)
}
slog.Info("executed command", "cmd", command, "resp", response)
return response, nil
}
@@ -54,21 +57,6 @@ func (c *Client) Ping() error {
return err
}
// SetWeather sets the weather in the Minecraft world
func (c *Client) SetWeather(weather string) error {
return fmt.Errorf("not implemented")
}
// SetTime sets the time in the Minecraft world
func (c *Client) SetTime(timeValue string) error {
return fmt.Errorf("not implemented")
}
// SetDifficulty sets the difficulty level
func (c *Client) SetDifficulty(difficulty string) error {
return fmt.Errorf("not implemented")
}
func (c *Client) Say(msg string) error {
_, err := c.Execute("/say " + msg)
return err