add: more commands
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user